[infra] Remove ContentShell support in test driver interface js.

Change-Id: I82091f9b0496a081eb9dd899e5bdaa7c9e332230
Reviewed-on: https://dart-review.googlesource.com/c/92682
Reviewed-by: Jonas Termansen <sortie@google.com>
This commit is contained in:
William Hesse 2019-02-12 15:27:25 +00:00
parent f54650ccaf
commit 92227c05fc

View file

@ -72,13 +72,6 @@ function clearConsole() {
}
}
function printToDOM(message) {
var pre = document.createElement('pre');
pre.appendChild(document.createTextNode(String(message)));
document.body.appendChild(pre);
document.body.appendChild(document.createTextNode('\n'));
}
function printToConsole(message) {
var consoleAvailable = typeof console === 'object';
@ -110,11 +103,6 @@ window.onerror = function (message, url, lineNumber) {
notifyDone('FAIL');
};
// testRunner is provided by content shell.
// It is not available in browser tests.
var testRunner = window.testRunner || window.layoutTestController;
var isContentShell = testRunner;
var waitForDone = false;
var driverWindowCached = false;
@ -173,13 +161,7 @@ function notifyUpdate(testOutcome, isFirstMessage, isStatusUpdate, isDone) {
// If we are not using the browser controller (e.g. in the none-drt
// configuration), we need to print 'testOutcome' as it is.
if (isDone && !usingBrowserController()) {
if (isContentShell) {
// We need this, since test.dart is looking for 'FAIL\n', 'PASS\n' in the
// DOM output of content shell.
printToDOM(testOutcome);
} else {
printToConsole('Test outcome: ' + testOutcome);
}
printToConsole('Test outcome: ' + testOutcome);
} else if (usingBrowserController()) {
// To support in browser launching of tests we post back start and result
// messages to the window.opener.
@ -201,9 +183,6 @@ function notifyUpdate(testOutcome, isFirstMessage, isStatusUpdate, isDone) {
is_done: isDone
}), '*');
}
if (isDone) {
if (testRunner) testRunner.notifyDone();
}
}
function notifyDone(testOutcome) {
@ -228,13 +207,6 @@ function processMessage(msg) {
if (typeof msg != 'string') return;
if (msg == 'unittest-suite-wait-for-done') {
waitForDone = true;
if (testRunner) {
testRunner.startedDartTest = true;
}
} else if (msg == 'dart-calling-main') {
if (testRunner) {
testRunner.startedDartTest = true;
}
} else if (msg == 'dart-main-done') {
if (!waitForDone) {
notifyDone('PASS');
@ -251,10 +223,6 @@ function onReceive(e) {
processMessage(e.data);
}
if (testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.addEventListener('message', onReceive, false);
function onLoad(e) {