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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc

Issue 2165023003: [Extensions] Use compiled feature files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months 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 | « chrome/common/extensions/chrome_extensions_client.cc ('k') | extensions/BUILD.gn » ('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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Testcase error_testcases[] = { 42 Testcase error_testcases[] = {
43 Testcase("init_invalid_platform_app_2.json", 43 Testcase("init_invalid_platform_app_2.json",
44 errors::kBackgroundRequiredForPlatformApps), 44 errors::kBackgroundRequiredForPlatformApps),
45 Testcase("init_invalid_platform_app_3.json", 45 Testcase("init_invalid_platform_app_3.json",
46 ErrorUtils::FormatErrorMessage( 46 ErrorUtils::FormatErrorMessage(
47 errors::kInvalidManifestVersionOld, "2", "apps")), 47 errors::kInvalidManifestVersionOld, "2", "apps")),
48 }; 48 };
49 RunTestcases(error_testcases, arraysize(error_testcases), EXPECT_TYPE_ERROR); 49 RunTestcases(error_testcases, arraysize(error_testcases), EXPECT_TYPE_ERROR);
50 50
51 Testcase warning_testcases[] = { 51 Testcase warning_testcases[] = {
52 Testcase( 52 Testcase(
53 "init_invalid_platform_app_1.json", 53 "init_invalid_platform_app_1.json",
54 "'app.launch' is only allowed for hosted apps and legacy packaged " 54 "'app.launch' is only allowed for legacy packaged apps and hosted "
55 "apps, but this is a packaged app."), 55 "apps, but this is a packaged app."),
56 Testcase( 56 Testcase("init_invalid_platform_app_4.json",
57 "init_invalid_platform_app_4.json", 57 "'background' is only allowed for extensions, legacy packaged "
58 "'background' is only allowed for extensions, hosted apps, and legacy " 58 "apps, and"
59 "packaged apps, but this is a packaged app."), 59 " hosted apps, but this is a packaged app."),
60 Testcase( 60 Testcase("init_invalid_platform_app_5.json",
61 "init_invalid_platform_app_5.json", 61 "'background' is only allowed for extensions, legacy packaged "
62 "'background' is only allowed for extensions, hosted apps, and legacy " 62 "apps, and"
63 "packaged apps, but this is a packaged app."), 63 " hosted apps, but this is a packaged app."),
64 Testcase("incognito_invalid_platform_app.json", 64 Testcase("incognito_invalid_platform_app.json",
65 "'incognito' is only allowed for extensions and legacy packaged apps, " 65 "'incognito' is only allowed for extensions and legacy packaged "
66 "but this is a packaged app."), 66 "apps, "
67 "but this is a packaged app."),
67 }; 68 };
68 RunTestcases( 69 RunTestcases(
69 warning_testcases, arraysize(warning_testcases), EXPECT_TYPE_WARNING); 70 warning_testcases, arraysize(warning_testcases), EXPECT_TYPE_WARNING);
70 } 71 }
71 72
72 TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) { 73 TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) {
73 // Normal platform apps can't specify a CSP value. 74 // Normal platform apps can't specify a CSP value.
74 Testcase warning_testcases[] = { 75 Testcase warning_testcases[] = {
75 Testcase( 76 Testcase(
76 "init_platform_app_csp_warning_1.json", 77 "init_platform_app_csp_warning_1.json",
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 142 }
142 143
143 // Now try again with the experimental flag set. 144 // Now try again with the experimental flag set.
144 base::CommandLine::ForCurrentProcess()->AppendSwitch( 145 base::CommandLine::ForCurrentProcess()->AppendSwitch(
145 switches::kEnableExperimentalExtensionApis); 146 switches::kEnableExperimentalExtensionApis);
146 for (const std::unique_ptr<ManifestData>& manifest : manifests) 147 for (const std::unique_ptr<ManifestData>& manifest : manifests)
147 LoadAndExpectSuccess(*manifest); 148 LoadAndExpectSuccess(*manifest);
148 } 149 }
149 150
150 } // namespace extensions 151 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/chrome_extensions_client.cc ('k') | extensions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698