Index: chrome/test/data/extensions/api_test/get_views/test.js |
diff --git a/chrome/test/data/extensions/api_test/get_views/test.js b/chrome/test/data/extensions/api_test/get_views/test.js |
index 342789c4ab984acd6c285f587915dfa21aad0dcb..daf16da41779f706012b6a0cdf27f9e2d11ef371 100644 |
--- a/chrome/test/data/extensions/api_test/get_views/test.js |
+++ b/chrome/test/data/extensions/api_test/get_views/test.js |
@@ -8,25 +8,22 @@ |
const assertEq = chrome.test.assertEq; |
const assertTrue = chrome.test.assertTrue; |
-// This function is called by the infobar during the test run. |
-function infobarCallback() { |
- // We have now added an infobar so the total count goes up one. |
+// We need to remember the popupWindowId to be able to find it later. |
+var popupWindowId = 0; |
+ |
+// This function is called by the popup during the test run. |
+function popupCallback() { |
+ // We have now added an popup so the total count goes up one. |
assertEq(2, chrome.extension.getViews().length); |
- assertEq(1, chrome.extension.getViews({"type": "infobar"}).length); |
- |
- // Now try the same, but specify the windowId. |
- chrome.windows.getCurrent(function(window) { |
- assertEq(1, chrome.extension.getViews( |
- {"type": "infobar", "windowId": window.id}).length); |
- chrome.tabs.create({"url": chrome.extension.getURL("options.html")}); |
- }); |
+ assertEq(1, chrome.extension.getViews({"windowId": popupWindowId}).length); |
+ |
+ chrome.tabs.create({"url": chrome.extension.getURL("options.html")}); |
} |
function optionsPageCallback() { |
assertEq(3, chrome.extension.getViews().length); |
- assertEq(1, chrome.extension.getViews( |
- {"type": "infobar", "windowId": window.id}).length); |
- assertEq(1, chrome.extension.getViews( |
+ assertEq(1, chrome.extension.getViews({"windowId": popupWindowId}).length); |
+ assertEq(2, chrome.extension.getViews( |
{"type": "tab", "windowId": window.id}).length); |
chrome.test.notifyPass(); |
} |
@@ -36,20 +33,19 @@ var tests = [ |
assertTrue(typeof(chrome.extension.getBackgroundPage()) != "undefined"); |
assertEq(1, chrome.extension.getViews().length); |
assertEq(0, chrome.extension.getViews({"type": "tab"}).length); |
- assertEq(0, chrome.extension.getViews({"type": "infobar"}).length); |
+ assertEq(0, chrome.extension.getViews({"type": "popup"}).length); |
assertEq(0, chrome.extension.getViews({"type": "notification"}).length); |
chrome.windows.getAll({populate: true}, function(windows) { |
assertEq(1, windows.length); |
- // Show an infobar. |
- chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id, |
- "path": "infobar.html"}, |
- function(window) { |
+ // Create a popup window. |
+ chrome.windows.create({"url": chrome.extension.getURL("popup.html"), |
+ "type": "popup"}, function(window) { |
assertTrue(window.id > 0); |
- // The infobar will call back to us through infobarCallback (above). |
+ popupWindowId = window.id; |
+ // The popup will call back to us through popupCallback (above). |
}); |
- |
}); |
} |
]; |