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

Side by Side Diff: chrome/test/data/extensions/api_test/window_open/spanning/background.js

Issue 20081002: Remove experimental permission from infobars API and moving it to dev channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added license header Created 7 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 var nextTest = null; 5 var nextTest = null;
6 openFromNormalShouldOpenInNormal(); 6 openFromNormalShouldOpenInNormal();
7 7
8 function openFromNormalShouldOpenInNormal() { 8 function openFromNormalShouldOpenInNormal() {
9 nextTest = openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser; 9 nextTest = openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser;
10 chrome.windows.getAll({populate: true}, function(windows) { 10 chrome.windows.getAll({populate: true}, function(windows) {
11 chrome.test.assertEq(1, windows.length); 11 chrome.test.assertEq(1, windows.length);
12 chrome.test.assertFalse(windows[0].incognito); 12 chrome.test.assertFalse(windows[0].incognito);
13 chrome.test.assertEq(1, windows[0].tabs.length); 13 chrome.test.assertEq(1, windows[0].tabs.length);
14 chrome.test.assertFalse(windows[0].tabs[0].incognito); 14 chrome.test.assertFalse(windows[0].tabs[0].incognito);
15 15
16 // The rest of the test continues in infobar.html. 16 // The rest of the test continues in infobar.html.
17 chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id, 17 chrome.infobars.show({tabId: windows[0].tabs[0].id, path: "infobar.html"});
18 path: "infobar.html"});
19 }); 18 });
20 } 19 }
21 20
22 function openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser() { 21 function openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser() {
23 nextTest = null; 22 nextTest = null;
24 chrome.windows.getCurrent(function(normalWin) { 23 chrome.windows.getCurrent(function(normalWin) {
25 chrome.test.assertFalse(normalWin.incognito); 24 chrome.test.assertFalse(normalWin.incognito);
26 // Create an incognito window. 25 // Create an incognito window.
27 chrome.windows.create({ incognito: true }, function(incognitoWin) { 26 chrome.windows.create({ incognito: true }, function(incognitoWin) {
28 // Remove the normal window. We keep running because of the incognito 27 // Remove the normal window. We keep running because of the incognito
29 // window. 28 // window.
30 chrome.windows.remove(normalWin.id, function() { 29 chrome.windows.remove(normalWin.id, function() {
31 chrome.tabs.getAllInWindow(incognitoWin.id, function(tabs) { 30 chrome.tabs.getAllInWindow(incognitoWin.id, function(tabs) {
32 chrome.test.assertEq(1, tabs.length); 31 chrome.test.assertEq(1, tabs.length);
33 // The rest of the test continues in infobar.html. 32 // The rest of the test continues in infobar.html.
34 chrome.experimental.infobars.show({tabId: tabs[0].id, 33 chrome.infobars.show({tabId: tabs[0].id, path: "infobar.html"});
35 path: "infobar.html"});
36 }); 34 });
37 }); 35 });
38 }); 36 });
39 }); 37 });
40 } 38 }
41 39
42 function verifyCreatedTab(tab) { 40 function verifyCreatedTab(tab) {
43 // The new tab should be a normal tab, and it should be in a normal 41 // The new tab should be a normal tab, and it should be in a normal
44 // window. 42 // window.
45 chrome.test.assertFalse(tab.incognito); 43 chrome.test.assertFalse(tab.incognito);
46 chrome.windows.get(tab.windowId, function(win) { 44 chrome.windows.get(tab.windowId, function(win) {
47 chrome.test.assertFalse(win.incognito); 45 chrome.test.assertFalse(win.incognito);
48 if (nextTest) { 46 if (nextTest) {
49 nextTest(); 47 nextTest();
50 } else { 48 } else {
51 chrome.test.notifyPass(); 49 chrome.test.notifyPass();
52 } 50 }
53 }); 51 });
54 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698