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

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

Issue 1453993002: update-w3c-deps import using blink cc6d84edb87e89c363ab48dac8a983213b9dc02c: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip imported/web-platform-tests/html/webappapis/scripting/events/onerroreventhandler.html Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 iframe = document.createElement("IFRAME"); 1 iframe = document.createElement("IFRAME");
2 iframe.src = "about:blank"; 2 iframe.src = "about:blank";
3 document.body.appendChild(iframe); 3 document.body.appendChild(iframe);
4 iframe.contentWindow.document.body.textContent = "Nothing to see here."; 4 iframe.contentWindow.document.body.textContent = "Nothing to see here.";
5 5
6 storageEventList = new Array(); 6 storageEventList = new Array();
7 iframe.contentWindow.addEventListener("storage", function(e) { 7 iframe.contentWindow.addEventListener("storage", function(e) {
8 window.parent.storageEventList.push(e); 8 window.parent.storageEventList.push(e);
9 }); 9 });
10 10
(...skipping 15 matching lines...) Expand all
26 } else if (times > 50) { 26 } else if (times > 50) {
27 msg = "Timeout: only got " + currentCount + ", expected " + expected NumEvents + " events"; 27 msg = "Timeout: only got " + currentCount + ", expected " + expected NumEvents + " events";
28 callback(msg); 28 callback(msg);
29 } else { 29 } else {
30 countStorageEvents(callback, expectedNumEvents, times+1); 30 countStorageEvents(callback, expectedNumEvents, times+1);
31 } 31 }
32 } 32 }
33 setTimeout(onTimeout, 20); 33 setTimeout(onTimeout, 20);
34 } 34 }
35 35
36 function clearStorage(storageName, callback)
37 {
38 if (window[storageName].length === 0) {
39 storageEventList = [];
40 setTimeout(callback, 0);
41 } else {
42 window[storageName].clear();
43 runAfterNStorageEvents(function() {
44 storageEventList = [];
45 callback();
46 }, 1);
47 }
48 }
49
36 function testStorages(testCallback) 50 function testStorages(testCallback)
37 { 51 {
38 testCallback("sessionStorage"); 52 testCallback("sessionStorage");
39 var hit = false; 53 var hit = false;
40 add_result_callback(function() { 54 add_result_callback(function() {
41 if (!hit) { 55 if (!hit) {
42 hit = true; 56 hit = true;
43 testCallback("localStorage"); 57 testCallback("localStorage");
44 } 58 }
45 }); 59 });
46 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698