Bug 1326189 part 3 - Make test_visited_reftests support needs-focus. r=dholbert

MozReview-Commit-ID: XCy3kVh5FN

--HG--
extra : rebase_source : c81fce0505ec806f3d93adf4eee474a9cadd58a0
This commit is contained in:
Xidorn Quan 2017-01-20 17:15:02 +11:00
Родитель 07539165c0
Коммит 18085fdd3d
1 изменённых файлов: 19 добавлений и 4 удалений

Просмотреть файл

@ -126,10 +126,22 @@ function waitFor100ms() {
}
async function runTest(testLine) {
var splitData = testLine.split(" ");
let isEqual = splitData[0] == "==";
let testFile = splitData[1];
let refFile = splitData[2];
let splitData = testLine.split(" ");
let isEqual;
let needsFocus = false;
while (true) {
let op = splitData.shift();
if (op == "needs-focus") {
needsFocus = true;
} else if (op == "==" || op == "!=") {
isEqual = op == "==";
break;
} else {
ok(false, "Unknown syntax");
return;
}
}
let [testFile, refFile] = splitData;
let promiseTestWin = startIframe(testFile);
let promiseRefWin = startIframe(refFile);
@ -143,6 +155,9 @@ async function runTest(testLine) {
let tries;
let testSnapshot;
for (tries = 0; tries < gMaxPassingTries * gTimeoutFactor; ++tries) {
if (needsFocus) {
await SimpleTest.promiseFocus(testWindow, false);
}
testSnapshot = snapshotWindow(testWindow);
if (passes(isEqual, testSnapshot, refSnapshot)) {
if (tries > gMaxPassingTries) {