Chromium Code Reviews| 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() { |
|
kustermann
2013/05/14 09:05:24
You could rename it to a more descriptive function
|
| + 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); |