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

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/on_replaced/test_onreplaced.js

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 onload = function() { 5 onload = function() {
6 chrome.test.getConfig(function(config) { 6 chrome.test.getConfig(function(config) {
7 chrome.tabs.create({"url": "about:blank"}, function(tab) { 7 chrome.tabs.create({"url": "about:blank"}, function(tab) {
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function onReplacedEvent() { 9 function onReplacedEvent() {
10 var tabId = tab.id; 10 var tabId = tab.id;
11 11
12 var onReplaceListener = function(new_tab_id, old_tab_id) { 12 var onReplaceListener = function(new_tab_id, old_tab_id) {
13 chrome.test.assertTrue(tabId != new_tab_id); 13 chrome.test.assertTrue(tabId != new_tab_id);
14 chrome.test.assertEq(tabId, old_tab_id); 14 chrome.test.assertEq(tabId, old_tab_id);
15 chrome.tabs.onReplaced.removeListener(onReplaceListener); 15 chrome.tabs.onReplaced.removeListener(onReplaceListener);
16 chrome.test.succeed(); 16 chrome.test.succeed();
17 }; 17 };
18 chrome.tabs.onReplaced.addListener(onReplaceListener); 18 chrome.tabs.onReplaced.addListener(onReplaceListener);
19 19
20 var URL_TARGET = 20 var URL_TARGET =
21 "http://127.0.0.1:PORT/files/prerender/prerender_page.html" 21 "http://127.0.0.1:PORT/prerender/prerender_page.html"
22 .replace(/PORT/g, config.testServer.port); 22 .replace(/PORT/g, config.testServer.port);
23 chrome.tabs.update({ 23 chrome.tabs.update({
24 url: URL_TARGET 24 url: URL_TARGET
25 }); 25 });
26 26
27 chrome.test.notifyPass(); 27 chrome.test.notifyPass();
28 } 28 }
29 ]); 29 ]);
30 }); 30 });
31 }); 31 });
32 }; 32 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698