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

Unified Diff: utils/testrunner/html_wrap_task.dart

Issue 10909240: Support for pixel layout tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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: utils/testrunner/html_wrap_task.dart
===================================================================
--- utils/testrunner/html_wrap_task.dart (revision 12392)
+++ utils/testrunner/html_wrap_task.dart (working copy)
@@ -39,7 +39,6 @@
}
var p = new Path(testname);
var runtime = config.runtime;
- var isLayout = isLayoutRenderTest(testname) || config.generateRenders;
StringBuffer sbuf = new StringBuffer();
sbuf.add("""
<!DOCTYPE html>
@@ -50,18 +49,15 @@
<title>$testname</title>
<link rel="stylesheet" href="${p.filenameWithoutExtension}.css">
<script type='text/javascript'>
-// We check the search part of the URL for making sure we only do
-// this in the parent if in layout tests.
-if (window.testRunner && window.location.search == '') {
+if (window.testRunner) {
function handleMessage(m) {
if (m.data == 'done') {
window.testRunner.notifyDone();
}
}
window.testRunner.waitUntilDone();
- if (!$isLayout) {
- window.testRunner.dumpAsText();
- }
+ ${(config.layoutText||config.layoutPixel)?'':
Siggi Cherem (dart-lang) 2012/09/14 20:01:23 spaces around all operators: || ? :
gram 2012/09/19 23:24:38 Done.
+ 'window.testRunner.dumpAsText();'}
window.addEventListener("message", handleMessage, false);
}
""");
@@ -73,7 +69,7 @@
</head>
<body>
""");
- if (!isLayout) {
+ if (!config.layoutText && !config.layoutPixel) {
sbuf.add("""
<h1>$testname</h1>
<div id="container"></div>
@@ -82,11 +78,13 @@
}
sbuf.add("<script type='");
var prefix = flattenPath(p.directoryPath.toString());
+ var suffix = (config.layoutPixel || config.layoutText) ? '-child': '';
if (runtime == 'drt-dart') {
- sbuf.add("application/dart' src='${prefix}_${p.filename}'>");
+ sbuf.add("application/dart' "
+ "src='${prefix}_${p.filenameWithoutExtension}$suffix.dart'>");
} else {
sbuf.add("text/javascript' "
- "src='${prefix}_${p.filenameWithoutExtension}.js'>");
+ "src='${prefix}_${p.filenameWithoutExtension}$suffix.js'>");
}
sbuf.add("""
</script>

Powered by Google App Engine
This is Rietveld 408576698