Chromium Code Reviews| 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 #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 Loading... | |
| 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 class DeprecatedLoadComponentExtensionSwitchBrowserTest | |
|
Devlin
2016/10/10 15:33:26
We don't always add a "this feature was properly r
catmullings
2016/10/10 19:30:44
Done.
| |
| 311 : public ExtensionBrowserTest { | |
| 312 public: | |
| 313 DeprecatedLoadComponentExtensionSwitchBrowserTest() {} | |
| 314 | |
| 315 void SetUpCommandLine(base::CommandLine* command_line) override; | |
| 316 | |
| 317 ExtensionRegistry* GetExtensionRegistry() { | |
| 318 return ExtensionRegistry::Get(browser()->profile()); | |
| 319 } | |
| 320 }; | |
| 321 | |
| 322 void DeprecatedLoadComponentExtensionSwitchBrowserTest::SetUpCommandLine( | |
| 323 base::CommandLine* command_line) { | |
| 324 ExtensionBrowserTest::SetUpCommandLine(command_line); | |
| 325 base::FilePath fp1(test_data_dir_.AppendASCII("app_dot_com_app/")); | |
| 326 base::FilePath fp2(test_data_dir_.AppendASCII("app/")); | |
| 327 | |
| 328 command_line->AppendSwitchASCII( | |
| 329 "load-component-extension", | |
| 330 fp1.AsUTF8Unsafe() + "," + fp2.AsUTF8Unsafe()); | |
| 331 } | |
| 332 | |
| 333 // Tests that the --load-component-extension flag is not supported. | |
| 334 IN_PROC_BROWSER_TEST_F(DeprecatedLoadComponentExtensionSwitchBrowserTest, | |
| 335 DefunctLoadComponentExtensionFlag) { | |
| 336 EXPECT_TRUE(extension_service()->extensions_enabled()); | |
| 337 | |
| 338 // Checks that the extensions loaded with the --load-component-extension flag | |
| 339 // are not installed. | |
| 340 bool is_app_dot_com_extension_installed = false; | |
| 341 bool is_app_test_extension_installed = false; | |
| 342 for (const scoped_refptr<const extensions::Extension>& extension : | |
| 343 GetExtensionRegistry()->enabled_extensions()) { | |
| 344 if (extension->name() == "App Dot Com: The App") { | |
| 345 is_app_dot_com_extension_installed = true; | |
| 346 } else if (extension->name() == "App Test") { | |
| 347 is_app_test_extension_installed = true; | |
| 348 } else { | |
| 349 EXPECT_TRUE( | |
| 350 extensions::Manifest::IsComponentLocation(extension->location())); | |
| 351 } | |
| 352 } | |
| 353 EXPECT_FALSE(is_app_dot_com_extension_installed); | |
| 354 EXPECT_FALSE(is_app_test_extension_installed); | |
| 355 } | |
| 356 | |
| 310 class DisableExtensionsExceptBrowserTest : public ExtensionBrowserTest { | 357 class DisableExtensionsExceptBrowserTest : public ExtensionBrowserTest { |
| 311 public: | 358 public: |
| 312 DisableExtensionsExceptBrowserTest() {} | 359 DisableExtensionsExceptBrowserTest() {} |
| 313 | 360 |
| 314 void SetUpCommandLine(base::CommandLine* command_line) override; | 361 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 315 | 362 |
| 316 ExtensionRegistry* GetExtensionRegistry() { | 363 ExtensionRegistry* GetExtensionRegistry() { |
| 317 return ExtensionRegistry::Get(browser()->profile()); | 364 return ExtensionRegistry::Get(browser()->profile()); |
| 318 } | 365 } |
| 319 }; | 366 }; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 346 } else if (extension->name() == "App Test") { | 393 } else if (extension->name() == "App Test") { |
| 347 is_app_test_extension_enabled = true; | 394 is_app_test_extension_enabled = true; |
| 348 } else { | 395 } else { |
| 349 EXPECT_TRUE( | 396 EXPECT_TRUE( |
| 350 extensions::Manifest::IsComponentLocation(extension->location())); | 397 extensions::Manifest::IsComponentLocation(extension->location())); |
| 351 } | 398 } |
| 352 } | 399 } |
| 353 EXPECT_TRUE(is_app_dot_com_extension_enabled); | 400 EXPECT_TRUE(is_app_dot_com_extension_enabled); |
| 354 EXPECT_TRUE(is_app_test_extension_enabled); | 401 EXPECT_TRUE(is_app_test_extension_enabled); |
| 355 } | 402 } |
| OLD | NEW |