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

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

Issue 10918168: Run dart2js tests unmodified in drt. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review comments Created 8 years, 3 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
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 943b1853ce8c959966dc8f4282d948b08ef2a087..63f04ea8c5c292a9a3c0b58355d0318ca66f6277 100644
--- a/dart/tools/testing/dart/test_suite.dart
+++ b/dart/tools/testing/dart/test_suite.dart
@@ -395,7 +395,9 @@ class StandardTestSuite implements TestSuite {
if (expectations.contains(SKIP)) return;
if (TestUtils.isBrowserRuntime(configuration['runtime'])) {
- enqueueBrowserTest(info, testName, expectations);
+ bool isWrappingRequired = configuration['compiler'] != 'dart2js'
+ || configuration['runtime'] != 'drt';
+ enqueueBrowserTest(info, testName, expectations, isWrappingRequired);
} else {
enqueueStandardTest(info, testName, expectations);
}
@@ -529,24 +531,26 @@ class StandardTestSuite implements TestSuite {
/**
* The [StandardTestSuite] has support for tests that
- * compile a test from Dart to Javascript, and then run the resulting
- * Javascript. This function creates a working directory to hold the
- * Javascript version of the test, and copies the appropriate framework
+ * compile a test from Dart to JavaScript, and then run the resulting
+ * JavaScript. This function creates a working directory to hold the
+ * JavaScript version of the test, and copies the appropriate framework
* files to that directory. It creates a [BrowserTestCase], which has
- * two sequential steps to be run by the [ProcessQueue when] the test is
+ * two sequential steps to be run by the [ProcessQueue] when the test is
* executed: a compilation
* step and an execution step, both with the appropriate executable and
* arguments.
*/
void enqueueBrowserTest(TestInformation info,
String testName,
- Set<String> expectations) {
+ Set<String> expectations,
+ bool isWrappingRequired) {
Map optionsFromFile = info.optionsFromFile;
Path filePath = info.filePath;
String filename = filePath.toString();
bool isWebTest = optionsFromFile['containsDomImport'];
bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
- if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
+ if (isWrappingRequired
+ && !isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
print('Warning for $filename: Browser tests require #library '
'in any file that uses #import, #source, or #resource');
}
@@ -570,7 +574,7 @@ class StandardTestSuite implements TestSuite {
String compiledDartWrapperFilename = '$tempDir/test.js';
String htmlPath = '$tempDir/test.html';
- if (!isWebTest) {
+ 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;
« dart/pkg/unittest/config.dart ('K') | « dart/tests/compiler/dart2js_native/dart2js_native.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698