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

Unified Diff: chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js
diff --git a/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js b/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js
deleted file mode 100644
index aacc56c6ee9adb07bed36842d252f08120ef8ccb..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// To see chrome.test.log messages execute the test like this:
-// $ out/gn/browser_tests --gtest_filter=*PanelTest* --vmodule=test_api=1
-chrome.test.log('executing background.js ...');
-
-var oldNumberOfTabs;
-var expectedWindowType;
-chrome.test.runTests([
- function testPanelBrowsingInstance() {
- chrome.test.log('counting all the tabs (before window.open) ...');
- chrome.tabs.query({}, function(tabs) {
- oldNumberOfTabs = tabs.length;
- chrome.test.log('oldNumberOfTabs = ' + oldNumberOfTabs);
-
- // Note that the background-subframe has to be navigated to foo.com,
- // because otherwise we would get the following error when calling
- // window.open from panel-subframe.js:
- // Unsafe JavaScript attempt to initiate navigation for frame with URL
- // 'about:blank' from frame with URL
- // 'http://foo.com:41191/extensions/.../panel-subframe.html'. The frame
- // attempting navigation is neither same-origin with the target, nor is
- // it the target's parent or opener.
- chrome.test.getConfig(function(config) {
- expectedWindowType = config.customArg;
-
- var baseUri = 'http://foo.com:' + config.testServer.port +
- '/extensions/api_test/window_open/panel_browsing_instance/';
-
- chrome.test.log('navigating background-subframe ...');
- var subframe = document.getElementById('background-subframe-id');
- subframe.src = baseUri +
- 'background-subframe.html?extensionId=' + chrome.runtime.id;
-
- // background-subframe.js will send a message back to us -
- // backgroundSubframeNavigated - we will continue execution
- // in the callback below.
- });
- });
- }
-]);
-
-chrome.runtime.onMessageExternal.addListener(
- function(request, sender, sendResponse) {
- if (request.backgroundSubframeNavigated) {
- chrome.test.log('got callback from background-subframe.js ...');
- chrome.test.log('creating the panel window ...');
- chrome.windows.create(
- { 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' },
- function(win) {
- chrome.test.assertEq(expectedWindowType, win.type);
- });
-
- // panel.js will navigate panel-subframe and then panel-subframe.js will
- // call window.open and send a message back to us (windowOpened) - we will
- // continue execution below.
- } else if (request.windowOpened) {
- chrome.test.log('got callback from panel-subframe.js ...');
- chrome.test.log('counting all the tabs (after window.open) ...');
- chrome.tabs.query({}, function(tabs) {
- var newNumberOfTabs = tabs.length;
- chrome.test.log('newNumberOfTabs = ' + newNumberOfTabs);
-
- switch (expectedWindowType) {
- case 'panel':
- chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs);
- break;
- case 'popup':
- chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs + 1);
- break;
- default:
- // Unexpected expected window type.
- chrome.test.fail();
- }
- chrome.test.notifyPass();
- });
- }
- });
-
-

Powered by Google App Engine
This is Rietveld 408576698