diff options
Diffstat (limited to 'testing/web-platform/tests/webstorage/event_case_sensitive.js')
-rw-r--r-- | testing/web-platform/tests/webstorage/event_case_sensitive.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webstorage/event_case_sensitive.js b/testing/web-platform/tests/webstorage/event_case_sensitive.js new file mode 100644 index 000000000..2729a3bed --- /dev/null +++ b/testing/web-platform/tests/webstorage/event_case_sensitive.js @@ -0,0 +1,46 @@ +testStorages(function(storageString) { + async_test(function(t) { + assert_true(storageString in window, storageString + " exist"); + var storage = window[storageString]; + t.add_cleanup(function() { storage.clear() }); + + clearStorage(storageString, t.step_func(step0)); + assert_equals(storage.length, 0, "storage.length"); + + function step0(msg) + { + storage.foo = "test"; + runAfterNStorageEvents(t.step_func(step1), 1); + } + + function step1(msg) + { + storageEventList = new Array(); + storage.foo = "test"; + + runAfterNStorageEvents(t.step_func(step2), 0); + } + + function step2(msg) + { + if(msg != undefined) { + assert_unreached(msg); + } + assert_equals(storageEventList.length, 0); + + storage.foo = "TEST"; + + runAfterNStorageEvents(t.step_func(step3), 1); + } + + function step3(msg) + { + if(msg != undefined) { + assert_unreached(msg); + } + assert_equals(storageEventList.length, 1); + + t.done(); + } + }, storageString + " storage events fire even when only the case of the value changes."); +}); |