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.
7 "http://127.0.0.1:PORT/extensions/api_test/webnavigation/targetBlank/a.html";
9 "http://127.0.0.1:PORT/extensions/api_test/webnavigation/targetBlank/b.html";
10 chrome
.tabs
.create({"url": "about:blank"}, function(tab
) {
12 chrome
.test
.getConfig(function(config
) {
13 var fixPort = function(url
) {
14 return url
.replace(/PORT/g, config
.testServer
.port
);
16 URL_LOAD
= fixPort(URL_LOAD
);
17 URL_TARGET
= fixPort(URL_TARGET
);
19 chrome
.test
.runTests([
20 // Opens a tab and waits for the user to click on a link with
21 // target=_blank in it.
22 function targetBlank() {
24 { label
: "a-onBeforeNavigate",
25 event
: "onBeforeNavigate",
26 details
: { frameId
: 0,
32 { label
: "a-onCommitted",
34 details
: { frameId
: 0,
38 transitionQualifiers
: [],
39 transitionType
: "link",
41 { label
: "a-onDOMContentLoaded",
42 event
: "onDOMContentLoaded",
43 details
: { frameId
: 0,
48 { label
: "a-onCompleted",
50 details
: { frameId
: 0,
55 { label
: "b-onCreatedNavigationTarget",
56 event
: "onCreatedNavigationTarget",
57 details
: { sourceFrameId
: 0,
63 { label
: "b-onBeforeNavigate",
64 event
: "onBeforeNavigate",
65 details
: { frameId
: 0,
71 { label
: "b-onCommitted",
73 details
: { frameId
: 0,
77 transitionQualifiers
: [],
78 transitionType
: "link",
80 { label
: "b-onDOMContentLoaded",
81 event
: "onDOMContentLoaded",
82 details
: { frameId
: 0,
87 { label
: "b-onCompleted",
89 details
: { frameId
: 0,
94 [ navigationOrder("a-"),
95 navigationOrder("b-"),
96 [ "a-onDOMContentLoaded",
97 "b-onCreatedNavigationTarget",
98 "b-onBeforeNavigate" ]]);
100 // Notify the api test that we're waiting for the user.
101 chrome
.test
.notifyPass();