Elim cr-checkbox
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / webrequest / test_newTab.js
blobab46ce12ecea2c6f2836f367d5f5c53faaa0b54f
1 // Copyright (c) 2011 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.
5 runTests([
6 // Navigates to a page with a link with target=_blank. Then simulates a click
7 // on that link and verifies that the new tab has a correct tab ID assigned.
8 function () {
9 expect(
10 [ // events
11 { label: "a-onBeforeRequest",
12 event: "onBeforeRequest",
13 details: {
14 url: getURL("newTab/a.html"),
15 frameUrl: getURL("newTab/a.html")
18 { label: "a-onResponseStarted",
19 event: "onResponseStarted",
20 details: {
21 url: getURL("newTab/a.html"),
22 statusCode: 200,
23 fromCache: false,
24 statusLine: "HTTP/1.1 200 OK",
25 // Request to chrome-extension:// url has no IP.
28 { label: "a-onCompleted",
29 event: "onCompleted",
30 details: {
31 url: getURL("newTab/a.html"),
32 statusCode: 200,
33 fromCache: false,
34 statusLine: "HTTP/1.1 200 OK",
35 // Request to chrome-extension:// url has no IP.
38 { label: "b-onBeforeRequest",
39 event: "onBeforeRequest",
40 details: {
41 url: getURL("newTab/b.html"),
42 frameUrl: getURL("newTab/b.html"),
43 tabId: 1,
46 { label: "b-onResponseStarted",
47 event: "onResponseStarted",
48 details: {
49 url: getURL("newTab/b.html"),
50 statusCode: 200,
51 fromCache: false,
52 statusLine: "HTTP/1.1 200 OK",
53 // Request to chrome-extension:// url has no IP.
54 tabId: 1,
57 { label: "b-onCompleted",
58 event: "onCompleted",
59 details: {
60 url: getURL("newTab/b.html"),
61 statusCode: 200,
62 fromCache: false,
63 statusLine: "HTTP/1.1 200 OK",
64 // Request to chrome-extension:// url has no IP.
65 tabId: 1,
69 [ // event order
70 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted",
71 "b-onBeforeRequest", "b-onResponseStarted", "b-onCompleted"] ]);
72 // Notify the api test that we're waiting for the user.
73 chrome.test.notifyPass();
75 ]);