| OLD | NEW |
| 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 "chrome/browser/extensions/api/permissions/permissions_api.h" | 5 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_prefs.h" | 7 #include "chrome/browser/extensions/extension_prefs.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/extensions/permissions/permission_set.h" | 12 #include "chrome/common/extensions/permissions/permission_set.h" |
| 13 #include "net/base/mock_host_resolver.h" | 13 #include "net/dns/mock_host_resolver.h" |
| 14 | 14 |
| 15 using extensions::APIPermission; | 15 using extensions::APIPermission; |
| 16 using extensions::APIPermissionSet; | 16 using extensions::APIPermissionSet; |
| 17 using extensions::PermissionSet; | 17 using extensions::PermissionSet; |
| 18 using extensions::URLPatternSet; | 18 using extensions::URLPatternSet; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { | 22 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { |
| 23 int schemes = URLPattern::SCHEME_ALL; | 23 int schemes = URLPattern::SCHEME_ALL; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd")); | 156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd")); |
| 157 } | 157 } |
| 158 | 158 |
| 159 // Test requesting, querying, and removing host permissions for host | 159 // Test requesting, querying, and removing host permissions for host |
| 160 // permissions that are a subset of the optional permissions. | 160 // permissions that are a subset of the optional permissions. |
| 161 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, HostSubsets) { | 161 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, HostSubsets) { |
| 162 PermissionsRequestFunction::SetAutoConfirmForTests(true); | 162 PermissionsRequestFunction::SetAutoConfirmForTests(true); |
| 163 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); | 163 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); |
| 164 EXPECT_TRUE(RunExtensionTest("permissions/host_subsets")) << message_; | 164 EXPECT_TRUE(RunExtensionTest("permissions/host_subsets")) << message_; |
| 165 } | 165 } |
| OLD | NEW |