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

Side by Side Diff: tests/standalone/io/http_auth_digest_test.dart

Issue 14914002: Change fromString constructor to parse static method (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed additional tests Created 7 years, 7 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
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_body_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:crypto'; 7 import 'dart:crypto';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 response.headers.set(HttpHeaders.WWW_AUTHENTICATE, authHeader); 58 response.headers.set(HttpHeaders.WWW_AUTHENTICATE, authHeader);
59 unauthCount++; 59 unauthCount++;
60 } 60 }
61 61
62 var response = request.response; 62 var response = request.response;
63 if (request.headers[HttpHeaders.AUTHORIZATION] != null) { 63 if (request.headers[HttpHeaders.AUTHORIZATION] != null) {
64 Expect.equals(1, request.headers[HttpHeaders.AUTHORIZATION].length); 64 Expect.equals(1, request.headers[HttpHeaders.AUTHORIZATION].length);
65 String authorization = 65 String authorization =
66 request.headers[HttpHeaders.AUTHORIZATION][0]; 66 request.headers[HttpHeaders.AUTHORIZATION][0];
67 HeaderValue header = 67 HeaderValue header =
68 new HeaderValue.fromString( 68 HeaderValue.parse(
69 authorization, parameterSeparator: ","); 69 authorization, parameterSeparator: ",");
70 if (header.value == "basic") { 70 if (header.value == "basic") {
71 sendUnauthorizedResponse(response); 71 sendUnauthorizedResponse(response);
72 } else if (!useNextNonce && nonceCount == nonceStaleAfter) { 72 } else if (!useNextNonce && nonceCount == nonceStaleAfter) {
73 nonce = "87654321"; 73 nonce = "87654321";
74 nonceCount = 0; 74 nonceCount = 0;
75 sendUnauthorizedResponse(response, stale: true); 75 sendUnauthorizedResponse(response, stale: true);
76 } else { 76 } else {
77 var uri = header.parameters["uri"]; 77 var uri = header.parameters["uri"];
78 var qop = header.parameters["qop"]; 78 var qop = header.parameters["qop"];
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 testAuthenticateCallback(null, null); 384 testAuthenticateCallback(null, null);
385 testAuthenticateCallback("MD5", null); 385 testAuthenticateCallback("MD5", null);
386 testAuthenticateCallback("MD5", "auth"); 386 testAuthenticateCallback("MD5", "auth");
387 testAuthenticateCallback("MD5", "auth-int"); 387 testAuthenticateCallback("MD5", "auth-int");
388 testStaleNonce(); 388 testStaleNonce();
389 testNextNonce(); 389 testNextNonce();
390 // These teste are not normally run. They can be used for locally 390 // These teste are not normally run. They can be used for locally
391 // testing with another web server (e.g. Apache). 391 // testing with another web server (e.g. Apache).
392 //testLocalServerDigest(); 392 //testLocalServerDigest();
393 } 393 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_body_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698