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.
7 "http://www.a.com:PORT/extensions/api_test/webnavigation/serverRedirect/a.html";
8 var URL_LOAD_REDIRECT = "http://www.a.com:PORT/server-redirect";
9 chrome.tabs.create({"url": "about:blank"}, function(tab) {
11 chrome.test.getConfig(function(config) {
12 var fixPort = function(url) {
13 return url.replace(/PORT/g, config.testServer.port);
15 URL_LOAD_REDIRECT = fixPort(URL_LOAD_REDIRECT);
16 URL_LOAD = fixPort(URL_LOAD);
17 chrome.test.runTests([
18 // Navigates to a page that redirects (on the server side) to a.html.
19 function serverRedirect() {
21 { label: "a-onBeforeNavigate",
22 event: "onBeforeNavigate",
23 details: { frameId: 0,
28 url: URL_LOAD_REDIRECT }},
29 { label: "a-onCommitted",
31 details: { frameId: 0,
35 transitionQualifiers: ["server_redirect"],
36 transitionType: "link",
38 { label: "a-onDOMContentLoaded",
39 event: "onDOMContentLoaded",
40 details: { frameId: 0,
45 { label: "a-onCompleted",
47 details: { frameId: 0,
52 [ navigationOrder("a-") ]);
53 chrome.tabs.update(tabId,
54 { url: URL_LOAD_REDIRECT + "?" + URL_LOAD });