| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 void DisableExtensionsExceptBrowserTest::SetUpCommandLine( | 321 void DisableExtensionsExceptBrowserTest::SetUpCommandLine( |
| 322 base::CommandLine* command_line) { | 322 base::CommandLine* command_line) { |
| 323 ExtensionBrowserTest::SetUpCommandLine(command_line); | 323 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 324 base::FilePath fp1(test_data_dir_.AppendASCII("app_dot_com_app/")); | 324 base::FilePath fp1(test_data_dir_.AppendASCII("app_dot_com_app/")); |
| 325 base::FilePath fp2(test_data_dir_.AppendASCII("app/")); | 325 base::FilePath fp2(test_data_dir_.AppendASCII("app/")); |
| 326 | 326 |
| 327 command_line->AppendSwitchASCII( | 327 command_line->AppendSwitchASCII( |
| 328 switches::kDisableExtensionsExcept, | 328 switches::kDisableExtensionsExcept, |
| 329 fp1.AsUTF8Unsafe() + "," + fp2.AsUTF8Unsafe()); | 329 fp1.AsUTF8Unsafe() + "," + fp2.AsUTF8Unsafe()); |
| 330 |
| 331 command_line->AppendSwitch(switches::kNoErrorDialogs); |
| 330 } | 332 } |
| 331 | 333 |
| 332 // Tests disabling all extensions except those listed | 334 // Tests disabling all extensions except those listed |
| 333 // (--disable-extensions-except). | 335 // (--disable-extensions-except). |
| 334 IN_PROC_BROWSER_TEST_F(DisableExtensionsExceptBrowserTest, | 336 IN_PROC_BROWSER_TEST_F(DisableExtensionsExceptBrowserTest, |
| 335 DisableExtensionsExceptFlag) { | 337 DisableExtensionsExceptFlag) { |
| 336 EXPECT_FALSE(extension_service()->extensions_enabled()); | 338 EXPECT_FALSE(extension_service()->extensions_enabled()); |
| 337 | 339 |
| 338 // Checks that the extensions loaded with the --disable-extensions-except flag | 340 // Checks that the extensions loaded with the --disable-extensions-except flag |
| 339 // are enabled. | 341 // are enabled. |
| 340 bool is_app_dot_com_extension_enabled = false; | 342 bool is_app_dot_com_extension_enabled = false; |
| 341 bool is_app_test_extension_enabled = false; | 343 bool is_app_test_extension_enabled = false; |
| 342 for (const scoped_refptr<const extensions::Extension>& extension : | 344 for (const scoped_refptr<const extensions::Extension>& extension : |
| 343 GetExtensionRegistry()->enabled_extensions()) { | 345 GetExtensionRegistry()->enabled_extensions()) { |
| 344 if (extension->name() == "App Dot Com: The App") { | 346 if (extension->name() == "App Dot Com: The App") { |
| 345 is_app_dot_com_extension_enabled = true; | 347 is_app_dot_com_extension_enabled = true; |
| 346 } else if (extension->name() == "App Test") { | 348 } else if (extension->name() == "App Test") { |
| 347 is_app_test_extension_enabled = true; | 349 is_app_test_extension_enabled = true; |
| 348 } else { | 350 } else { |
| 349 EXPECT_TRUE( | 351 EXPECT_TRUE( |
| 350 extensions::Manifest::IsComponentLocation(extension->location())); | 352 extensions::Manifest::IsComponentLocation(extension->location())); |
| 351 } | 353 } |
| 352 } | 354 } |
| 353 EXPECT_TRUE(is_app_dot_com_extension_enabled); | 355 EXPECT_TRUE(is_app_dot_com_extension_enabled); |
| 354 EXPECT_TRUE(is_app_test_extension_enabled); | 356 EXPECT_TRUE(is_app_test_extension_enabled); |
| 355 } | 357 } |
| OLD | NEW |