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

Unified Diff: dart/tools/testing/dart/test_suite.dart

Issue 13674004: Wrapping files without library tags is neither necessary nor correct anymore. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged and address comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tools/testing/dart/browser_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/test_suite.dart
diff --git a/dart/tools/testing/dart/test_suite.dart b/dart/tools/testing/dart/test_suite.dart
index 2f71864120e6fbe8a2ee3c7be5e4c1d51d63e6fa..24c71dca1cad81c81e0092d0b494bc66f359f3fa 100644
--- a/dart/tools/testing/dart/test_suite.dart
+++ b/dart/tools/testing/dart/test_suite.dart
@@ -872,15 +872,6 @@ class StandardTestSuite extends TestSuite {
dartWrapper.closeSync();
}
- void _createLibraryWrapperFile(Path dartLibraryFilename, filePath) {
- File file = new File(dartLibraryFilename.toNativePath());
- RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE);
- var requestPath = new Path(PREFIX_DARTDIR)
- .join(filePath.relativeTo(TestUtils.dartDir()));
- dartLibrary.writeStringSync(wrapDartTestInLibrary(requestPath));
- dartLibrary.closeSync();
- }
-
/**
* The [StandardTestSuite] has support for tests that
* compile a test from Dart to JavaScript, and then run the resulting
@@ -903,12 +894,6 @@ class StandardTestSuite extends TestSuite {
Path filePath = info.filePath;
String filename = filePath.toString();
bool isWebTest = optionsFromFile['containsDomImport'];
- bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
- if (isWrappingRequired
- && !isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
- print('Warning for $filename: Browser tests require #library '
- 'in any file that uses #import, #source, or #resource');
- }
final String compiler = configuration['compiler'];
final String runtime = configuration['runtime'];
@@ -930,15 +915,8 @@ class StandardTestSuite extends TestSuite {
String htmlPath = '$tempDir/test.html';
if (isWrappingRequired && !isWebTest) {
- // test.dart will import the dart test directly, if it is a library,
- // or indirectly through test_as_library.dart, if it is not.
- Path dartLibraryFilename = filePath;
- if (!isLibraryDefinition) {
- dartLibraryFilename = new Path(tempDir).append(
- 'test_as_library.dart');
- _createLibraryWrapperFile(dartLibraryFilename, filePath);
- }
- _createWrapperFile(dartWrapperFilename, dartLibraryFilename);
+ // test.dart will import the dart test.
+ _createWrapperFile(dartWrapperFilename, filePath);
} else {
dartWrapperFilename = filename;
// TODO(whesse): Once test.py is retired, adjust the relative path in
@@ -1355,10 +1333,6 @@ class StandardTestSuite extends TestSuite {
RegExp domImportRegExp =
new RegExp(r"^[#]?import.*dart:(html|web_audio|indexed_db|svg|web_sql)",
multiLine: true);
- RegExp libraryDefinitionRegExp =
- new RegExp(r"^[#]?library[\( ]", multiLine: true);
- RegExp sourceOrImportRegExp =
- new RegExp("^(#source|#import|part)[ \t]+[\('\"]", multiLine: true);
var bytes = new File.fromPath(filePath).readAsBytesSync();
String contents = decodeUtf8(bytes);
@@ -1418,8 +1392,6 @@ class StandardTestSuite extends TestSuite {
Match isolateMatch = isolateStubsRegExp.firstMatch(contents);
String isolateStubs = isolateMatch != null ? isolateMatch[1] : '';
bool containsDomImport = domImportRegExp.hasMatch(contents);
- bool isLibraryDefinition = libraryDefinitionRegExp.hasMatch(contents);
- bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents);
int numStaticTypeAnnotations = 0;
for (var i in staticTypeRegExp.allMatches(contents)) {
numStaticTypeAnnotations++;
@@ -1455,8 +1427,6 @@ class StandardTestSuite extends TestSuite {
"subtestNames": subtestNames,
"isolateStubs": isolateStubs,
"containsDomImport": containsDomImport,
- "isLibraryDefinition": isLibraryDefinition,
- "containsSourceOrImport": containsSourceOrImport,
"numStaticTypeAnnotations": numStaticTypeAnnotations,
"numCompileTimeAnnotations": numCompileTimeAnnotations };
}
@@ -1525,8 +1495,6 @@ class StandardTestSuite extends TestSuite {
"subtestNames": <String>[],
"isolateStubs": '',
"containsDomImport": false,
- "isLibraryDefinition": false,
- "containsSourceOrImport": false,
"numStaticTypeAnnotations": 0,
"numCompileTimeAnnotations": 0,
};
« no previous file with comments | « dart/tools/testing/dart/browser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698