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

Unified Diff: third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js

Issue 2538773003: Deflake storage/domstorage/events tests when run in random order (Closed)
Patch Set: Rebased Created 4 years 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: third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js
diff --git a/third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js b/third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js
index 476cce58fee28029918ae502cd6e779487665aaa..f42a749ff84d3da94f8fb2d879b335b56711c970 100644
--- a/third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js
+++ b/third_party/WebKit/LayoutTests/storage/domstorage/events/resources/eventTestHarness.js
@@ -1,21 +1,14 @@
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
+var jsTestIsAsync = true;
iframe = document.createElement("IFRAME");
-iframe.src = "about:blank";
+iframe.src = 'about:blank';
document.body.appendChild(iframe);
-iframe.contentWindow.document.body.innerText = "Nothing to see here.";
storageEventList = new Array();
-iframe.contentWindow.onstorage = function (e) {
- window.parent.storageEventList.push(e);
-}
function runAfterNStorageEvents(callback, expectedNumEvents)
{
- countStorageEvents(callback, expectedNumEvents, 0)
+ countStorageEvents(callback, expectedNumEvents, 0);
}
function countStorageEvents(callback, expectedNumEvents, times)
@@ -31,36 +24,23 @@ function countStorageEvents(callback, expectedNumEvents, times)
} else if (times > 50) {
testFailed("Timeout: only got " + currentCount + ", expected " + expectedNumEvents + " events");
callback();
- } else
- countStorageEvents(callback, expectedNumEvents, times+1)
+ } else {
+ countStorageEvents(callback, expectedNumEvents, times+1);
+ }
}
setTimeout(onTimeout, 20);
}
function testStorages(testCallback)
{
- // When we're done testing LocalStorage, this is run.
- function allDone()
- {
- debug("");
- debug("");
- window.successfullyParsed = true;
- isSuccessfullyParsed();
- debug("");
- localStorage.clear();
- sessionStorage.clear();
- if (window.testRunner)
- testRunner.notifyDone()
- }
-
// When we're done testing with SessionStorage, this is run.
function runLocalStorage()
{
debug("");
debug("");
- testCallback("localStorage", allDone);
+ testCallback("localStorage", finishJSTest);
}
- // First run the test with SessionStorage.
+ // First run the test with SessionStorage.
testCallback("sessionStorage", runLocalStorage);
}

Powered by Google App Engine
This is Rietveld 408576698