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

Unified Diff: pkg/unittest/lib/test_controller.js

Issue 14757019: Add browser controller and allow it to be used under a flag. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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: pkg/unittest/lib/test_controller.js
===================================================================
--- pkg/unittest/lib/test_controller.js (revision 22503)
+++ pkg/unittest/lib/test_controller.js (working copy)
@@ -33,10 +33,17 @@
var waitForDone = false;
+function sendBackData() {
+ if (window.opener) {
+ window.opener.postMessage(window.document.body.innerHTML, "*");
+ }
+}
+
function processMessage(msg) {
if (typeof msg != 'string') return;
if (msg == 'unittest-suite-done') {
if (testRunner) testRunner.notifyDone();
+ sendBackData();
} else if (msg == 'unittest-suite-wait-for-done') {
waitForDone = true;
if (testRunner) testRunner.startedDartTest = true;
@@ -49,6 +56,7 @@
} else if (msg == 'unittest-suite-success') {
dartPrint('PASS');
if (testRunner) testRunner.notifyDone();
+ sendBackData();
} else if (msg == 'unittest-suite-fail') {
showErrorAndExit('Some tests failed.');
}
@@ -72,6 +80,7 @@
// FAIL and will continue polling until one of these words show up.
dartPrint('FAIL');
if (testRunner) testRunner.notifyDone();
+ sendBackData();
}
function onLoad(e) {
@@ -107,6 +116,7 @@
setTimeout(function() {
if (testRunner && !testRunner.startedDartTest) {
testRunner.notifyDone();
+ sendBackData();
}
}, 0);
}, 50);
« no previous file with comments | « no previous file | tools/testing/dart/browser_controller.dart » ('j') | tools/testing/dart/browser_controller.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698