Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (36 sloc) 1.346 kB
<!DOCTYPE HTML>
<html>
<head>
<title>WebStorage Test: localStorage event - StorageEventInit</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<h1>event_local_StorageEventInit</h1>
<div id="log"></div>
<script>
test(function() {
var t = async_test("storageeventinit test");
function onStorageEvent(event) {
t.step(function() {
assert_equals(event.key, 'key');
assert_equals(event.oldValue, 'oldValue');
assert_equals(event.newValue, 'newValue');
assert_equals(event.url, window.location.href);
assert_equals(event.storageArea, window.localStorage);
});
t.done();
}
window.addEventListener('storage', onStorageEvent, false);
var event = new StorageEvent('storage', {
key: 'key',
oldValue: 'oldValue',
newValue: 'newValue',
url: window.location.href,
storageArea: window.localStorage
});
window.dispatchEvent(event);
}, "Storage event is fired due to set values for StorageEventInit.");
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.