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

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

Issue 1890973003: pkg/analyzer: support latest pkg/crypto version (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: nits Created 4 years, 8 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) 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:crypto/crypto.dart"; 5 import "package:crypto/crypto.dart";
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "package:path/path.dart"; 7 import "package:path/path.dart";
8 import "dart:async"; 8 import "dart:async";
9 import "dart:io"; 9 import "dart:io";
10 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return; 166 return;
167 } else { 167 } else {
168 Expect.equals( 168 Expect.equals(
169 1, request.headers[HttpHeaders.PROXY_AUTHORIZATION].length); 169 1, request.headers[HttpHeaders.PROXY_AUTHORIZATION].length);
170 String authorization = 170 String authorization =
171 request.headers[HttpHeaders.PROXY_AUTHORIZATION][0]; 171 request.headers[HttpHeaders.PROXY_AUTHORIZATION][0];
172 if (authScheme == "Basic") { 172 if (authScheme == "Basic") {
173 List<String> tokens = authorization.split(" "); 173 List<String> tokens = authorization.split(" ");
174 Expect.equals("Basic", tokens[0]); 174 Expect.equals("Basic", tokens[0]);
175 String auth = 175 String auth =
176 CryptoUtils.bytesToBase64(UTF8.encode("$username:$password")); 176 BASE64.encode(UTF8.encode("$username:$password"));
177 if (auth != tokens[1]) { 177 if (auth != tokens[1]) {
178 basicAuthenticationRequired(request); 178 basicAuthenticationRequired(request);
179 return; 179 return;
180 } 180 }
181 } else { 181 } else {
182 HeaderValue header = 182 HeaderValue header =
183 HeaderValue.parse( 183 HeaderValue.parse(
184 authorization, parameterSeparator: ","); 184 authorization, parameterSeparator: ",");
185 Expect.equals("Digest", header.value); 185 Expect.equals("Digest", header.value);
186 var uri = header.parameters["uri"]; 186 var uri = header.parameters["uri"];
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 }); 469 });
470 }); 470 });
471 } 471 }
472 472
473 main() { 473 main() {
474 testInvalidProxy(); 474 testInvalidProxy();
475 testDirectProxy(); 475 testDirectProxy();
476 testProxy(); 476 testProxy();
477 testProxyChain(); 477 testProxyChain();
478 } 478 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_proxy_advanced_test.dart ('k') | tests/standalone/io/web_socket_compression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698