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

Side by Side Diff: tests/isolate/scenarios/short_package/short_package_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 // PackageRoot=none 5 // PackageRoot=none
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 import "package:flu"; 10 import "package:flu";
11 11
12 var PACKAGE_FLU = "package:flu"; 12 var PACKAGE_FLU = "package:flu";
13 var FLU_TEXT = "flu.text"; 13 var FLU_TEXT = "flu.text";
14 14
15 testShortResolution(package_uri) async { 15 testShortResolution(package_uri) async {
16 var fluPackage = await Isolate.resolvePackageUri(Uri.parse(package_uri)); 16 var fluPackage = await Isolate.resolvePackageUri(Uri.parse(package_uri));
17 print("Resolved $package_uri to $fluPackage"); 17 print("Resolved $package_uri to $fluPackage");
18 var fluText = fluPackage.resolve(FLU_TEXT); 18 var fluText = fluPackage.resolve(FLU_TEXT);
19 print("Resolved $FLU_TEXT from $package_uri to $fluText"); 19 print("Resolved $FLU_TEXT from $package_uri to $fluText");
20 var fluFile = new File.fromUri(fluText); 20 var fluFile = new File.fromUri(fluText);
21 var fluString = await fluFile.readAsString(); 21 var fluString = await fluFile.readAsString();
22 if (fluString != "Bar") { 22 if (fluString != "Bar") {
23 throw "Contents of $FLU_TEXT not matching.\n" 23 throw "Contents of $FLU_TEXT not matching.\n"
24 "Got: $fluString\n" 24 "Got: $fluString\n"
25 "Expected: Bar"; 25 "Expected: Bar";
26 } 26 }
27 } 27 }
28 28
29 main([args, port]) async { 29 main([args, port]) async {
30 if (Flu.value != "Flu") { 30 if (Flu.value != "Flu") {
31 throw "Import of wrong Flu package."; 31 throw "Import of wrong Flu package.";
32 } 32 }
33 await testShortResolution(PACKAGE_FLU); 33 await testShortResolution(PACKAGE_FLU);
34 await testShortResolution(PACKAGE_FLU + "/"); 34 await testShortResolution(PACKAGE_FLU + "/");
35 await testShortResolution(PACKAGE_FLU + "/abc.def"); 35 await testShortResolution(PACKAGE_FLU + "/abc.def");
36 print("SUCCESS"); 36 print("SUCCESS");
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698