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

Side by Side Diff: chrome/test/data/extensions/api_test/app_background_page/basic_close/test.js

Issue 10298002: No longer start BG mode until a BackgroundContents is loaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prospective fix for cros test failures. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This test closes the existing background page opened by a.html.
6
7 var pagePrefix =
8 'http://a.com:PORT/files/extensions/api_test/app_background_page/common';
9
10 // Dispatch "tunneled" functions from the live web pages to this testing page.
11 chrome.extension.onRequest.addListener(function(request) {
12 window[request.name](request.args);
13 });
14
15 // At no point should a window be created that contains the background page
16 // (bg.html).
17 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
18 if (tab.url.match("bg\.html$")) {
19 chrome.test.notifyFail("popup opened instead of background page");
20 }
21 });
22
23 // Start the test by opening the first page in the app.
24 window.onload = function() {
25 // We wait for window.onload before getting the test config. If the
26 // config is requested before onload, then sometimes onload has already
27 // fired by the time chrome.test.getConfig()'s callback runs.
28 chrome.test.getConfig(function(config) {
29 var closeUrl =
30 pagePrefix.replace(/PORT/, config.testServer.port) + '/close.html';
31 chrome.tabs.create({ 'url': closeUrl }, function(tab) {});
32 });
33 };
34
35 // Background page is closed now.
36 function onBackgroundPageClosed() {
37 chrome.test.notifyPass();
38 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698