OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
6 #include "chrome/browser/extensions/extension_action.h" | 6 #include "chrome/browser/extensions/extension_action.h" |
7 #include "chrome/browser/extensions/extension_action_manager.h" | 7 #include "chrome/browser/extensions/extension_action_manager.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // clicks if the activeTab permission is set. | 189 // clicks if the activeTab permission is set. |
190 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, | 190 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, |
191 TestOpenPopupDoesNotGrantTabPermissions) { | 191 TestOpenPopupDoesNotGrantTabPermissions) { |
192 if (!ShouldRunPopupTest()) | 192 if (!ShouldRunPopupTest()) |
193 return; | 193 return; |
194 | 194 |
195 OpenExtensionPopupViaAPI(); | 195 OpenExtensionPopupViaAPI(); |
196 ExtensionService* service = extensions::ExtensionSystem::Get( | 196 ExtensionService* service = extensions::ExtensionSystem::Get( |
197 browser()->profile())->extension_service(); | 197 browser()->profile())->extension_service(); |
198 ASSERT_FALSE( | 198 ASSERT_FALSE( |
199 PermissionsData::ForExtension( | 199 service->GetExtensionById(last_loaded_extension_id(), false) |
200 service->GetExtensionById(last_loaded_extension_id(), false)) | 200 ->permissions_data() |
201 ->HasAPIPermissionForTab( | 201 ->HasAPIPermissionForTab( |
202 SessionID::IdForTab( | 202 SessionID::IdForTab( |
203 browser()->tab_strip_model()->GetActiveWebContents()), | 203 browser()->tab_strip_model()->GetActiveWebContents()), |
204 APIPermission::kTab)); | 204 APIPermission::kTab)); |
205 } | 205 } |
206 | 206 |
207 // Test that the extension popup is closed when the browser window is clicked. | 207 // Test that the extension popup is closed when the browser window is clicked. |
208 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) { | 208 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) { |
209 if (!ShouldRunPopupTest()) | 209 if (!ShouldRunPopupTest()) |
210 return; | 210 return; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 311 |
312 // Forcibly closing the browser HWND should not cause a crash. | 312 // Forcibly closing the browser HWND should not cause a crash. |
313 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); | 313 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); |
314 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); | 314 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); |
315 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); | 315 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); |
316 } | 316 } |
317 #endif // OS_WIN | 317 #endif // OS_WIN |
318 | 318 |
319 } // namespace | 319 } // namespace |
320 } // namespace extensions | 320 } // namespace extensions |
OLD | NEW |