| 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" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // TODO(kalman): ugh, it would be nice to test this condition, but it seems | 148 // TODO(kalman): ugh, it would be nice to test this condition, but it seems |
| 149 // like there's somehow a race here where the prefs aren't updated in time | 149 // like there's somehow a race here where the prefs aren't updated in time |
| 150 // with the "allow file access" bit, so we'll just have to trust that | 150 // with the "allow file access" bit, so we'll just have to trust that |
| 151 // RunExtensionTest (unlike RunExtensionTestNoFileAccess) does indeed | 151 // RunExtensionTest (unlike RunExtensionTestNoFileAccess) does indeed |
| 152 // not set the allow file access bit. Otherwise this test doesn't mean | 152 // not set the allow file access bit. Otherwise this test doesn't mean |
| 153 // a whole lot (i.e. file access works - but it'd better not be the case | 153 // a whole lot (i.e. file access works - but it'd better not be the case |
| 154 // that the extension actually has file access, since that'd be the bug | 154 // that the extension actually has file access, since that'd be the bug |
| 155 // that this is supposed to be testing). | 155 // that this is supposed to be testing). |
| 156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd")); | 156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd")); |
| 157 } | 157 } |
| 158 |
| 159 // Test requesting, querying, and removing host permissions for host |
| 160 // permissions that are a subset of the optional permissions. |
| 161 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, HostSubsets) { |
| 162 PermissionsRequestFunction::SetAutoConfirmForTests(true); |
| 163 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); |
| 164 EXPECT_TRUE(RunExtensionTest("permissions/host_subsets")) << message_; |
| 165 } |
| OLD | NEW |