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

Side by Side Diff: tests/language_strong/conditional_import_string_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 7
8 // All three libraries have an HttpRequest class. 8 // All three libraries have an HttpRequest class.
9 import "conditional_import_string_test.dart" 9 import "conditional_import_string_test.dart"
10 if (dart.library.io == "true") "dart:io" 10 if (dart.library.io == "true") "dart:io"
11 if (dart.library.html == "true") "dart:html" 11 if (dart.library.html == "true") "dart:html" deferred as d show HttpRequest;
12 deferred as d show HttpRequest;
13 12
14 class HttpRequest {} 13 class HttpRequest {}
15 14
16 void main() { 15 void main() {
17 asyncStart(); 16 asyncStart();
18 var io = const String.fromEnvironment("dart.library.io"); 17 var io = const String.fromEnvironment("dart.library.io");
19 var html = const String.fromEnvironment("dart.library.html"); 18 var html = const String.fromEnvironment("dart.library.html");
20 () async { 19 () async {
21 // Shouldn't fail. Shouldn't time out. 20 // Shouldn't fail. Shouldn't time out.
22 await d.loadLibrary().timeout(const Duration(seconds: 5)); 21 await d.loadLibrary().timeout(const Duration(seconds: 5));
23 if (io == "true") { 22 if (io == "true") {
24 print("io"); 23 print("io");
25 Expect.throws(() => new d.HttpRequest()); // Class is abstract in dart:io 24 Expect.throws(() => new d.HttpRequest()); // Class is abstract in dart:io
26 } else if (html == "true") { 25 } else if (html == "true") {
27 print("html"); 26 print("html");
28 dynamic r = new d.HttpRequest(); // Shouldn't throw 27 dynamic r = new d.HttpRequest(); // Shouldn't throw
29 var o = r.open; // Shouldn't fail, the open method is there. 28 var o = r.open; // Shouldn't fail, the open method is there.
30 } else { 29 } else {
31 print("none"); 30 print("none");
32 dynamic r = new d.HttpRequest(); 31 dynamic r = new d.HttpRequest();
33 Expect.isTrue(r is HttpRequest); 32 Expect.isTrue(r is HttpRequest);
34 } 33 }
35 asyncEnd(); 34 asyncEnd();
36 }(); 35 }();
37 } 36 }
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698