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

Side by Side Diff: tests/standalone/crypto/sha1_test.dart

Issue 10252020: test rename overhaul: step 12 - standalone (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « tests/standalone/crypto/base64_test.dart ('k') | tests/standalone/deoptimization_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #source("../../../../runtime/bin/sha1.dart"); 5 #source("../../../runtime/bin/sha1.dart");
6 6
7 void hexifyHash(List<int> data) { 7 void hexifyHash(List<int> data) {
8 Expect.equals(20, data.length); 8 Expect.equals(20, data.length);
9 StringBuffer sb = new StringBuffer(); 9 StringBuffer sb = new StringBuffer();
10 for (int i = 0; i < data.length; i++) { 10 for (int i = 0; i < data.length; i++) {
11 String s = data[i].toRadixString(16); 11 String s = data[i].toRadixString(16);
12 if (s.length == 1) sb.add("0"); 12 if (s.length == 1) sb.add("0");
13 sb.add(s); 13 sb.add(s);
14 } 14 }
15 return sb.toString().toLowerCase(); 15 return sb.toString().toLowerCase();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // From WebSocket standard. 51 // From WebSocket standard.
52 data = "dGhlIHNhbXBsZSBub25jZQ==258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; 52 data = "dGhlIHNhbXBsZSBub25jZQ==258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
53 Expect.equals("b37a4f2cc0624f1690f64606cf385945b2bec4ea", 53 Expect.equals("b37a4f2cc0624f1690f64606cf385945b2bec4ea",
54 hexifyHash(_Sha1._hash(data.charCodes()))); 54 hexifyHash(_Sha1._hash(data.charCodes())));
55 55
56 data = "0123456789001234567890012345678900123456789001234567890" 56 data = "0123456789001234567890012345678900123456789001234567890"
57 "0123456789001234567890012345678900123456789001234567890"; 57 "0123456789001234567890012345678900123456789001234567890";
58 Expect.equals("534e82e5600593484251f42bd4855561a234a14b", 58 Expect.equals("534e82e5600593484251f42bd4855561a234a14b",
59 hexifyHash(_Sha1._hash(data.charCodes()))); 59 hexifyHash(_Sha1._hash(data.charCodes())));
60 } 60 }
OLDNEW
« no previous file with comments | « tests/standalone/crypto/base64_test.dart ('k') | tests/standalone/deoptimization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698