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

Unified Diff: pkg/unittest/test_controller.js

Issue 10830336: First step in switching to testRunner instead of layoutTestController. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test_controller.js
diff --git a/pkg/unittest/test_controller.js b/pkg/unittest/test_controller.js
index 85e2b94338576ee93c8be22cd5d55da3606f1955..ce7a8f0d469ee10bf7536939d94ac0f251a8dd78 100644
--- a/pkg/unittest/test_controller.js
+++ b/pkg/unittest/test_controller.js
@@ -11,12 +11,14 @@ if (navigator.webkitStartDart) {
navigator.webkitStartDart();
}
+var testRunner = window.testRunner || window.layoutTestController;
+
function processMessage(msg) {
- if (window.layoutTestController) {
+ if (testRunner) {
if (msg == 'unittest-suite-done') {
- window.layoutTestController.notifyDone();
+ testRunner.notifyDone();
} else if (msg == 'unittest-suite-wait-for-done') {
- window.layoutTestController.startedDartTest = true;
+ testRunner.startedDartTest = true;
}
}
}
@@ -25,9 +27,9 @@ function onReceive(e) {
processMessage(e.data);
}
-if (window.layoutTestController) {
- window.layoutTestController.dumpAsText();
- window.layoutTestController.waitUntilDone();
+if (testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
}
window.addEventListener("message", onReceive, false);
@@ -37,8 +39,8 @@ function showErrorAndExit(message) {
element.innerHTML = message;
document.body.appendChild(element);
}
- if (window.layoutTestController) {
- window.layoutTestController.notifyDone();
+ if (testRunner) {
+ testRunner.notifyDone();
}
}
@@ -67,8 +69,8 @@ document.onreadystatechange = function() {
// Just sleep another time to give the browser the time to process the
// posted message.
setTimeout(function() {
- if (layoutTestController && !layoutTestController.startedDartTest) {
- layoutTestController.notifyDone();
+ if (testRunner && !testRunner.startedDartTest) {
+ testRunner.notifyDone();
}
}, 0);
}, 50);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698