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

Unified Diff: chrome/test/data/extensions/api_test/get_views/test.js

Issue 9420036: Also delay regular profile destruction... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge Goof fix... Created 8 years, 7 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/test/data/extensions/api_test/get_views/popup.js ('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/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).
});
-
});
}
];
« no previous file with comments | « chrome/test/data/extensions/api_test/get_views/popup.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698