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

Side by Side Diff: chrome/test/data/extensions/api_test/webnavigation/prerender/test_prerender.js

Issue 1670673003: Refactor the implementation of the webNavigation extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Bug-532666-NavigationHandleAPI
Patch Set: Remove UI thread DCHECKs. Created 4 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 var getURL = chrome.extension.getURL; 6 var getURL = chrome.extension.getURL;
7 var URL_LOAD = 7 var URL_LOAD =
8 "http://127.0.0.1:PORT/prerender/prerender_loader.html"; 8 "http://127.0.0.1:PORT/prerender/prerender_loader.html";
9 var URL_TARGET = 9 var URL_TARGET =
10 "http://127.0.0.1:PORT/prerender/prerender_page.html"; 10 "http://127.0.0.1:PORT/prerender/prerender_page.html";
11 chrome.tabs.create({"url": "about:blank"}, function(tab) { 11 chrome.tabs.create({"url": "about:blank"}, function(tab) {
12 var tabId = tab.id; 12 var tabId = tab.id;
13 chrome.test.getConfig(function(config) { 13 chrome.test.getConfig(function(config) {
14 var fixPort = function(url) { 14 var fixPort = function(url) {
15 return url.replace(/PORT/g, config.testServer.port); 15 return url.replace(/PORT/g, config.testServer.port);
16 }; 16 };
17 URL_LOAD = fixPort(URL_LOAD); 17 URL_LOAD = fixPort(URL_LOAD);
18 URL_TARGET = fixPort(URL_TARGET); 18 URL_TARGET = fixPort(URL_TARGET);
19 19
20 chrome.test.runTests([ 20 chrome.test.runTests([
21 // A prerendered tab replaces the current tab. 21 // A prerendered tab replaces the current tab.
22 function prerendered() { 22 function prerendered() {
23 expect([ 23 expect([
24 { label: "a-onBeforeNavigate", 24 { label: "a-onBeforeNavigate",
25 event: "onBeforeNavigate", 25 event: "onBeforeNavigate",
26 details: { frameId: 0, 26 details: { frameId: 0,
27 parentFrameId: -1, 27 parentFrameId: -1,
28 processId: 0, 28 processId: -1,
29 tabId: 0, 29 tabId: 0,
30 timeStamp: 0, 30 timeStamp: 0,
31 url: URL_LOAD }}, 31 url: URL_LOAD }},
32 { label: "a-onCommitted", 32 { label: "a-onCommitted",
33 event: "onCommitted", 33 event: "onCommitted",
34 details: { frameId: 0, 34 details: { frameId: 0,
35 processId: 0, 35 processId: 0,
36 tabId: 0, 36 tabId: 0,
37 timeStamp: 0, 37 timeStamp: 0,
38 transitionQualifiers: [], 38 transitionQualifiers: [],
(...skipping 10 matching lines...) Expand all
49 event: "onCompleted", 49 event: "onCompleted",
50 details: { frameId: 0, 50 details: { frameId: 0,
51 processId: 0, 51 processId: 0,
52 tabId: 0, 52 tabId: 0,
53 timeStamp: 0, 53 timeStamp: 0,
54 url: URL_LOAD }}, 54 url: URL_LOAD }},
55 { label: "b-onBeforeNavigate", 55 { label: "b-onBeforeNavigate",
56 event: "onBeforeNavigate", 56 event: "onBeforeNavigate",
57 details: { frameId: 0, 57 details: { frameId: 0,
58 parentFrameId: -1, 58 parentFrameId: -1,
59 processId: 1, 59 processId: -1,
60 tabId: 1, 60 tabId: 1,
61 timeStamp: 0, 61 timeStamp: 0,
62 url: URL_TARGET }}, 62 url: URL_TARGET }},
63 { label: "b-onCommitted", 63 { label: "b-onCommitted",
64 event: "onCommitted", 64 event: "onCommitted",
65 details: { frameId: 0, 65 details: { frameId: 0,
66 processId: 1, 66 processId: 1,
67 tabId: 1, 67 tabId: 1,
68 timeStamp: 0, 68 timeStamp: 0,
69 transitionQualifiers: [], 69 transitionQualifiers: [],
(...skipping 22 matching lines...) Expand all
92 navigationOrder("b-"), 92 navigationOrder("b-"),
93 [ "a-onCompleted", "b-onCompleted", "onTabReplaced" ]]); 93 [ "a-onCompleted", "b-onCompleted", "onTabReplaced" ]]);
94 94
95 // Notify the api test that we're waiting for the user. 95 // Notify the api test that we're waiting for the user.
96 chrome.test.notifyPass(); 96 chrome.test.notifyPass();
97 }, 97 },
98 ]); 98 ]);
99 }); 99 });
100 }); 100 });
101 }; 101 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698