18bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
28bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
38bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// found in the LICENSE file.
48bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
58bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_BROWSERTEST_H_
68bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_BROWSERTEST_H_
78bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
88bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "chrome/browser/extensions/extension_test_notification_observer.h"
946d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)#include "chrome/test/base/web_ui_browser_test.h"
10f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "extensions/common/extension.h"
118bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
128bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)class Profile;
138bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
148bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// C++ test fixture used by extension_settings_browsertest.js.
158bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)class ExtensionSettingsUIBrowserTest : public WebUIBrowserTest {
168bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) public:
178bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  ExtensionSettingsUIBrowserTest();
188bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  virtual ~ExtensionSettingsUIBrowserTest();
198bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
208bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) protected:
218bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  // Get the profile to use.
228bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  Profile* GetProfile();
238bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
248bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  const std::string& last_loaded_extension_id() {
258bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)    return observer_->last_loaded_extension_id();
268bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  }
278bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
288bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  virtual void SetUpOnMainThread() OVERRIDE;
298bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
308bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  void InstallGoodExtension();
318bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
328bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) private:
338bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  bool WaitForExtensionViewsToLoad();
348bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  const extensions::Extension* LoadUnpackedExtension(
358bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)      const base::FilePath& path);
368bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  const extensions::Extension* InstallExtension(const base::FilePath& path);
378bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
388bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  scoped_ptr<ExtensionTestNotificationObserver> observer_;
398bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
408bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  // The default profile to be used.
418bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  Profile* profile_;
428bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
438bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsUIBrowserTest);
448bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)};
458bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
468bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#endif  // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_BROWSERTEST_H_
47