OLD | NEW |
1 <script src="framework.js"> | 1 <!-- |
2 </script> | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
3 <script> | 3 * source code is governed by a BSD-style license that can be found in the |
4 runTests([ | 4 * LICENSE file. |
5 // Navigates to a page with a link with target=_blank. Then simulates a click | 5 --> |
6 // on that link and verifies that the new tab has a correct tab ID assigned. | 6 <script src="framework.js"></script> |
7 function () { | 7 <script src="test_newTab.js"></script> |
8 expect( | |
9 [ // events | |
10 { label: "a-onBeforeRequest", | |
11 event: "onBeforeRequest", | |
12 details: { | |
13 url: getURL("newTab/a.html"), | |
14 frameUrl: getURL("newTab/a.html") | |
15 } | |
16 }, | |
17 { label: "a-onResponseStarted", | |
18 event: "onResponseStarted", | |
19 details: { | |
20 url: getURL("newTab/a.html"), | |
21 statusCode: 200, | |
22 fromCache: false, | |
23 statusLine: "HTTP/1.1 200 OK", | |
24 // Request to chrome-extension:// url has no IP. | |
25 } | |
26 }, | |
27 { label: "a-onCompleted", | |
28 event: "onCompleted", | |
29 details: { | |
30 url: getURL("newTab/a.html"), | |
31 statusCode: 200, | |
32 fromCache: false, | |
33 statusLine: "HTTP/1.1 200 OK", | |
34 // Request to chrome-extension:// url has no IP. | |
35 } | |
36 }, | |
37 { label: "b-onBeforeRequest", | |
38 event: "onBeforeRequest", | |
39 details: { | |
40 url: getURL("newTab/b.html"), | |
41 frameUrl: getURL("newTab/b.html"), | |
42 tabId: 1, | |
43 } | |
44 }, | |
45 { label: "b-onResponseStarted", | |
46 event: "onResponseStarted", | |
47 details: { | |
48 url: getURL("newTab/b.html"), | |
49 statusCode: 200, | |
50 fromCache: false, | |
51 statusLine: "HTTP/1.1 200 OK", | |
52 // Request to chrome-extension:// url has no IP. | |
53 tabId: 1, | |
54 } | |
55 }, | |
56 { label: "b-onCompleted", | |
57 event: "onCompleted", | |
58 details: { | |
59 url: getURL("newTab/b.html"), | |
60 statusCode: 200, | |
61 fromCache: false, | |
62 statusLine: "HTTP/1.1 200 OK", | |
63 // Request to chrome-extension:// url has no IP. | |
64 tabId: 1, | |
65 } | |
66 }, | |
67 ], | |
68 [ // event order | |
69 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted", | |
70 "b-onBeforeRequest", "b-onResponseStarted", "b-onCompleted"] ]); | |
71 // Notify the api test that we're waiting for the user. | |
72 chrome.test.notifyPass(); | |
73 }, | |
74 ]); | |
75 </script> | |
OLD | NEW |