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

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

Issue 9666053: Add get_drt.py to test.dart, so that testing browser components updates DumpRenderTree. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index b69f78a8d036c5d49f9e2dd8bf9e30dcf1415aee..c79bbdc27d8b679970e2ead6fcc6fd21fb5e7f2f 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -19,6 +19,7 @@
#import("status_file_parser.dart");
#import("test_runner.dart");
#import("multitest.dart");
+#import("drt_updater.dart");
#source("browser_test.dart");
@@ -222,6 +223,16 @@ class StandardTestSuite implements TestSuite {
void forEachTest(Function onTest, Map testCache, String globalTempDir(),
[Function onDone = null]) {
+ // If DumpRenderTree is required, and not yet updated, wait for update.
+ if (DumpRenderTreeUpdater.componentRequiresDRT(configuration['component'])
+ && !DumpRenderTreeUpdater.updated) {
+ Expect.isTrue(DumpRenderTreeUpdater.isActive);
+ DumpRenderTreeUpdater.onUpdated.add(() {
+ forEachTest(onTest, testCache, globalTempDir, onDone);
+ });
+ return;
+ }
+
doTest = onTest;
doDone = (onDone != null) ? onDone : (() => null);
globalTemporaryDirectory = globalTempDir;
@@ -325,41 +336,40 @@ class StandardTestSuite implements TestSuite {
}
if (expectations.contains(SKIP)) return;
- switch (configuration['component']) {
- case 'dartium':
- case 'chromium':
- case 'frogium':
- case 'legium':
- case 'webdriver':
- enqueueBrowserTest(filename, testName, optionsFromFile,
- expectations, isNegative);
- break;
- default:
- isNegative = isNegative ||
- (configuration['checked'] && info.isNegativeIfChecked);
-
- if (configuration['component'] == 'dartc') {
- // dartc can detect static type warnings by the
- // format of the error line
- if (info.hasFatalTypeErrors) {
- isNegative = true;
- } else if (info.hasRuntimeErrors) {
- isNegative = false;
- }
- }
+ if (TestUtils.isBrowserComponent(configuration['component'])) {
+ enqueueBrowserTest(info, testName, expectations);
+ } else {
+ enqueueStandardTest(info, testName, expectations);
+ }
+ }
- var argumentLists = argumentListsFromFile(filename,
- optionsFromFile);
-
- for (var args in argumentLists) {
- doTest(new TestCase('$suiteName/$testName',
- [new Command(shellPath(), args)],
- configuration,
- completeHandler,
- expectations,
- isNegative,
- info));
- }
+ void enqueueStandardTest(TestInfo info,
+ String testName,
+ Set<String> expectations) {
+ bool isNegative = info.isNegative ||
+ (configuration['checked'] && info.isNegativeIfChecked);
+
+ if (configuration['component'] == 'dartc') {
+ // dartc can detect static type warnings by the
+ // format of the error line
+ if (info.hasFatalTypeErrors) {
+ isNegative = true;
+ } else if (info.hasRuntimeErrors) {
+ isNegative = false;
+ }
+ }
+
+ var argumentLists = argumentListsFromFile(info.filename,
+ info.optionsFromFile);
+
+ for (var args in argumentLists) {
+ doTest(new TestCase('$suiteName/$testName',
+ [new Command(shellPath(), args)],
+ configuration,
+ completeHandler,
+ expectations,
+ isNegative,
+ info));
}
}
@@ -417,11 +427,11 @@ class StandardTestSuite implements TestSuite {
* step and an execution step, both with the appropriate executable and
* arguments.
*/
- void enqueueBrowserTest(String filename,
+ void enqueueBrowserTest(TestInformation info,
String testName,
- Map optionsFromFile,
- Set<String> expectations,
- bool isNegative) {
+ Set<String> expectations) {
+ Map optionsFromFile = info.optionsFromFile;
+ String filename = info.filename;
if (optionsFromFile['isMultitest']) return;
bool isWebTest = optionsFromFile['containsDomImport'];
bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
@@ -431,6 +441,7 @@ class StandardTestSuite implements TestSuite {
}
final String component = configuration['component'];
+ Expect.isTrue(DumpRenderTreeUpdater.componentRequiresDRT(component));
final String testPath =
new File(filename).fullPathSync().replaceAll('\\', '/');
@@ -1170,6 +1181,13 @@ class TestUtils {
}
return args;
}
+
+ static bool isBrowserComponent(String component) =>
+ const <String>['dartium',
+ 'chromium',
+ 'frogium',
+ 'legium',
+ 'webdriver'].some((x) => x == component);
}
class SummaryReport {
« tools/testing/dart/drt_updater.dart ('K') | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698