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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc

Issue 17298002: Allow tabCapture API to be granted for chrome:// pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests.. how did it even work before? Created 7 years, 3 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 (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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #if defined(OS_MACOSX) 7 #if defined(OS_MACOSX)
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #endif 9 #endif
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 EXPECT_TRUE(fullscreen_entered.WaitUntilSatisfied()); 249 EXPECT_TRUE(fullscreen_entered.WaitUntilSatisfied());
250 browser()->fullscreen_controller()->ToggleFullscreenModeForTab(web_contents, 250 browser()->fullscreen_controller()->ToggleFullscreenModeForTab(web_contents,
251 false); 251 false);
252 fullscreen_entered.Reply(""); 252 fullscreen_entered.Reply("");
253 253
254 ResultCatcher catcher; 254 ResultCatcher catcher;
255 catcher.RestrictToProfile(browser()->profile()); 255 catcher.RestrictToProfile(browser()->profile());
256 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 256 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
257 } 257 }
258 258
259 // Make sure tabCapture API can be granted for Chrome:// pages.
260 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, GrantForChromePages) {
261 ExtensionTestMessageListener before_open_tab("ready1", true);
262 ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental",
263 "active_tab_chrome_pages.html")) << message_;
264 EXPECT_TRUE(before_open_tab.WaitUntilSatisfied());
265
266 // Open a tab on a chrome:// page and make sure we can capture.
267 content::OpenURLParams params(GURL("chrome://version"), content::Referrer(),
268 NEW_FOREGROUND_TAB,
269 content::PAGE_TRANSITION_LINK, false);
270 content::WebContents* web_contents = browser()->OpenURL(params);
271 ExtensionService* extension_service =
272 Profile::FromBrowserContext(web_contents->GetBrowserContext())
273 ->GetExtensionService();
274 extensions::TabHelper::FromWebContents(web_contents)
275 ->active_tab_permission_granter()->GrantIfRequested(
276 extension_service->GetExtensionById(kExtensionId, false));
277 before_open_tab.Reply("");
278
279 ResultCatcher catcher;
280 catcher.RestrictToProfile(browser()->profile());
281 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
282 }
283
259 } // namespace chrome 284 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698