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

Side by Side Diff: chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/panel-subframe.js

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // If panel-subframe is (expectedly) in the same BrowsingInstance as
6 // background-subframe, then window.open should find the existing iframe.
7 //
8 // Otherwise window.open will cause a new tab to be opened and we will
9 // find this out and fail the test when comparing newNumberOfTabs and
10 // oldNumberOfTabs in background.js.
11 //
12 // Note that we can't verify if |w| is a new window by looking
13 // at |w.parent|, because this leads to an error similar to:
14 // Uncaught SecurityError: Blocked a frame with origin "http://foo.com:36559"
15 // from accessing a frame with origin
16 // "chrome-extension://jmanjdlcdjhgbdccaamcmmcilljchoad". The frame
17 // requesting access has a protocol of "http", the frame being accessed has a
18 // protocol of "chrome-extension". Protocols must match.
19 var w = window.open('http://blah', 'background-subframe-name')
20
21 // Quick and very dirty query parameters parsing... ok only for test code.
22 extensionId = window.location.href.substr(
23 window.location.href.lastIndexOf('=') + 1);
24
25 // Let background.js know that it can now calculate newNumberOfTabs.
26 chrome.runtime.sendMessage(extensionId, { windowOpened: true });
27
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698