OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function getURLHttpXHR() { | 5 function getURLHttpXHR() { |
6 return getServerURL('extensions/api_test/webrequest/xhr/a.html'); | 6 return getServerURL('extensions/api_test/webrequest/xhr/a.html'); |
7 } | 7 } |
8 function getURLHttpXHRJavaScript() { | 8 function getURLHttpXHRJavaScript() { |
9 return getServerURL('extensions/api_test/webrequest/xhr/a.js'); | 9 return getServerURL('extensions/api_test/webrequest/xhr/a.js'); |
10 } | 10 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 }, | 205 }, |
206 ], | 206 ], |
207 [ // event order | 207 [ // event order |
208 ["a-onBeforeRequest", "a-onResponseStarted", | 208 ["a-onBeforeRequest", "a-onResponseStarted", |
209 "b-onBeforeRequest", "b-onResponseStarted"], | 209 "b-onBeforeRequest", "b-onResponseStarted"], |
210 ["a-onResponseStarted", "a-onCompleted"], | 210 ["a-onResponseStarted", "a-onCompleted"], |
211 ["b-onResponseStarted", "b-onCompleted"] ], | 211 ["b-onResponseStarted", "b-onCompleted"] ], |
212 { // filters | 212 { // filters |
213 urls: [getURL("complexLoad/*")], | 213 urls: [getURL("complexLoad/*")], |
214 types: ["main_frame", "image"], | 214 types: ["main_frame", "image"], |
215 tabId: tabId | 215 extraRequestParams: { |
| 216 tabId: tabId, |
| 217 } |
216 }); | 218 }); |
217 chrome.tabs.create({ url: getURL("simpleLoad/a.html") }, | 219 chrome.tabs.create({ url: getURL("simpleLoad/a.html") }, |
218 function(newTab) { | 220 function(newTab) { |
219 chrome.tabs.remove(newTab.id); | 221 chrome.tabs.remove(newTab.id); |
220 navigateAndWait(getURL("complexLoad/a.html")); | 222 navigateAndWait(getURL("complexLoad/a.html")); |
221 }); | 223 }); |
222 }, | 224 }, |
223 | 225 |
224 // Navigates to a page to generates an XHR. | 226 // Navigates to a page to generates an XHR. |
225 function xhrLoad() { | 227 function xhrLoad() { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 385 } |
384 ], | 386 ], |
385 [ // event order | 387 [ // event order |
386 ["onBeforeRequest-1", "onBeforeSendHeaders-1", "onSendHeaders-1", | 388 ["onBeforeRequest-1", "onBeforeSendHeaders-1", "onSendHeaders-1", |
387 "onHeadersReceived-1", "onResponseStarted-1", "onCompleted-1", | 389 "onHeadersReceived-1", "onResponseStarted-1", "onCompleted-1", |
388 "onBeforeRequest-2", "onBeforeSendHeaders-2", "onSendHeaders-2", | 390 "onBeforeRequest-2", "onBeforeSendHeaders-2", "onSendHeaders-2", |
389 "onHeadersReceived-2", "onResponseStarted-2", "onCompleted-2"] ]); | 391 "onHeadersReceived-2", "onResponseStarted-2", "onCompleted-2"] ]); |
390 navigateAndWait(getURLHttpXHR()); | 392 navigateAndWait(getURLHttpXHR()); |
391 }, | 393 }, |
392 ]); | 394 ]); |
OLD | NEW |