Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1737)

Unified Diff: chrome/browser/extensions/extension_startup_browsertest.cc

Issue 2389703005: Deprecate --load-component-extension command line flag (Closed)
Patch Set: Rebase master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_startup_browsertest.cc
diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc
index 18d84224e238f178d4c18e5c209b42769820ed64..e2aa865b415e991ecc3319a13b336b9798337da7 100644
--- a/chrome/browser/extensions/extension_startup_browsertest.cc
+++ b/chrome/browser/extensions/extension_startup_browsertest.cc
@@ -307,6 +307,54 @@ IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) {
TestInjection(true, true);
}
+// TODO(catmullings): Remove test in future chrome release, perhaps M59.
+class DeprecatedLoadComponentExtensionSwitchBrowserTest
+ : public ExtensionBrowserTest {
+ public:
+ DeprecatedLoadComponentExtensionSwitchBrowserTest() {}
+
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+
+ ExtensionRegistry* GetExtensionRegistry() {
+ return ExtensionRegistry::Get(browser()->profile());
+ }
+};
+
+void DeprecatedLoadComponentExtensionSwitchBrowserTest::SetUpCommandLine(
+ base::CommandLine* command_line) {
+ ExtensionBrowserTest::SetUpCommandLine(command_line);
+ base::FilePath fp1(test_data_dir_.AppendASCII("app_dot_com_app/"));
+ base::FilePath fp2(test_data_dir_.AppendASCII("app/"));
+
+ command_line->AppendSwitchASCII(
+ "load-component-extension",
+ fp1.AsUTF8Unsafe() + "," + fp2.AsUTF8Unsafe());
+}
+
+// Tests that the --load-component-extension flag is not supported.
+IN_PROC_BROWSER_TEST_F(DeprecatedLoadComponentExtensionSwitchBrowserTest,
+ DefunctLoadComponentExtensionFlag) {
+ EXPECT_TRUE(extension_service()->extensions_enabled());
+
+ // Checks that the extensions loaded with the --load-component-extension flag
+ // are not installed.
+ bool is_app_dot_com_extension_installed = false;
+ bool is_app_test_extension_installed = false;
+ for (const scoped_refptr<const extensions::Extension>& extension :
+ GetExtensionRegistry()->enabled_extensions()) {
+ if (extension->name() == "App Dot Com: The App") {
+ is_app_dot_com_extension_installed = true;
+ } else if (extension->name() == "App Test") {
+ is_app_test_extension_installed = true;
+ } else {
+ EXPECT_TRUE(
+ extensions::Manifest::IsComponentLocation(extension->location()));
+ }
+ }
+ EXPECT_FALSE(is_app_dot_com_extension_installed);
+ EXPECT_FALSE(is_app_test_extension_installed);
+}
+
class DisableExtensionsExceptBrowserTest : public ExtensionBrowserTest {
public:
DisableExtensionsExceptBrowserTest() {}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698