Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/test/values_test_util.h" | 9 #include "base/test/values_test_util.h" |
| 10 #include "chrome/browser/extensions/test_extension_environment.h" | 10 #include "chrome/browser/extensions/test_extension_environment.h" |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 " 'scripts': ['background.js']" | 1155 " 'scripts': ['background.js']" |
| 1156 " }" | 1156 " }" |
| 1157 " }," | 1157 " }," |
| 1158 " 'plugins': [" | 1158 " 'plugins': [" |
| 1159 " { 'path': 'extension_plugin.dll' }" | 1159 " { 'path': 'extension_plugin.dll' }" |
| 1160 " ]" | 1160 " ]" |
| 1161 "}"); | 1161 "}"); |
| 1162 ASSERT_TRUE(CheckManifestProducesPermissions()); | 1162 ASSERT_TRUE(CheckManifestProducesPermissions()); |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 TEST_F(PermissionMessageCombinationsUnittest, ClipboardPermissionMessages) { | |
| 1166 CreateAndInstall( | |
|
Devlin
2016/12/29 16:53:17
slightly cleaner:
const char kManifest[] =
"{"
jennyz
2016/12/29 20:20:03
Done.
| |
| 1167 "{" | |
| 1168 " 'app': {" | |
| 1169 " 'background': {" | |
| 1170 " 'scripts': ['background.js']" | |
| 1171 " }" | |
| 1172 " }," | |
| 1173 " 'permissions': [" | |
| 1174 " 'clipboardRead'" | |
| 1175 " ]" | |
| 1176 "}"); | |
| 1177 ASSERT_TRUE(CheckManifestProducesPermissions("Read data you copy and paste")); | |
| 1178 | |
| 1179 CreateAndInstall( | |
| 1180 "{" | |
| 1181 " 'app': {" | |
| 1182 " 'background': {" | |
| 1183 " 'scripts': ['background.js']" | |
| 1184 " }" | |
| 1185 " }," | |
| 1186 " 'permissions': [" | |
| 1187 " 'clipboardRead', 'clipboardWrite'" | |
| 1188 " ]" | |
| 1189 "}"); | |
| 1190 ASSERT_TRUE(CheckManifestProducesPermissions("Access your clipboard")); | |
| 1191 | |
| 1192 CreateAndInstall( | |
| 1193 "{" | |
| 1194 " 'app': {" | |
| 1195 " 'background': {" | |
| 1196 " 'scripts': ['background.js']" | |
| 1197 " }" | |
| 1198 " }," | |
| 1199 " 'permissions': [" | |
| 1200 " 'clipboardWrite'" | |
| 1201 " ]" | |
| 1202 "}"); | |
| 1203 ASSERT_TRUE(CheckManifestProducesPermissions("Copy data to your clipboard")); | |
| 1204 } | |
| 1205 | |
| 1165 // TODO(sashab): Add a test that checks that messages are generated correctly | 1206 // TODO(sashab): Add a test that checks that messages are generated correctly |
| 1166 // for withheld permissions, when an app is granted the 'all sites' permission. | 1207 // for withheld permissions, when an app is granted the 'all sites' permission. |
| 1167 | 1208 |
| 1168 // TODO(sashab): Add a test that ensures that all permissions that can generate | 1209 // TODO(sashab): Add a test that ensures that all permissions that can generate |
| 1169 // a coalesced message can also generate a message on their own (i.e. ensure | 1210 // a coalesced message can also generate a message on their own (i.e. ensure |
| 1170 // that no permissions only modify other permissions). | 1211 // that no permissions only modify other permissions). |
| 1171 | 1212 |
| 1172 // TODO(sashab): Add a test for every permission message combination that can | 1213 // TODO(sashab): Add a test for every permission message combination that can |
| 1173 // generate a message. | 1214 // generate a message. |
| 1174 | 1215 |
| 1175 // TODO(aboxhall): Add tests for the automation API permission messages. | 1216 // TODO(aboxhall): Add tests for the automation API permission messages. |
| 1176 | 1217 |
| 1177 } // namespace extensions | 1218 } // namespace extensions |
| OLD | NEW |