Index: chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc |
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc |
index 1e5442ca024f99613ce9c18b570c93d51451f338..4f3a2c94f9d6e3fd4cb2f1cd9bd7f344fdea44b2 100644 |
--- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc |
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc |
@@ -65,6 +65,13 @@ TEST_F(PlatformAppsManifestTest, PlatformApps) { |
} |
TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) { |
+ // The whitelisted extension ID is cached the first time it is used, so set it |
+ // before running the test. This is the ID corresponding to the base 64 |
+ // encoded key in the init_platform_app_csp.json manifest. |
+ std::string test_id = "ahplfneplbnjcflhdgkkjeiglkkfeelb"; |
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
+ switches::kWhitelistedExtensionID, test_id); |
+ |
// Normal platform apps can't specify a CSP value. |
Testcase warning_testcases[] = { |
Testcase( |
@@ -79,11 +86,7 @@ TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) { |
RunTestcases( |
warning_testcases, arraysize(warning_testcases), EXPECT_TYPE_WARNING); |
- // Whitelisted ones can (this is the ID corresponding to the base 64 encoded |
- // key in the init_platform_app_csp.json manifest.) |
- std::string test_id = "ahplfneplbnjcflhdgkkjeiglkkfeelb"; |
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
- switches::kWhitelistedExtensionID, test_id); |
+ // Whitelisted ones can. |
scoped_refptr<Extension> extension = |
LoadAndExpectSuccess("init_platform_app_csp.json"); |
EXPECT_EQ(0U, extension->install_warnings().size()) |