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

Unified Diff: chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js

Issue 1843943003: Extension-created windows should share the creator's BrowingInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 9 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
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index f32f4f86132234d643191c68194b7ee9f184c4eb..aacc56c6ee9adb07bed36842d252f08120ef8ccb 100644
--- 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
@@ -7,6 +7,7 @@
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) ...');
@@ -23,6 +24,8 @@ chrome.test.runTests([
// 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/';
@@ -47,7 +50,7 @@ chrome.runtime.onMessageExternal.addListener(
chrome.windows.create(
{ 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' },
function(win) {
- chrome.test.assertEq('panel', win.type);
+ chrome.test.assertEq(expectedWindowType, win.type);
});
// panel.js will navigate panel-subframe and then panel-subframe.js will
@@ -60,7 +63,17 @@ chrome.runtime.onMessageExternal.addListener(
var newNumberOfTabs = tabs.length;
chrome.test.log('newNumberOfTabs = ' + newNumberOfTabs);
- chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs);
+ 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();
});
}
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698