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

Side by Side Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 12902044: Enable SyncFileSystem API on Stable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 9 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/api/_permission_features.json ('k') | no next file » | 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/json/json_file_value_serializer.h" 6 #include "base/json/json_file_value_serializer.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 apis.insert(APIPermission::kWebRequest); 1367 apis.insert(APIPermission::kWebRequest);
1368 apis.insert(APIPermission::kFileBrowserHandler); 1368 apis.insert(APIPermission::kFileBrowserHandler);
1369 EXPECT_EQ(2U, apis.size()); 1369 EXPECT_EQ(2U, apis.size());
1370 1370
1371 scoped_refptr<PermissionSet> perm_set; 1371 scoped_refptr<PermissionSet> perm_set;
1372 perm_set = new PermissionSet(apis, empty_extent, empty_extent); 1372 perm_set = new PermissionSet(apis, empty_extent, empty_extent);
1373 EXPECT_EQ(4U, perm_set->apis().size()); 1373 EXPECT_EQ(4U, perm_set->apis().size());
1374 } 1374 }
1375 1375
1376 TEST_F(PermissionsTest, SyncFileSystemPermission) { 1376 TEST_F(PermissionsTest, SyncFileSystemPermission) {
1377 // TODO(kinuko): Remove this in the same patch that enables this on Stable.
1378 extensions::Feature::ScopedCurrentChannel channel(
1379 chrome::VersionInfo::CHANNEL_DEV);
1380
1381 scoped_refptr<Extension> extension = LoadManifest( 1377 scoped_refptr<Extension> extension = LoadManifest(
1382 "permissions", "sync_file_system.json"); 1378 "permissions", "sync_file_system.json");
1383 APIPermissionSet apis; 1379 APIPermissionSet apis;
1384 apis.insert(APIPermission::kSyncFileSystem); 1380 apis.insert(APIPermission::kSyncFileSystem);
1385 EXPECT_TRUE(extension->is_platform_app()); 1381 EXPECT_TRUE(extension->is_platform_app());
1386 EXPECT_TRUE(extension->HasAPIPermission(APIPermission::kSyncFileSystem)); 1382 EXPECT_TRUE(extension->HasAPIPermission(APIPermission::kSyncFileSystem));
1387 std::vector<string16> warnings = extension->GetPermissionMessageStrings(); 1383 std::vector<string16> warnings = extension->GetPermissionMessageStrings();
1388 EXPECT_TRUE(Contains(warnings, "Store data in your Google Drive account")); 1384 EXPECT_TRUE(Contains(warnings, "Store data in your Google Drive account"));
1389 ASSERT_EQ(1u, warnings.size()); 1385 ASSERT_EQ(1u, warnings.size());
1390 } 1386 }
1391 1387
1392 } // namespace extensions 1388 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/_permission_features.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698