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

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

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 | Annotate | Revision Log
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 // Generates a unique authentication URL so each test can run 5 // Generates a unique authentication URL so each test can run
6 // without hitting the HTTP authentication cache. Each test 6 // without hitting the HTTP authentication cache. Each test
7 // must use a unique realm, however. 7 // must use a unique realm, however.
8 function getURLAuthRequired(realm) { 8 function getURLAuthRequired(realm) {
9 return getServerURL('auth-basic/' + realm + '/subpath?realm=' + realm); 9 return getServerURL('auth-basic/' + realm + '/subpath?realm=' + realm);
10 } 10 }
(...skipping 23 matching lines...) Expand all
34 event: "onSendHeaders", 34 event: "onSendHeaders",
35 details: { 35 details: {
36 url: url, 36 url: url,
37 } 37 }
38 }, 38 },
39 { label: "onHeadersReceived", 39 { label: "onHeadersReceived",
40 event: "onHeadersReceived", 40 event: "onHeadersReceived",
41 details: { 41 details: {
42 url: url, 42 url: url,
43 responseHeadersExist: true, 43 responseHeadersExist: true,
44 statusLine: "HTTP/1.0 401 Unauthorized" 44 statusLine: "HTTP/1.1 401 Unauthorized"
45 } 45 }
46 }, 46 },
47 { label: "onAuthRequired", 47 { label: "onAuthRequired",
48 event: "onAuthRequired", 48 event: "onAuthRequired",
49 details: { 49 details: {
50 url: url, 50 url: url,
51 isProxy: false, 51 isProxy: false,
52 scheme: "basic", 52 scheme: "basic",
53 realm: realm, 53 realm: realm,
54 challenger: {host: testServer, port: testServerPort}, 54 challenger: {host: testServer, port: testServerPort},
55 responseHeadersExist: true, 55 responseHeadersExist: true,
56 statusLine: "HTTP/1.0 401 Unauthorized", 56 statusLine: "HTTP/1.1 401 Unauthorized",
57 } 57 }
58 }, 58 },
59 { label: "onResponseStarted", 59 { label: "onResponseStarted",
60 event: "onResponseStarted", 60 event: "onResponseStarted",
61 details: { 61 details: {
62 url: url, 62 url: url,
63 fromCache: false, 63 fromCache: false,
64 statusCode: 401, 64 statusCode: 401,
65 ip: "127.0.0.1", 65 ip: "127.0.0.1",
66 responseHeadersExist: true, 66 responseHeadersExist: true,
67 statusLine: "HTTP/1.0 401 Unauthorized", 67 statusLine: "HTTP/1.1 401 Unauthorized",
68 } 68 }
69 }, 69 },
70 { label: "onCompleted", 70 { label: "onCompleted",
71 event: "onCompleted", 71 event: "onCompleted",
72 details: { 72 details: {
73 url: url, 73 url: url,
74 fromCache: false, 74 fromCache: false,
75 statusCode: 401, 75 statusCode: 401,
76 ip: "127.0.0.1", 76 ip: "127.0.0.1",
77 responseHeadersExist: true, 77 responseHeadersExist: true,
78 statusLine: "HTTP/1.0 401 Unauthorized", 78 statusLine: "HTTP/1.1 401 Unauthorized",
79 } 79 }
80 }, 80 },
81 ], 81 ],
82 [ // event order 82 [ // event order
83 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 83 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
84 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 84 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
85 "onCompleted"] 85 "onCompleted"]
86 ], 86 ],
87 {urls: ["<all_urls>"]}, ["responseHeaders"]); 87 {urls: ["<all_urls>"]}, ["responseHeaders"]);
88 navigateAndWait(url); 88 navigateAndWait(url);
(...skipping 23 matching lines...) Expand all
112 event: "onSendHeaders", 112 event: "onSendHeaders",
113 details: { 113 details: {
114 url: url, 114 url: url,
115 } 115 }
116 }, 116 },
117 { label: "onHeadersReceived", 117 { label: "onHeadersReceived",
118 event: "onHeadersReceived", 118 event: "onHeadersReceived",
119 details: { 119 details: {
120 url: url, 120 url: url,
121 responseHeadersExist: true, 121 responseHeadersExist: true,
122 statusLine: "HTTP/1.0 401 Unauthorized" 122 statusLine: "HTTP/1.1 401 Unauthorized"
123 } 123 }
124 }, 124 },
125 { label: "onAuthRequired", 125 { label: "onAuthRequired",
126 event: "onAuthRequired", 126 event: "onAuthRequired",
127 details: { 127 details: {
128 url: url, 128 url: url,
129 isProxy: false, 129 isProxy: false,
130 scheme: "basic", 130 scheme: "basic",
131 realm: realm, 131 realm: realm,
132 challenger: {host: testServer, port: testServerPort}, 132 challenger: {host: testServer, port: testServerPort},
133 responseHeadersExist: true, 133 responseHeadersExist: true,
134 statusLine: "HTTP/1.0 401 Unauthorized", 134 statusLine: "HTTP/1.1 401 Unauthorized",
135 } 135 }
136 }, 136 },
137 { label: "onResponseStarted", 137 { label: "onResponseStarted",
138 event: "onResponseStarted", 138 event: "onResponseStarted",
139 details: { 139 details: {
140 url: url, 140 url: url,
141 fromCache: false, 141 fromCache: false,
142 statusCode: 401, 142 statusCode: 401,
143 ip: "127.0.0.1", 143 ip: "127.0.0.1",
144 responseHeadersExist: true, 144 responseHeadersExist: true,
145 statusLine: "HTTP/1.0 401 Unauthorized", 145 statusLine: "HTTP/1.1 401 Unauthorized",
146 } 146 }
147 }, 147 },
148 { label: "onCompleted", 148 { label: "onCompleted",
149 event: "onCompleted", 149 event: "onCompleted",
150 details: { 150 details: {
151 url: url, 151 url: url,
152 fromCache: false, 152 fromCache: false,
153 statusCode: 401, 153 statusCode: 401,
154 ip: "127.0.0.1", 154 ip: "127.0.0.1",
155 responseHeadersExist: true, 155 responseHeadersExist: true,
156 statusLine: "HTTP/1.0 401 Unauthorized", 156 statusLine: "HTTP/1.1 401 Unauthorized",
157 } 157 }
158 }, 158 },
159 ], 159 ],
160 [ // event order 160 [ // event order
161 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 161 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
162 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 162 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
163 "onCompleted"] 163 "onCompleted"]
164 ], 164 ],
165 {urls: ["<all_urls>"]}, ["blocking", "responseHeaders"]); 165 {urls: ["<all_urls>"]}, ["blocking", "responseHeaders"]);
166 navigateAndWait(url); 166 navigateAndWait(url);
(...skipping 25 matching lines...) Expand all
192 event: "onSendHeaders", 192 event: "onSendHeaders",
193 details: { 193 details: {
194 url: url, 194 url: url,
195 } 195 }
196 }, 196 },
197 { label: "onHeadersReceived", 197 { label: "onHeadersReceived",
198 event: "onHeadersReceived", 198 event: "onHeadersReceived",
199 details: { 199 details: {
200 url: url, 200 url: url,
201 responseHeadersExist: true, 201 responseHeadersExist: true,
202 statusLine: "HTTP/1.0 401 Unauthorized" 202 statusLine: "HTTP/1.1 401 Unauthorized"
203 } 203 }
204 }, 204 },
205 { label: "onAuthRequired", 205 { label: "onAuthRequired",
206 event: "onAuthRequired", 206 event: "onAuthRequired",
207 details: { 207 details: {
208 url: url, 208 url: url,
209 isProxy: false, 209 isProxy: false,
210 scheme: "basic", 210 scheme: "basic",
211 realm: realm, 211 realm: realm,
212 challenger: {host: testServer, port: testServerPort}, 212 challenger: {host: testServer, port: testServerPort},
213 responseHeadersExist: true, 213 responseHeadersExist: true,
214 statusLine: "HTTP/1.0 401 Unauthorized", 214 statusLine: "HTTP/1.1 401 Unauthorized",
215 }, 215 },
216 retval: {cancel: true} 216 retval: {cancel: true}
217 }, 217 },
218 { label: "onResponseStarted", 218 { label: "onResponseStarted",
219 event: "onResponseStarted", 219 event: "onResponseStarted",
220 details: { 220 details: {
221 url: url, 221 url: url,
222 fromCache: false, 222 fromCache: false,
223 statusCode: 401, 223 statusCode: 401,
224 ip: "127.0.0.1", 224 ip: "127.0.0.1",
225 responseHeadersExist: true, 225 responseHeadersExist: true,
226 statusLine: "HTTP/1.0 401 Unauthorized", 226 statusLine: "HTTP/1.1 401 Unauthorized",
227 } 227 }
228 }, 228 },
229 { label: "onCompleted", 229 { label: "onCompleted",
230 event: "onCompleted", 230 event: "onCompleted",
231 details: { 231 details: {
232 url: url, 232 url: url,
233 fromCache: false, 233 fromCache: false,
234 statusCode: 401, 234 statusCode: 401,
235 ip: "127.0.0.1", 235 ip: "127.0.0.1",
236 responseHeadersExist: true, 236 responseHeadersExist: true,
237 statusLine: "HTTP/1.0 401 Unauthorized", 237 statusLine: "HTTP/1.1 401 Unauthorized",
238 } 238 }
239 }, 239 },
240 ], 240 ],
241 [ // event order 241 [ // event order
242 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 242 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
243 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 243 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
244 "onCompleted"] 244 "onCompleted"]
245 ], 245 ],
246 {urls: ["<all_urls>"]}, 246 {urls: ["<all_urls>"]},
247 ["responseHeaders", "blocking"]); 247 ["responseHeaders", "blocking"]);
(...skipping 26 matching lines...) Expand all
274 event: "onSendHeaders", 274 event: "onSendHeaders",
275 details: { 275 details: {
276 url: url, 276 url: url,
277 } 277 }
278 }, 278 },
279 { label: "onHeadersReceived", 279 { label: "onHeadersReceived",
280 event: "onHeadersReceived", 280 event: "onHeadersReceived",
281 details: { 281 details: {
282 url: url, 282 url: url,
283 responseHeadersExist: true, 283 responseHeadersExist: true,
284 statusLine: "HTTP/1.0 401 Unauthorized" 284 statusLine: "HTTP/1.1 401 Unauthorized"
285 } 285 }
286 }, 286 },
287 { label: "onAuthRequired", 287 { label: "onAuthRequired",
288 event: "onAuthRequired", 288 event: "onAuthRequired",
289 details: { 289 details: {
290 url: url, 290 url: url,
291 isProxy: false, 291 isProxy: false,
292 scheme: "basic", 292 scheme: "basic",
293 realm: realm, 293 realm: realm,
294 challenger: {host: testServer, port: testServerPort}, 294 challenger: {host: testServer, port: testServerPort},
295 responseHeadersExist: true, 295 responseHeadersExist: true,
296 statusLine: "HTTP/1.0 401 Unauthorized", 296 statusLine: "HTTP/1.1 401 Unauthorized",
297 }, 297 },
298 retval: {authCredentials: {username: "foo", password: "secret"}} 298 retval: {authCredentials: {username: "foo", password: "secret"}}
299 }, 299 },
300 { label: "onResponseStarted", 300 { label: "onResponseStarted",
301 event: "onResponseStarted", 301 event: "onResponseStarted",
302 details: { 302 details: {
303 url: url, 303 url: url,
304 fromCache: false, 304 fromCache: false,
305 statusCode: 200, 305 statusCode: 200,
306 ip: "127.0.0.1", 306 ip: "127.0.0.1",
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 event: "onSendHeaders", 354 event: "onSendHeaders",
355 details: { 355 details: {
356 url: url, 356 url: url,
357 } 357 }
358 }, 358 },
359 { label: "onHeadersReceived", 359 { label: "onHeadersReceived",
360 event: "onHeadersReceived", 360 event: "onHeadersReceived",
361 details: { 361 details: {
362 url: url, 362 url: url,
363 responseHeadersExist: true, 363 responseHeadersExist: true,
364 statusLine: "HTTP/1.0 401 Unauthorized" 364 statusLine: "HTTP/1.1 401 Unauthorized"
365 } 365 }
366 }, 366 },
367 { label: "onAuthRequired", 367 { label: "onAuthRequired",
368 event: "onAuthRequired", 368 event: "onAuthRequired",
369 details: { 369 details: {
370 url: url, 370 url: url,
371 isProxy: false, 371 isProxy: false,
372 scheme: "basic", 372 scheme: "basic",
373 realm: realm, 373 realm: realm,
374 challenger: {host: testServer, port: testServerPort}, 374 challenger: {host: testServer, port: testServerPort},
375 responseHeadersExist: true, 375 responseHeadersExist: true,
376 statusLine: "HTTP/1.0 401 Unauthorized", 376 statusLine: "HTTP/1.1 401 Unauthorized",
377 } 377 }
378 }, 378 },
379 { label: "onResponseStarted", 379 { label: "onResponseStarted",
380 event: "onResponseStarted", 380 event: "onResponseStarted",
381 details: { 381 details: {
382 url: url, 382 url: url,
383 fromCache: false, 383 fromCache: false,
384 statusCode: 401, 384 statusCode: 401,
385 ip: "127.0.0.1", 385 ip: "127.0.0.1",
386 responseHeadersExist: true, 386 responseHeadersExist: true,
387 statusLine: "HTTP/1.0 401 Unauthorized", 387 statusLine: "HTTP/1.1 401 Unauthorized",
388 } 388 }
389 }, 389 },
390 { label: "onCompleted", 390 { label: "onCompleted",
391 event: "onCompleted", 391 event: "onCompleted",
392 details: { 392 details: {
393 url: url, 393 url: url,
394 fromCache: false, 394 fromCache: false,
395 statusCode: 401, 395 statusCode: 401,
396 ip: "127.0.0.1", 396 ip: "127.0.0.1",
397 responseHeadersExist: true, 397 responseHeadersExist: true,
398 statusLine: "HTTP/1.0 401 Unauthorized", 398 statusLine: "HTTP/1.1 401 Unauthorized",
399 } 399 }
400 }, 400 },
401 ], 401 ],
402 [ // event order 402 [ // event order
403 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 403 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
404 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 404 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
405 "onCompleted"] 405 "onCompleted"]
406 ], 406 ],
407 {urls: ["<all_urls>"]}, ["asyncBlocking", "responseHeaders"]); 407 {urls: ["<all_urls>"]}, ["asyncBlocking", "responseHeaders"]);
408 navigateAndWait(url); 408 navigateAndWait(url);
(...skipping 25 matching lines...) Expand all
434 event: "onSendHeaders", 434 event: "onSendHeaders",
435 details: { 435 details: {
436 url: url, 436 url: url,
437 } 437 }
438 }, 438 },
439 { label: "onHeadersReceived", 439 { label: "onHeadersReceived",
440 event: "onHeadersReceived", 440 event: "onHeadersReceived",
441 details: { 441 details: {
442 url: url, 442 url: url,
443 responseHeadersExist: true, 443 responseHeadersExist: true,
444 statusLine: "HTTP/1.0 401 Unauthorized" 444 statusLine: "HTTP/1.1 401 Unauthorized"
445 } 445 }
446 }, 446 },
447 { label: "onAuthRequired", 447 { label: "onAuthRequired",
448 event: "onAuthRequired", 448 event: "onAuthRequired",
449 details: { 449 details: {
450 url: url, 450 url: url,
451 isProxy: false, 451 isProxy: false,
452 scheme: "basic", 452 scheme: "basic",
453 realm: realm, 453 realm: realm,
454 challenger: {host: testServer, port: testServerPort}, 454 challenger: {host: testServer, port: testServerPort},
455 responseHeadersExist: true, 455 responseHeadersExist: true,
456 statusLine: "HTTP/1.0 401 Unauthorized", 456 statusLine: "HTTP/1.1 401 Unauthorized",
457 }, 457 },
458 retval: {cancel: true} 458 retval: {cancel: true}
459 }, 459 },
460 { label: "onResponseStarted", 460 { label: "onResponseStarted",
461 event: "onResponseStarted", 461 event: "onResponseStarted",
462 details: { 462 details: {
463 url: url, 463 url: url,
464 fromCache: false, 464 fromCache: false,
465 statusCode: 401, 465 statusCode: 401,
466 ip: "127.0.0.1", 466 ip: "127.0.0.1",
467 responseHeadersExist: true, 467 responseHeadersExist: true,
468 statusLine: "HTTP/1.0 401 Unauthorized", 468 statusLine: "HTTP/1.1 401 Unauthorized",
469 } 469 }
470 }, 470 },
471 { label: "onCompleted", 471 { label: "onCompleted",
472 event: "onCompleted", 472 event: "onCompleted",
473 details: { 473 details: {
474 url: url, 474 url: url,
475 fromCache: false, 475 fromCache: false,
476 statusCode: 401, 476 statusCode: 401,
477 ip: "127.0.0.1", 477 ip: "127.0.0.1",
478 responseHeadersExist: true, 478 responseHeadersExist: true,
479 statusLine: "HTTP/1.0 401 Unauthorized", 479 statusLine: "HTTP/1.1 401 Unauthorized",
480 } 480 }
481 }, 481 },
482 ], 482 ],
483 [ // event order 483 [ // event order
484 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 484 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
485 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 485 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
486 "onCompleted"] 486 "onCompleted"]
487 ], 487 ],
488 {urls: ["<all_urls>"]}, 488 {urls: ["<all_urls>"]},
489 ["responseHeaders", "asyncBlocking"]); 489 ["responseHeaders", "asyncBlocking"]);
(...skipping 26 matching lines...) Expand all
516 event: "onSendHeaders", 516 event: "onSendHeaders",
517 details: { 517 details: {
518 url: url, 518 url: url,
519 } 519 }
520 }, 520 },
521 { label: "onHeadersReceived", 521 { label: "onHeadersReceived",
522 event: "onHeadersReceived", 522 event: "onHeadersReceived",
523 details: { 523 details: {
524 url: url, 524 url: url,
525 responseHeadersExist: true, 525 responseHeadersExist: true,
526 statusLine: "HTTP/1.0 401 Unauthorized" 526 statusLine: "HTTP/1.1 401 Unauthorized"
527 } 527 }
528 }, 528 },
529 { label: "onAuthRequired", 529 { label: "onAuthRequired",
530 event: "onAuthRequired", 530 event: "onAuthRequired",
531 details: { 531 details: {
532 url: url, 532 url: url,
533 isProxy: false, 533 isProxy: false,
534 scheme: "basic", 534 scheme: "basic",
535 realm: realm, 535 realm: realm,
536 challenger: {host: testServer, port: testServerPort}, 536 challenger: {host: testServer, port: testServerPort},
537 responseHeadersExist: true, 537 responseHeadersExist: true,
538 statusLine: "HTTP/1.0 401 Unauthorized", 538 statusLine: "HTTP/1.1 401 Unauthorized",
539 }, 539 },
540 retval: {authCredentials: {username: "foo", password: "secret"}} 540 retval: {authCredentials: {username: "foo", password: "secret"}}
541 }, 541 },
542 { label: "onResponseStarted", 542 { label: "onResponseStarted",
543 event: "onResponseStarted", 543 event: "onResponseStarted",
544 details: { 544 details: {
545 url: url, 545 url: url,
546 fromCache: false, 546 fromCache: false,
547 statusCode: 200, 547 statusCode: 200,
548 ip: "127.0.0.1", 548 ip: "127.0.0.1",
(...skipping 16 matching lines...) Expand all
565 [ // event order 565 [ // event order
566 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", 566 ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders",
567 "onHeadersReceived", "onAuthRequired", "onResponseStarted", 567 "onHeadersReceived", "onAuthRequired", "onResponseStarted",
568 "onCompleted"] 568 "onCompleted"]
569 ], 569 ],
570 {urls: ["<all_urls>"]}, 570 {urls: ["<all_urls>"]},
571 ["responseHeaders", "asyncBlocking"]); 571 ["responseHeaders", "asyncBlocking"]);
572 navigateAndWait(url); 572 navigateAndWait(url);
573 }, 573 },
574 ]); 574 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698