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
;
7 chrome
.tabs
.create({"url": "about:blank"}, function(tab
) {
10 chrome
.test
.runTests([
11 // Opens a tab and waits for the user to middle-click on a link in it.
12 function requestOpenTab() {
14 { label
: "a-onBeforeNavigate",
15 event
: "onBeforeNavigate",
16 details
: { frameId
: 0,
21 url
: getURL('a.html') }},
22 { label
: "a-onCommitted",
24 details
: { frameId
: 0,
28 transitionQualifiers
: [],
29 transitionType
: "typed",
30 url
: getURL('a.html') }},
31 { label
: "a-onDOMContentLoaded",
32 event
: "onDOMContentLoaded",
33 details
: { frameId
: 0,
37 url
: getURL('a.html') }},
38 { label
: "a-onCompleted",
40 details
: { frameId
: 0,
44 url
: getURL('a.html') }},
45 { label
: "b-onCreatedNavigationTarget",
46 event
: "onCreatedNavigationTarget",
47 details
: { sourceFrameId
: 0,
52 url
: getURL('b.html') }},
53 { label
: "b-onBeforeNavigate",
54 event
: "onBeforeNavigate",
55 details
: { frameId
: 0,
60 url
: getURL('b.html') }},
61 { label
: "b-onCommitted",
63 details
: { frameId
: 0,
67 transitionQualifiers
: [],
68 transitionType
: "link",
69 url
: getURL('b.html') }},
70 { label
: "b-onDOMContentLoaded",
71 event
: "onDOMContentLoaded",
72 details
: { frameId
: 0,
76 url
: getURL('b.html') }},
77 { label
: "b-onCompleted",
79 details
: { frameId
: 0,
83 url
: getURL('b.html') }}],
84 [ navigationOrder("a-"),
85 navigationOrder("b-"),
86 [ "a-onDOMContentLoaded",
87 "b-onCreatedNavigationTarget",
88 "b-onBeforeNavigate" ]]);
90 // Notify the api test that we're waiting for the user.
91 chrome
.test
.notifyPass();