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/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 Loading... |
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 |
OLD | NEW |