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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 fourth_extension_path.AppendASCII("extensions").AppendASCII("app2"); 300 fourth_extension_path.AppendASCII("extensions").AppendASCII("app2");
301 load_extensions_.push_back(fourth_extension_path.value()); 301 load_extensions_.push_back(fourth_extension_path.value());
302 } 302 }
303 }; 303 };
304 304
305 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { 305 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) {
306 WaitForServicesToStart(4, true); 306 WaitForServicesToStart(4, true);
307 TestInjection(true, true); 307 TestInjection(true, true);
308 } 308 }
309 309
310 // TODO(catmullings): Remove test in future chrome release, perhaps M57.
Devlin 2016/12/05 22:31:01 let's make this maybe M59 now. :)
311 class DeprecatedLoadComponentExtensionSwitchBrowserTest
312 : public ExtensionBrowserTest {
313 public:
314 DeprecatedLoadComponentExtensionSwitchBrowserTest() {}
315
316 void SetUpCommandLine(base::CommandLine* command_line) override;
317
318 ExtensionRegistry* GetExtensionRegistry() {
319 return ExtensionRegistry::Get(browser()->profile());
320 }
321 };
322
323 void DeprecatedLoadComponentExtensionSwitchBrowserTest::SetUpCommandLine(
324 base::CommandLine* command_line) {
325 ExtensionBrowserTest::SetUpCommandLine(command_line);
326 base::FilePath fp1(test_data_dir_.AppendASCII("app_dot_com_app/"));
327 base::FilePath fp2(test_data_dir_.AppendASCII("app/"));
328
329 command_line->AppendSwitchASCII(
330 "load-component-extension",
331 fp1.AsUTF8Unsafe() + "," + fp2.AsUTF8Unsafe());
332 }
333
334 // Tests that the --load-component-extension flag is not supported.
335 IN_PROC_BROWSER_TEST_F(DeprecatedLoadComponentExtensionSwitchBrowserTest,
336 DefunctLoadComponentExtensionFlag) {
337 EXPECT_TRUE(extension_service()->extensions_enabled());
338
339 // Checks that the extensions loaded with the --load-component-extension flag
340 // are not installed.
341 bool is_app_dot_com_extension_installed = false;
342 bool is_app_test_extension_installed = false;
343 for (const scoped_refptr<const extensions::Extension>& extension :
344 GetExtensionRegistry()->enabled_extensions()) {
345 if (extension->name() == "App Dot Com: The App") {
346 is_app_dot_com_extension_installed = true;
347 } else if (extension->name() == "App Test") {
348 is_app_test_extension_installed = true;
349 } else {
350 EXPECT_TRUE(
351 extensions::Manifest::IsComponentLocation(extension->location()));
352 }
353 }
354 EXPECT_FALSE(is_app_dot_com_extension_installed);
355 EXPECT_FALSE(is_app_test_extension_installed);
356 }
357
310 class DisableExtensionsExceptBrowserTest : public ExtensionBrowserTest { 358 class DisableExtensionsExceptBrowserTest : public ExtensionBrowserTest {
311 public: 359 public:
312 DisableExtensionsExceptBrowserTest() {} 360 DisableExtensionsExceptBrowserTest() {}
313 361
314 void SetUpCommandLine(base::CommandLine* command_line) override; 362 void SetUpCommandLine(base::CommandLine* command_line) override;
315 363
316 ExtensionRegistry* GetExtensionRegistry() { 364 ExtensionRegistry* GetExtensionRegistry() {
317 return ExtensionRegistry::Get(browser()->profile()); 365 return ExtensionRegistry::Get(browser()->profile());
318 } 366 }
319 }; 367 };
(...skipping 26 matching lines...) Expand all
346 } else if (extension->name() == "App Test") { 394 } else if (extension->name() == "App Test") {
347 is_app_test_extension_enabled = true; 395 is_app_test_extension_enabled = true;
348 } else { 396 } else {
349 EXPECT_TRUE( 397 EXPECT_TRUE(
350 extensions::Manifest::IsComponentLocation(extension->location())); 398 extensions::Manifest::IsComponentLocation(extension->location()));
351 } 399 }
352 } 400 }
353 EXPECT_TRUE(is_app_dot_com_extension_enabled); 401 EXPECT_TRUE(is_app_dot_com_extension_enabled);
354 EXPECT_TRUE(is_app_test_extension_enabled); 402 EXPECT_TRUE(is_app_test_extension_enabled);
355 } 403 }
OLDNEW
« 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