Chromium Code Reviews| 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..933f22a81f933471965582c869e2ae7a3b3b8f24 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'; |
|
kasperl
2012/09/11 11:12:15
4 space indent?
|
| + 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; |