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

Side by Side Diff: chrome/browser/extensions/permission_message_combinations_unittest.cc

Issue 2950203002: Add new permission string for extensions that override new tab pages. (Closed)
Patch Set: Devlin's last feedback. Created 3 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/values_test_util.h" 10 #include "base/test/values_test_util.h"
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 CreateAndInstall( 1180 CreateAndInstall(
1181 base::StringPrintf(kManifest, "'clipboardRead', 'clipboardWrite'")); 1181 base::StringPrintf(kManifest, "'clipboardRead', 'clipboardWrite'"));
1182 ASSERT_TRUE(CheckManifestProducesPermissions( 1182 ASSERT_TRUE(CheckManifestProducesPermissions(
1183 "Read and modify data you copy and paste")); 1183 "Read and modify data you copy and paste"));
1184 1184
1185 CreateAndInstall(base::StringPrintf(kManifest, "'clipboardWrite'")); 1185 CreateAndInstall(base::StringPrintf(kManifest, "'clipboardWrite'"));
1186 ASSERT_TRUE( 1186 ASSERT_TRUE(
1187 CheckManifestProducesPermissions("Modify data you copy and paste")); 1187 CheckManifestProducesPermissions("Modify data you copy and paste"));
1188 } 1188 }
1189 1189
1190 TEST_F(PermissionMessageCombinationsUnittest, NewTabPagePermissionMessages) {
1191 const char kManifest[] =
1192 "{"
1193 " 'chrome_url_overrides': {"
1194 " 'newtab': 'newtab.html'"
1195 " }"
1196 "}";
1197
1198 CreateAndInstall(kManifest);
1199 ASSERT_TRUE(CheckManifestProducesPermissions(
1200 "Replace the page you see when opening a new tab"));
1201 }
1202
1190 // TODO(sashab): Add a test that checks that messages are generated correctly 1203 // TODO(sashab): Add a test that checks that messages are generated correctly
1191 // for withheld permissions, when an app is granted the 'all sites' permission. 1204 // for withheld permissions, when an app is granted the 'all sites' permission.
1192 1205
1193 // TODO(sashab): Add a test that ensures that all permissions that can generate 1206 // TODO(sashab): Add a test that ensures that all permissions that can generate
1194 // a coalesced message can also generate a message on their own (i.e. ensure 1207 // a coalesced message can also generate a message on their own (i.e. ensure
1195 // that no permissions only modify other permissions). 1208 // that no permissions only modify other permissions).
1196 1209
1197 // TODO(sashab): Add a test for every permission message combination that can 1210 // TODO(sashab): Add a test for every permission message combination that can
1198 // generate a message. 1211 // generate a message.
1199 1212
1200 // TODO(aboxhall): Add tests for the automation API permission messages. 1213 // TODO(aboxhall): Add tests for the automation API permission messages.
1201 1214
1202 } // namespace extensions 1215 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_loading_browsertest.cc ('k') | chrome/common/extensions/chrome_manifest_url_handlers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698