Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Side by Side Diff: chrome/test/data/extensions/api_test/webrequest/test_simple.js

Issue 980543002: Adding statusCode for webRequest onHeadersReceived and onAuthRequired callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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('extensions/api_test/webrequest/simpleLoad/a.html'); 7 return getServerURL('extensions/api_test/webrequest/simpleLoad/a.html');
8 } 8 }
9 9
10 function getURLHttpSimpleLoadRedirect() { 10 function getURLHttpSimpleLoadRedirect() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 details: { 73 details: {
74 url: getURLHttpSimpleLoadRedirect(), 74 url: getURLHttpSimpleLoadRedirect(),
75 requestHeadersValid: true 75 requestHeadersValid: true
76 } 76 }
77 }, 77 },
78 { label: "onHeadersReceived-1", 78 { label: "onHeadersReceived-1",
79 event: "onHeadersReceived", 79 event: "onHeadersReceived",
80 details: { 80 details: {
81 url: getURLHttpSimpleLoadRedirect(), 81 url: getURLHttpSimpleLoadRedirect(),
82 responseHeadersExist: true, 82 responseHeadersExist: true,
83 statusLine: "HTTP/1.1 301 Moved Permanently" 83 statusLine: "HTTP/1.1 301 Moved Permanently",
84 statusCode: 301
84 } 85 }
85 }, 86 },
86 { label: "onBeforeRedirect", 87 { label: "onBeforeRedirect",
87 event: "onBeforeRedirect", 88 event: "onBeforeRedirect",
88 details: { 89 details: {
89 url: getURLHttpSimpleLoadRedirect(), 90 url: getURLHttpSimpleLoadRedirect(),
90 redirectUrl: getURLHttpSimpleLoad(), 91 redirectUrl: getURLHttpSimpleLoad(),
91 statusCode: 301, 92 statusCode: 301,
92 responseHeadersExist: true, 93 responseHeadersExist: true,
93 ip: "127.0.0.1", 94 ip: "127.0.0.1",
(...skipping 21 matching lines...) Expand all
115 url: getURLHttpSimpleLoad(), 116 url: getURLHttpSimpleLoad(),
116 requestHeadersValid: true 117 requestHeadersValid: true
117 } 118 }
118 }, 119 },
119 { label: "onHeadersReceived-2", 120 { label: "onHeadersReceived-2",
120 event: "onHeadersReceived", 121 event: "onHeadersReceived",
121 details: { 122 details: {
122 url: getURLHttpSimpleLoad(), 123 url: getURLHttpSimpleLoad(),
123 responseHeadersExist: true, 124 responseHeadersExist: true,
124 statusLine: "HTTP/1.1 200 OK", 125 statusLine: "HTTP/1.1 200 OK",
126 statusCode: 200
125 } 127 }
126 }, 128 },
127 { label: "onResponseStarted", 129 { label: "onResponseStarted",
128 event: "onResponseStarted", 130 event: "onResponseStarted",
129 details: { 131 details: {
130 url: getURLHttpSimpleLoad(), 132 url: getURLHttpSimpleLoad(),
131 statusCode: 200, 133 statusCode: 200,
132 responseHeadersExist: true, 134 responseHeadersExist: true,
133 ip: "127.0.0.1", 135 ip: "127.0.0.1",
134 fromCache: false, 136 fromCache: false,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 error: "net::ERR_FILE_NOT_FOUND", 178 error: "net::ERR_FILE_NOT_FOUND",
177 // Request to chrome-extension:// url has no IP. 179 // Request to chrome-extension:// url has no IP.
178 } 180 }
179 }, 181 },
180 ], 182 ],
181 [ // event order 183 [ // event order
182 ["onBeforeRequest", "onErrorOccurred"] ]); 184 ["onBeforeRequest", "onErrorOccurred"] ]);
183 navigateAndWait(getURL("does_not_exist.html")); 185 navigateAndWait(getURL("does_not_exist.html"));
184 }, 186 },
185 ]); 187 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698