| 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_management_test_util.h" | 7 #include "chrome/browser/extensions/extension_management_test_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "components/policy/core/browser/browser_policy_connector.h" | 10 #include "components/policy/core/browser/browser_policy_connector.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Test requesting, querying, and removing host permissions for host | 190 // Test requesting, querying, and removing host permissions for host |
| 191 // permissions that are a subset of the optional permissions. | 191 // permissions that are a subset of the optional permissions. |
| 192 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, HostSubsets) { | 192 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, HostSubsets) { |
| 193 PermissionsRequestFunction::SetAutoConfirmForTests(true); | 193 PermissionsRequestFunction::SetAutoConfirmForTests(true); |
| 194 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); | 194 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); |
| 195 EXPECT_TRUE(RunExtensionTest("permissions/host_subsets")) << message_; | 195 EXPECT_TRUE(RunExtensionTest("permissions/host_subsets")) << message_; |
| 196 } | 196 } |
| 197 | 197 |
| 198 // Tests that requesting an optional permission from a background page, with |
| 199 // another window open, grants the permission and updates the bindings |
| 200 // (chrome.whatever, in this case chrome.alarms). Regression test for |
| 201 // crbug.com/435141, see details there for trickiness. |
| 202 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, OptionalPermissionsUpdatesBindings) { |
| 203 ASSERT_TRUE(RunExtensionTest("permissions/optional_updates_bindings")) |
| 204 << message_; |
| 205 } |
| 206 |
| 198 } // namespace extensions | 207 } // namespace extensions |
| OLD | NEW |