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

Unified Diff: tests/standalone/io/http_proxy_test.dart

Issue 1889273002: fix analyzer failures (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_proxy_test.dart
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 9a921078420cadbae8ffb5aef8cad7869ee28fe7..70a7f8cf4e88d6e61c82c9d272b7bb47f6712847 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -2,9 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import "package:convert/convert.dart";
import "package:crypto/crypto.dart";
import "package:expect/expect.dart";
-import "package:path/path.dart";
import "dart:async";
import "dart:io";
import 'dart:convert';
@@ -109,17 +109,6 @@ class ProxyServer {
authScheme = "Basic";
}
- void useDigestAuthentication(String username, String password) {
- this.username = username;
- this.password = password;
- authScheme = "Digest";
-
- // Calculate ha1.
- var hasher = new MD5();
- hasher.add("${username}:${realm}:${password}".codeUnits);
- ha1 = CryptoUtils.bytesToHex(hasher.close());
- }
-
basicAuthenticationRequired(request) {
request.fold(null, (x, y) {}).then((_) {
var response = request.response;
@@ -206,20 +195,17 @@ class ProxyServer {
}
Expect.isNotNull(header.parameters["response"]);
- var hasher = new MD5();
- hasher.add("${request.method}:${uri}".codeUnits);
- var ha2 = CryptoUtils.bytesToHex(hasher.close());
+ var digest = md5.convert("${request.method}:${uri}".codeUnits);
+ var ha2 = hex.encode(digest.bytes);
- var x;
- hasher = new MD5();
if (qop == null || qop == "" || qop == "none") {
- hasher.add("$ha1:${nonce}:$ha2".codeUnits);
+ digest = md5.convert("$ha1:${nonce}:$ha2".codeUnits);
} else {
- hasher.add(
+ digest = md5.convert(
"$ha1:${nonce}:${nc}:${cnonce}:${qop}:$ha2".codeUnits);
}
- Expect.equals(CryptoUtils.bytesToHex(hasher.close()),
- header.parameters["response"]);
+ Expect.equals(hex.encode(digest.bytes),
+ header.parameters["response"]);
// Add a bogus Proxy-Authentication-Info for testing.
var info = 'rspauth="77180d1ab3d6c9de084766977790f482", '
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698