| 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 // Constants as functions, not to be called until after runTests. | 5 // Constants as functions, not to be called until after runTests. |
| 6 function getURLHttpSimpleLoad() { | 6 function getURLHttpSimpleLoad() { |
| 7 return getServerURL('files/extensions/api_test/webrequest/simpleLoad/a.html'); | 7 return getServerURL('files/extensions/api_test/webrequest/simpleLoad/a.html'); |
| 8 } | 8 } |
| 9 | 9 |
| 10 function getURLHttpSimpleLoadRedirect() { | 10 function getURLHttpSimpleLoadRedirect() { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 responseHeadersExist: true, | 151 responseHeadersExist: true, |
| 152 statusLine: "HTTP/1.0 200 OK" | 152 statusLine: "HTTP/1.0 200 OK" |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 ], | 155 ], |
| 156 [ // event order | 156 [ // event order |
| 157 ["onBeforeRequest-1", "onBeforeSendHeaders-1", "onSendHeaders-1", | 157 ["onBeforeRequest-1", "onBeforeSendHeaders-1", "onSendHeaders-1", |
| 158 "onHeadersReceived-1", "onBeforeRedirect", | 158 "onHeadersReceived-1", "onBeforeRedirect", |
| 159 "onBeforeRequest-2", "onBeforeSendHeaders-2", "onSendHeaders-2", | 159 "onBeforeRequest-2", "onBeforeSendHeaders-2", "onSendHeaders-2", |
| 160 "onHeadersReceived-2", "onResponseStarted", "onCompleted"] ], | 160 "onHeadersReceived-2", "onResponseStarted", "onCompleted"] ], |
| 161 {}, // filter | 161 {urls: ["<all_urls>"]}, // filter |
| 162 ["requestHeaders", "responseHeaders"]); | 162 ["requestHeaders", "responseHeaders"]); |
| 163 navigateAndWait(getURLHttpSimpleLoadRedirect()); | 163 navigateAndWait(getURLHttpSimpleLoadRedirect()); |
| 164 }, | 164 }, |
| 165 | 165 |
| 166 // Navigates to a non-existing page. | 166 // Navigates to a non-existing page. |
| 167 function nonExistingLoad() { | 167 function nonExistingLoad() { |
| 168 expect( | 168 expect( |
| 169 [ // events | 169 [ // events |
| 170 { label: "onBeforeRequest", | 170 { label: "onBeforeRequest", |
| 171 event: "onBeforeRequest", | 171 event: "onBeforeRequest", |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 222 } |
| 223 }, | 223 }, |
| 224 ], | 224 ], |
| 225 [ // event order | 225 [ // event order |
| 226 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted"] ]); | 226 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted"] ]); |
| 227 navigateAndWait(getURLNotVisible(), function() { | 227 navigateAndWait(getURLNotVisible(), function() { |
| 228 navigateAndWait(getURL("simpleLoad/a.html")); | 228 navigateAndWait(getURL("simpleLoad/a.html")); |
| 229 }); | 229 }); |
| 230 }, | 230 }, |
| 231 ]); | 231 ]); |
| OLD | NEW |