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

Side by Side Diff: tools/testing/dart/browser_test.dart

Issue 11638049: Convert unittest to use "package:" imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « pkg/unittest/test/unittest_test.dart ('k') | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of test_suite; 5 part of test_suite;
6 6
7 String getHtmlContents(String title, 7 String getHtmlContents(String title,
8 Path controllerScript, 8 Path controllerScript,
9 Path dartJsScript, 9 Path dartJsScript,
10 String scriptType, 10 String scriptType,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 </body> 47 </body>
48 </html> 48 </html>
49 """; 49 """;
50 50
51 String wrapDartTestInLibrary(Path test) => 51 String wrapDartTestInLibrary(Path test) =>
52 """ 52 """
53 library libraryWrapper; 53 library libraryWrapper;
54 part '$test'; 54 part '$test';
55 """; 55 """;
56 56
57 String dartTestWrapper(Path dartHome, Path library) => 57 String dartTestWrapper(Path dartHome, Path library) {
58 """ 58 // Tests inside "pkg" import unittest using "package:". All others use a
59 // relative path. The imports need to agree, so use a matching form here.
60 var unitTest = dartHome.append("pkg/unittest/lib").toString();
61 if (library.relativeTo(dartHome).segments().contains("pkg")) {
62 unitTest = 'package:unittest';
63 }
64
65 return """
59 library test; 66 library test;
60 67
61 import '${dartHome.append('pkg/unittest/lib/unittest.dart')}' as unittest; 68 import '$unitTest/unittest.dart' as unittest;
62 import '${dartHome.append('pkg/unittest/lib/html_config.dart')}' as config; 69 import '$unitTest/html_config.dart' as config;
63 import '${library}' as Test; 70 import '${library}' as Test;
64 71
65 main() { 72 main() {
66 config.useHtmlConfiguration(); 73 config.useHtmlConfiguration();
67 unittest.group('', Test.main); 74 unittest.group('', Test.main);
68 } 75 }
69 """; 76 """;
70 77 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/unittest_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698