Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Test that openPopup does not grant tab permissions like for browser action 188 // Test that openPopup does not grant tab permissions like for browser action
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(PermissionsData::HasAPIPermissionForTab( 198 ASSERT_FALSE(
199 service->GetExtensionById(last_loaded_extension_id(), false), 199 PermissionsData::ForExtension(
200 SessionID::IdForTab(browser()->tab_strip_model()->GetActiveWebContents()), 200 service->GetExtensionById(last_loaded_extension_id(), false))
201 APIPermission::kTab)); 201 ->HasAPIPermissionForTab(
202 SessionID::IdForTab(
203 browser()->tab_strip_model()->GetActiveWebContents()),
204 APIPermission::kTab));
202 } 205 }
203 206
204 // 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.
205 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) { 208 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) {
206 if (!ShouldRunPopupTest()) 209 if (!ShouldRunPopupTest())
207 return; 210 return;
208 211
209 // Open an extension popup via the chrome.browserAction.openPopup API. 212 // Open an extension popup via the chrome.browserAction.openPopup API.
210 content::WindowedNotificationObserver frame_observer( 213 content::WindowedNotificationObserver frame_observer(
211 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 214 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 311
309 // Forcibly closing the browser HWND should not cause a crash. 312 // Forcibly closing the browser HWND should not cause a crash.
310 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); 313 EXPECT_EQ(TRUE, ::CloseWindow(hwnd));
311 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); 314 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd));
312 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); 315 EXPECT_EQ(FALSE, ::IsWindow(hwnd));
313 } 316 }
314 #endif // OS_WIN 317 #endif // OS_WIN
315 318
316 } // namespace 319 } // namespace
317 } // namespace extensions 320 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698