| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
| 14 #include "chrome/browser/extensions/extension_host.h" | 14 #include "chrome/browser/extensions/extension_host.h" |
| 15 #include "chrome/browser/extensions/extension_system.h" | 15 #include "chrome/browser/extensions/extension_system.h" |
| 16 #include "chrome/browser/extensions/extension_test_notification_observer.h" | 16 #include "chrome/browser/extensions/extension_test_notification_observer.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/common/extensions/features/feature_channel.h" | 18 #include "chrome/common/extensions/features/feature_channel.h" |
| 19 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
| 22 #include "extensions/common/feature_switch.h" | 22 #include "extensions/common/feature_switch.h" |
| 23 #include "extensions/common/manifest.h" | 23 #include "extensions/common/manifest.h" |
| 24 | 24 |
| 25 class ExtensionService; | 25 class ExtensionService; |
| 26 class ExtensionSet; | |
| 27 class Profile; | 26 class Profile; |
| 28 | 27 |
| 29 namespace extensions { | 28 namespace extensions { |
| 29 class ExtensionSet; |
| 30 class ProcessManager; | 30 class ProcessManager; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Base class for extension browser tests. Provides utilities for loading, | 33 // Base class for extension browser tests. Provides utilities for loading, |
| 34 // unloading, and installing extensions. | 34 // unloading, and installing extensions. |
| 35 class ExtensionBrowserTest : virtual public InProcessBrowserTest { | 35 class ExtensionBrowserTest : virtual public InProcessBrowserTest { |
| 36 protected: | 36 protected: |
| 37 // Flags used to configure how the tests are run. | 37 // Flags used to configure how the tests are run. |
| 38 enum Flags { | 38 enum Flags { |
| 39 kFlagNone = 0, | 39 kFlagNone = 0, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 const std::string& last_loaded_extension_id() { | 64 const std::string& last_loaded_extension_id() { |
| 65 return observer_->last_loaded_extension_id(); | 65 return observer_->last_loaded_extension_id(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Get the profile to use. | 68 // Get the profile to use. |
| 69 Profile* profile(); | 69 Profile* profile(); |
| 70 | 70 |
| 71 static const extensions::Extension* GetExtensionByPath( | 71 static const extensions::Extension* GetExtensionByPath( |
| 72 const ExtensionSet* extensions, const base::FilePath& path); | 72 const extensions::ExtensionSet* extensions, const base::FilePath& path); |
| 73 | 73 |
| 74 // InProcessBrowserTest | 74 // InProcessBrowserTest |
| 75 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 75 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
| 76 virtual void SetUpOnMainThread() OVERRIDE; | 76 virtual void SetUpOnMainThread() OVERRIDE; |
| 77 | 77 |
| 78 const extensions::Extension* LoadExtension(const base::FilePath& path); | 78 const extensions::Extension* LoadExtension(const base::FilePath& path); |
| 79 | 79 |
| 80 // Same as above, but enables the extension in incognito mode first. | 80 // Same as above, but enables the extension in incognito mode first. |
| 81 const extensions::Extension* LoadExtensionIncognito( | 81 const extensions::Extension* LoadExtensionIncognito( |
| 82 const base::FilePath& path); | 82 const base::FilePath& path); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 // Disable external install UI. | 331 // Disable external install UI. |
| 332 extensions::FeatureSwitch::ScopedOverride | 332 extensions::FeatureSwitch::ScopedOverride |
| 333 override_prompt_for_external_extensions_; | 333 override_prompt_for_external_extensions_; |
| 334 | 334 |
| 335 // The default profile to be used. | 335 // The default profile to be used. |
| 336 Profile* profile_; | 336 Profile* profile_; |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 339 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| OLD | NEW |