summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html
blob: c066fb4f0a76d476ddebd1b741b594634d31897b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("StorageTracker test - write local storage for this origin. Should be called after storage-tracker-3-delete-all.html.");

if (window.layoutTestController)
    layoutTestController.waitUntilDone();
    
function finishTest() {
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}

function test()
{
    if (!window.localStorage) {
        testFailed("localStorage DOES NOT exist");
        return;
    }
    
    debug("This test should have no visible output on success.");

    if (layoutTestController.originsWithLocalStorage().length > 0) {
        // An origin already exists so we can exit.
        testFailed("An origin already existed with local storage.");
        layoutTestController.notifyDone();
    } else {
        layoutTestController.syncLocalStorage();
        localStorage.someOtherData = 'writemeMore';
        layoutTestController.observeStorageTrackerNotifications(1);
    }
}

test();	

window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>