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

Unified Diff: tests/standalone/io/web_socket_compression_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/web_socket_compression_test.dart
diff --git a/tests/standalone/io/web_socket_compression_test.dart b/tests/standalone/io/web_socket_compression_test.dart
index e25bc1b2d4f6a28fc926e14a7d163a4793eea154..99f341eeaf6939a821a11ebb5b36528938a45864 100644
--- a/tests/standalone/io/web_socket_compression_test.dart
+++ b/tests/standalone/io/web_socket_compression_test.dart
@@ -57,7 +57,7 @@ class SecurityConfiguration {
for (int i = 0; i < 16; i++) {
nonceData[i] = random.nextInt(256);
}
- String nonce = CryptoUtils.bytesToBase64(nonceData);
+ String nonce = BASE64.encode(nonceData);
uri = new Uri(
scheme: uri.scheme == "wss" ? "https" : "http",
@@ -71,7 +71,7 @@ class SecurityConfiguration {
if (uri.userInfo != null && !uri.userInfo.isEmpty) {
// If the URL contains user information use that for basic
// authorization.
- String auth = CryptoUtils.bytesToBase64(UTF8.encode(uri.userInfo));
+ String auth = BASE64.encode(UTF8.encode(uri.userInfo));
request.headers.set(HttpHeaders.AUTHORIZATION, "Basic $auth");
}
// Setup the initial handshake.
@@ -175,8 +175,8 @@ class SecurityConfiguration {
Expect.equals('websocket', request.headers.value(HttpHeaders.UPGRADE));
var key = request.headers.value('Sec-WebSocket-Key');
- var sha1 = new SHA1()..add("$key$WEB_SOCKET_GUID".codeUnits);
- var accept = CryptoUtils.bytesToBase64(sha1.close());
+ var digest = sha1.convert("$key$WEB_SOCKET_GUID".codeUnits);
+ var accept = BASE64.encode(digest.bytes);
request.response
..statusCode = HttpStatus.SWITCHING_PROTOCOLS
..headers.add(HttpHeaders.CONNECTION, "Upgrade")
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698