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

Side by Side Diff: test/codegen/lib/html/resource_http_test.dart

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 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
« no previous file with comments | « test/codegen/lib/html/resource_data.txt ('k') | test/codegen/lib/html/rtc_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
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 library resource_http_test;
6 import 'dart:async';
7 import 'package:unittest/html_individual_config.dart';
8 import 'package:unittest/unittest.dart';
9
10 main() {
11 useHtmlIndividualConfiguration();
12 // Cache blocker is a workaround for:
13 // https://code.google.com/p/dart/issues/detail?id=11834
14 var cacheBlocker = new DateTime.now().millisecondsSinceEpoch;
15 var url = '/root_dart/tests/html/resource_data.txt?cacheBlock=$cacheBlocker';
16
17 void validateResponse(data) {
18 expect(data, equals('This file was read by a Resource!'));
19 }
20
21 group('resource', () {
22 test('readAsString', () async {
23 Resource r = new Resource(url);
24 var data = await r.readAsString();
25 validateResponse(data);
26 });
27 test('readAsBytes', () async {
28 Resource r = new Resource(url);
29 var data = await r.readAsBytes();
30 validateResponse(new String.fromCharCodes(data));
31 });
32 test('openRead', () async {
33 Resource r = new Resource(url);
34 var bytes = [];
35 await for (var b in r.openRead()) {
36 bytes.addAll(b);
37 }
38 validateResponse(new String.fromCharCodes(bytes));
39 });
40 });
41 }
OLDNEW
« no previous file with comments | « test/codegen/lib/html/resource_data.txt ('k') | test/codegen/lib/html/rtc_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698