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

Unified Diff: utils/testrunner/html_wrap_task.dart

Issue 10914049: Added support for layout render tests. These use expected values for the text render output from Du… (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
« no previous file with comments | « utils/testrunner/drt_task.dart ('k') | utils/testrunner/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/testrunner/html_wrap_task.dart
===================================================================
--- utils/testrunner/html_wrap_task.dart (revision 11963)
+++ utils/testrunner/html_wrap_task.dart (working copy)
@@ -18,9 +18,10 @@
void execute(Path testfile, List stdout, List stderr, bool logging,
Function exitHandler) {
+ var testname = expandMacros(_testFileTemplate, testfile);
+
// If the test already has a corresponding HTML file we copy that,
// else we create a new wrapper.
- var testname = expandMacros(_testFileTemplate, testfile);
var htmlSourceName = expandMacros(_htmlSourceFileTemplate, testfile);
var htmlDestName = expandMacros(_htmlDestFileTemplate, testfile);
var cssSourceName = expandMacros(_cssSourceFileTemplate, testfile);
@@ -38,6 +39,7 @@
}
var p = new Path(testname);
var runtime = config.runtime;
+ var isLayout = isLayoutRenderTest(testname) || config.generateRenders;
StringBuffer sbuf = new StringBuffer();
sbuf.add("""
<!DOCTYPE html>
@@ -48,17 +50,20 @@
<title>$testname</title>
<link rel="stylesheet" href="${p.filenameWithoutExtension}.css">
<script type='text/javascript'>
-function handleMessage(m) {
- if (m.data == 'done') {
- window.testRunner.notifyDone();
+// 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 == '') {
+ function handleMessage(m) {
+ if (m.data == 'done') {
+ window.testRunner.notifyDone();
+ }
}
+ window.testRunner.waitUntilDone();
+ if (!$isLayout) {
+ window.testRunner.dumpAsText();
+ }
+ window.addEventListener("message", handleMessage, false);
}
-
- if (window.testRunner) {
- window.testRunner.waitUntilDone();
- window.testRunner.dumpAsText();
- window.addEventListener("message", handleMessage, false);
- }
""");
if (runtime == 'drt-dart') {
sbuf.add("if (navigator.webkitStartDart) navigator.webkitStartDart();");
@@ -67,10 +72,15 @@
</script>
</head>
<body>
+""");
+ if (!isLayout) {
+ sbuf.add("""
<h1>$testname</h1>
<div id="container"></div>
- <pre id="console"></pre>
- <script type='""");
+ <pre id='console'></pre>
+""");
+ }
+ sbuf.add("<script type='");
var prefix = flattenPath(p.directoryPath.toString());
if (runtime == 'drt-dart') {
sbuf.add("application/dart' src='${prefix}_${p.filename}'>");
« no previous file with comments | « utils/testrunner/drt_task.dart ('k') | utils/testrunner/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698