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

Unified Diff: tests/standalone/io/web_socket_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/web_socket_compression_test.dart ('k') | tools/addlatexhash.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/web_socket_test.dart
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index f7ff673c83b7b959985f9fbac378e99f8c058f84..3977e841923397eb203bae198435fae0bd55ef96 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -13,6 +13,7 @@ import "dart:io";
import "dart:typed_data";
import "package:async_helper/async_helper.dart";
+import "package:convert/convert.dart";
import "package:crypto/crypto.dart";
import "package:expect/expect.dart";
import "package:path/path.dart";
@@ -467,8 +468,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")
@@ -535,7 +536,7 @@ class SecurityConfiguration {
server.listen((request) {
Expect.isTrue(WebSocketTransformer.isUpgradeRequest(request));
String auth =
- CryptoUtils.bytesToBase64(UTF8.encode(userInfo));
+ BASE64.encode(UTF8.encode(userInfo));
Expect.equals('Basic $auth', request.headers['Authorization'][0]);
Expect.equals(1, request.headers['Authorization'].length);
WebSocketTransformer.upgrade(request).then((webSocket) {
« no previous file with comments | « tests/standalone/io/web_socket_compression_test.dart ('k') | tools/addlatexhash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698