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

Unified Diff: chrome/browser/extensions/permission_message_combinations_unittest.cc

Issue 2379573008: Add SetImageData api to chrome.clipboard. (Closed)
Patch Set: Adjust clipboard api permissions to method level, etc. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/permission_message_combinations_unittest.cc
diff --git a/chrome/browser/extensions/permission_message_combinations_unittest.cc b/chrome/browser/extensions/permission_message_combinations_unittest.cc
index 4619b83ed24e34b9d4dfc40599d897fffbcbbd85..b28a26f5d3baf9c3eea5a3bf7a742de10c1c53b2 100644
--- a/chrome/browser/extensions/permission_message_combinations_unittest.cc
+++ b/chrome/browser/extensions/permission_message_combinations_unittest.cc
@@ -1162,6 +1162,47 @@ TEST_F(PermissionMessageCombinationsUnittest, PluginPermission) {
ASSERT_TRUE(CheckManifestProducesPermissions());
}
+TEST_F(PermissionMessageCombinationsUnittest, ClipboardPermissionMessages) {
+ CreateAndInstall(
Devlin 2016/12/29 16:53:17 slightly cleaner: const char kManifest[] = "{"
jennyz 2016/12/29 20:20:03 Done.
+ "{"
+ " 'app': {"
+ " 'background': {"
+ " 'scripts': ['background.js']"
+ " }"
+ " },"
+ " 'permissions': ["
+ " 'clipboardRead'"
+ " ]"
+ "}");
+ ASSERT_TRUE(CheckManifestProducesPermissions("Read data you copy and paste"));
+
+ CreateAndInstall(
+ "{"
+ " 'app': {"
+ " 'background': {"
+ " 'scripts': ['background.js']"
+ " }"
+ " },"
+ " 'permissions': ["
+ " 'clipboardRead', 'clipboardWrite'"
+ " ]"
+ "}");
+ ASSERT_TRUE(CheckManifestProducesPermissions("Access your clipboard"));
+
+ CreateAndInstall(
+ "{"
+ " 'app': {"
+ " 'background': {"
+ " 'scripts': ['background.js']"
+ " }"
+ " },"
+ " 'permissions': ["
+ " 'clipboardWrite'"
+ " ]"
+ "}");
+ ASSERT_TRUE(CheckManifestProducesPermissions("Copy data to your clipboard"));
+}
+
// TODO(sashab): Add a test that checks that messages are generated correctly
// for withheld permissions, when an app is granted the 'all sites' permission.

Powered by Google App Engine
This is Rietveld 408576698