diff options
Diffstat (limited to 'LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html')
-rw-r--r-- | LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html new file mode 100644 index 0000000..20f4f3d --- /dev/null +++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html @@ -0,0 +1,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> |