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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/prefs/pref_registry_simple.h" | |
12 #include "base/prefs/testing_pref_service.h" | |
13 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
14 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
15 #include "base/values.h" | 13 #include "base/values.h" |
16 #include "chrome/browser/extensions/extension_management.h" | 14 #include "chrome/browser/extensions/extension_management.h" |
17 #include "chrome/browser/extensions/extension_management_test_util.h" | 15 #include "chrome/browser/extensions/extension_management_test_util.h" |
18 #include "chrome/browser/extensions/permissions_based_management_policy_provider
.h" | 16 #include "chrome/browser/extensions/permissions_based_management_policy_provider
.h" |
19 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" | 17 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" |
| 18 #include "components/prefs/pref_registry_simple.h" |
| 19 #include "components/prefs/testing_pref_service.h" |
20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
21 #include "extensions/common/manifest.h" | 21 #include "extensions/common/manifest.h" |
22 #include "extensions/common/manifest_constants.h" | 22 #include "extensions/common/manifest_constants.h" |
23 #include "extensions/common/permissions/api_permission.h" | 23 #include "extensions/common/permissions/api_permission.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 | 27 |
28 class PermissionsBasedManagementPolicyProviderTest : public testing::Test { | 28 class PermissionsBasedManagementPolicyProviderTest : public testing::Test { |
29 public: | 29 public: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 pref.ClearBlockedPermissions("*"); | 160 pref.ClearBlockedPermissions("*"); |
161 pref.AddBlockedPermission("*", | 161 pref.AddBlockedPermission("*", |
162 GetAPIPermissionName(APIPermission::kDownloads)); | 162 GetAPIPermissionName(APIPermission::kDownloads)); |
163 } | 163 } |
164 error16.clear(); | 164 error16.clear(); |
165 EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16)); | 165 EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16)); |
166 EXPECT_FALSE(error16.empty()); | 166 EXPECT_FALSE(error16.empty()); |
167 } | 167 } |
168 | 168 |
169 } // namespace extensions | 169 } // namespace extensions |
OLD | NEW |