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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/eventTestHarness.js

Issue 1979363002: Moved web-platform-tests to wpt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/eventTestHarness.js
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/eventTestHarness.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/eventTestHarness.js
deleted file mode 100644
index 7d9ed01870ea1b21daa4687bc019f2dd9df9de9f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/eventTestHarness.js
+++ /dev/null
@@ -1,60 +0,0 @@
-iframe = document.createElement("IFRAME");
-iframe.src = "about:blank";
-document.body.appendChild(iframe);
-iframe.contentWindow.document.body.textContent = "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)
-}
-
-function countStorageEvents(callback, expectedNumEvents, times)
-{
- function onTimeout()
- {
- var currentCount = storageEventList.length;
- if (currentCount == expectedNumEvents) {
- callback();
- } else if (currentCount > expectedNumEvents) {
- msg = "got at least " + currentCount + ", expected only " + expectedNumEvents + " events";
- callback(msg);
- } else if (times > 50) {
- msg = "Timeout: only got " + currentCount + ", expected " + expectedNumEvents + " events";
- callback(msg);
- } else {
- countStorageEvents(callback, expectedNumEvents, times+1);
- }
- }
- setTimeout(onTimeout, 20);
-}
-
-function clearStorage(storageName, callback)
-{
- if (window[storageName].length === 0) {
- storageEventList = [];
- setTimeout(callback, 0);
- } else {
- window[storageName].clear();
- runAfterNStorageEvents(function() {
- storageEventList = [];
- callback();
- }, 1);
- }
-}
-
-function testStorages(testCallback)
-{
- testCallback("sessionStorage");
- var hit = false;
- add_result_callback(function() {
- if (!hit) {
- hit = true;
- testCallback("localStorage");
- }
- });
-}

Powered by Google App Engine
This is Rietveld 408576698