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

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

Issue 11586012: Call DumpRenderTree directly from test.dart instead of using the drt-trampoline.py indirection (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index c3d6dcbccd7c4d241ffedc9afd15383b533d767d..523778bb54d20d43be585ecbb748b22f88855303 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -794,6 +794,7 @@ class StandardTestSuite extends TestSuite {
String testName,
Object expectations,
bool isWrappingRequired) {
+ // TODO(kustermann/ricow): This method should be refactored.
Map optionsFromFile = info.optionsFromFile;
Path filePath = info.filePath;
String filename = filePath.toString();
@@ -919,6 +920,14 @@ class StandardTestSuite extends TestSuite {
int subtestIndex = 0;
// Construct the command that executes the browser test
do {
+ List<Command> commandSet = new List<Command>.from(commands);
+ if (subtestIndex != 0) {
+ // NOTE: The first time we enter this loop, all the compilation
+ // commands will be executed. On subsequent loop iterations, we
+ // don't need to do any compilations. Thus we set "commandSet = []".
+ commandSet = [];
+ }
+
List<String> args = <String>[];
String fullHtmlPath = htmlPath.startsWith('http:') ? htmlPath :
(htmlPath.startsWith('/') ?
@@ -928,6 +937,7 @@ class StandardTestSuite extends TestSuite {
&& subtestNames.length > 0) {
fullHtmlPath = '${fullHtmlPath}#${subtestNames[subtestIndex]}';
}
+
if (TestUtils.usesWebDriver(runtime)) {
args = [
dartDir.append('tools/testing/run_selenium.py').toNativePath(),
@@ -937,40 +947,51 @@ class StandardTestSuite extends TestSuite {
if (runtime == 'dartium') {
args.add('--executable=$dartiumFilename');
}
- } else {
- args = [
- dartDir.append('tools/testing/drt-trampoline.py').toNativePath(),
- dumpRenderTreeFilename,
- '--no-timeout'
- ];
- if (compiler == 'none') {
- String packageRoot =
- packageRootArgument(optionsFromFile['packageRoot']);
- if (packageRoot != null) {
- args.add(packageRoot);
- }
+ if (subtestIndex != 0) {
+ args.add('--force-refresh');
}
- if (runtime == 'drt' &&
- (compiler == 'none' || compiler == 'dart2dart')) {
- var dartFlags = ['--ignore-unrecognized-flags'];
+ commandSet.add(new Command('python', args));
+ } else {
+ Expect.isTrue(runtime == "drt");
+
+ var dartFlags = [];
+ var dumpRenderTreeOptions = [];
+ var packageRootUri;
+
+ dumpRenderTreeOptions.add('--no-timeout');
+
+ if (compiler == 'none' || compiler == 'dart2dart') {
+ dartFlags.add('--ignore-unrecognized-flags');
if (configuration["checked"]) {
dartFlags.add('--enable_asserts');
dartFlags.add("--enable_type_checks");
}
dartFlags.addAll(vmOptions);
- args.add('--dart-flags=${Strings.join(dartFlags, " ")}');
}
- args.add(fullHtmlPath);
+ if (compiler == 'none') {
+ var packageRoot = packageRoot(optionsFromFile['packageRoot']);
+ if (packageRoot != null) {
+ var absolutePath = TestUtils.absolutePath(new Path(packageRoot));
+ packageRootUri = new Uri.fromComponents(
+ scheme: 'file',
+ path: absolutePath.toString());
+ }
+ }
+
if (expectedOutput != null) {
- args.add('--out-expectation=${expectedOutput.toNativePath()}');
+ if (expectedOutput.toNativePath().endsWith('.png')) {
+ // pixel tests are specified by running DRT "foo.html'-p"
+ dumpRenderTreeOptions.add('--notree');
+ fullHtmlPath = "${fullHtmlPath}'-p";
+ }
}
+ commandSet.add(new DumpRenderTreeCommand(dumpRenderTreeFilename,
+ fullHtmlPath,
+ dumpRenderTreeOptions,
+ dartFlags,
+ packageRootUri,
+ expectedOutput));
}
- List<Command> commandSet = new List<Command>.from(commands);
- if (subtestIndex != 0) {
- commandSet = [];
- if(TestUtils.usesWebDriver(runtime)) args.add('--force-refresh');
- }
- commandSet.add(new Command('python', args));
// Create BrowserTestCase and queue it.
String testDisplayName = '$suiteName/$testName';
@@ -1164,12 +1185,22 @@ class StandardTestSuite extends TestSuite {
return args;
}
- String packageRootArgument(String packageRootFromFile) {
- if (packageRootFromFile == "none") return null;
+ String packageRoot(String packageRootFromFile) {
+ if (packageRootFromFile == "none") {
+ return null;
+ }
String packageRoot = packageRootFromFile;
if (packageRootFromFile == null) {
packageRoot = "$buildDir/packages/";
}
+ return packageRoot;
+ }
+
+ String packageRootArgument(String packageRootFromFile) {
+ var packageRoot = packageRoot(packageRootFromFile);
+ if (packageRoot == null) {
+ return null;
+ }
return "--package-root=$packageRoot";
}
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698