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

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

Issue 2172043002: chrome/browser/extensions: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/extensions/external_provider_impl.cc ('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 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 "chrome/browser/extensions/permissions_based_management_policy_provider .h" 5 #include "chrome/browser/extensions/permissions_based_management_policy_provider .h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 pref_names::kExtensionManagement); 42 pref_names::kExtensionManagement);
43 } 43 }
44 44
45 void TearDown() override { 45 void TearDown() override {
46 STLDeleteElements(&perm_list_); 46 STLDeleteElements(&perm_list_);
47 } 47 }
48 48
49 // Get API permissions name for |id|, we cannot use arbitrary strings since 49 // Get API permissions name for |id|, we cannot use arbitrary strings since
50 // they will be ignored by ExtensionManagementService. 50 // they will be ignored by ExtensionManagementService.
51 std::string GetAPIPermissionName(APIPermission::ID id) { 51 std::string GetAPIPermissionName(APIPermission::ID id) {
52 for (const auto& perm : perm_list_) { 52 for (auto* perm : perm_list_) {
53 if (perm->id() == id) 53 if (perm->id() == id)
54 return perm->name(); 54 return perm->name();
55 } 55 }
56 ADD_FAILURE() << "Permission not found: " << id; 56 ADD_FAILURE() << "Permission not found: " << id;
57 return std::string(); 57 return std::string();
58 } 58 }
59 59
60 // Create an extension with specified |location|, |required_permissions| and 60 // Create an extension with specified |location|, |required_permissions| and
61 // |optional_permissions|. 61 // |optional_permissions|.
62 scoped_refptr<const Extension> CreateExtensionWithPermission( 62 scoped_refptr<const Extension> CreateExtensionWithPermission(
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 pref.ClearBlockedPermissions("*"); 161 pref.ClearBlockedPermissions("*");
162 pref.AddBlockedPermission("*", 162 pref.AddBlockedPermission("*",
163 GetAPIPermissionName(APIPermission::kDownloads)); 163 GetAPIPermissionName(APIPermission::kDownloads));
164 } 164 }
165 error16.clear(); 165 error16.clear();
166 EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16)); 166 EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16));
167 EXPECT_FALSE(error16.empty()); 167 EXPECT_FALSE(error16.empty());
168 } 168 }
169 169
170 } // namespace extensions 170 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_provider_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698