summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html
blob: 20f4f3d7896a10eb5380fe0a08a85be49211780a (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 origins-prepare.html.");

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

function test()
{
    if (!window.localStorage) {
        testFailed("localStorage DOES NOT exist");
        return;
    }
    
    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.someData = 'writeme';
        // LayoutTestController's notifyDone will be called after the origin change notification comes in.
        layoutTestController.observeStorageTrackerNotifications(1);
    }
}

test();	

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