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
3 // found in the LICENSE file.
6 var getURL
= chrome
.extension
.getURL
;
8 "http://127.0.0.1:PORT/files/prerender/prerender_loader.html";
10 "http://127.0.0.1:PORT/files/prerender/prerender_page.html";
11 chrome
.tabs
.create({"url": "about:blank"}, function(tab
) {
13 chrome
.test
.getConfig(function(config
) {
14 var fixPort = function(url
) {
15 return url
.replace(/PORT/g, config
.spawnedTestServer
.port
);
17 URL_LOAD
= fixPort(URL_LOAD
);
18 URL_TARGET
= fixPort(URL_TARGET
);
20 chrome
.test
.runTests([
21 // A prerendered tab replaces the current tab.
22 function prerendered() {
24 { label
: "a-onBeforeNavigate",
25 event
: "onBeforeNavigate",
26 details
: { frameId
: 0,
32 { label
: "a-onCommitted",
34 details
: { frameId
: 0,
38 transitionQualifiers
: [],
39 transitionType
: "typed",
41 { label
: "a-onDOMContentLoaded",
42 event
: "onDOMContentLoaded",
43 details
: { frameId
: 0,
48 { label
: "a-onCompleted",
50 details
: { frameId
: 0,
55 { label
: "b-onBeforeNavigate",
56 event
: "onBeforeNavigate",
57 details
: { frameId
: 0,
63 { label
: "b-onCommitted",
65 details
: { frameId
: 0,
69 transitionQualifiers
: [],
70 transitionType
: "link",
72 { label
: "b-onDOMContentLoaded",
73 event
: "onDOMContentLoaded",
74 details
: { frameId
: 0,
79 { label
: "b-onCompleted",
81 details
: { frameId
: 0,
86 { label
: "onTabReplaced",
87 event
: "onTabReplaced",
88 details
: { replacedTabId
: 0,
91 [ navigationOrder("a-"),
92 navigationOrder("b-"),
93 [ "a-onCompleted", "b-onCompleted", "onTabReplaced" ]]);
95 // Notify the api test that we're waiting for the user.
96 chrome
.test
.notifyPass();