diff options
author | Leon Clarke <leonclarke@google.com> | 2010-06-03 14:48:52 +0100 |
---|---|---|
committer | Leon Clarke <leonclarke@google.com> | 2010-06-03 14:48:52 +0100 |
commit | 21d5fcfd0da21851464111d2aa0902b2b6edbb02 (patch) | |
tree | 11ff39cf270ff80c1739d11e8f242fda3bd80d5f /LayoutTests/storage | |
parent | 10bcdb2eab81b5b9c893faf90f5bd9f396edeb4a (diff) | |
download | external_webkit-21d5fcfd0da21851464111d2aa0902b2b6edbb02.zip external_webkit-21d5fcfd0da21851464111d2aa0902b2b6edbb02.tar.gz external_webkit-21d5fcfd0da21851464111d2aa0902b2b6edbb02.tar.bz2 |
Add indexeddb layout tests at 60074 in preparation for the new merge.
They won't work, but will be added to the skip list.
Change-Id: Iee37cfb4abcf7dd02ec83d482e87fdc057d5e308
Diffstat (limited to 'LayoutTests/storage')
-rw-r--r-- | LayoutTests/storage/indexeddb/basics-expected.txt | 34 | ||||
-rw-r--r-- | LayoutTests/storage/indexeddb/basics.html | 12 | ||||
-rw-r--r-- | LayoutTests/storage/indexeddb/script-tests/TEMPLATE.html | 12 | ||||
-rw-r--r-- | LayoutTests/storage/indexeddb/script-tests/basics.js | 61 |
4 files changed, 119 insertions, 0 deletions
diff --git a/LayoutTests/storage/indexeddb/basics-expected.txt b/LayoutTests/storage/indexeddb/basics-expected.txt new file mode 100644 index 0000000..8a11f6c --- /dev/null +++ b/LayoutTests/storage/indexeddb/basics-expected.txt @@ -0,0 +1,34 @@ +Test the basics of IndexedDB. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS 'indexedDB' in window is true +PASS 'open' in indexedDB is true +indexedDB.open('name', 'description', true /* allow modification */) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true + +An event should fire shortly... + +FAIL Error function called: (0) Not implemented + +PASS 'source' in event is true +PASS 'open' in event.source is true + +FAIL 'result' in event should be true. Was false. +FAIL 'code' in event should be false. Was true. +FAIL 'message' in event should be false. Was true. + +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'abort' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/storage/indexeddb/basics.html b/LayoutTests/storage/indexeddb/basics.html new file mode 100644 index 0000000..cca9674 --- /dev/null +++ b/LayoutTests/storage/indexeddb/basics.html @@ -0,0 +1,12 @@ +<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 src="script-tests/basics.js"></script> +</body> +</html> diff --git a/LayoutTests/storage/indexeddb/script-tests/TEMPLATE.html b/LayoutTests/storage/indexeddb/script-tests/TEMPLATE.html new file mode 100644 index 0000000..239a794 --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/TEMPLATE.html @@ -0,0 +1,12 @@ +<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 src="YOUR_JS_FILE_HERE"></script> +</body> +</html> diff --git a/LayoutTests/storage/indexeddb/script-tests/basics.js b/LayoutTests/storage/indexeddb/script-tests/basics.js new file mode 100644 index 0000000..307196a --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/basics.js @@ -0,0 +1,61 @@ +description("Test the basics of IndexedDB."); + +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} + + +function eventShared() +{ + debug(""); + shouldBeTrue("'source' in event"); + shouldBeTrue("'open' in event.source"); + debug(""); + shouldBeTrue("'result' in event"); + shouldBeFalse("'code' in event"); + shouldBeFalse("'message' in event"); + debug(""); + shouldBeTrue("'onsuccess' in event.target"); + shouldBeTrue("'onerror' in event.target"); + shouldBeTrue("'abort' in event.target"); + shouldBeTrue("'readyState' in event.target"); + shouldBe("event.target.readyState", "event.target.DONE"); + debug(""); + window.successfullyParsed = true; + isSuccessfullyParsed(); + if (window.layoutTestController) + layoutTestController.notifyDone() +} + +function successFunction() +{ + debug("Success function called"); + eventShared(); +} + +function errorFunction() +{ + testFailed("Error function called: (" + event.code + ") " + event.message); + eventShared(); +} + +function test() +{ + shouldBeTrue("'indexedDB' in window"); + shouldBeTrue("'open' in indexedDB"); + + result = evalAndLog("indexedDB.open('name', 'description', true /* allow modification */)"); + shouldBeTrue("'onsuccess' in result"); + shouldBeTrue("'onerror' in result"); + shouldBeTrue("'abort' in result"); + shouldBeTrue("'readyState' in result"); + result.onsuccess = successFunction; + result.onerror = errorFunction; + debug(""); + debug("An event should fire shortly..."); + debug(""); +} + +test(); + |