diff options
Diffstat (limited to 'LayoutTests')
24 files changed, 479 insertions, 25 deletions
diff --git a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement01-expected.txt b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement01-expected.txt index 6a742d4..82affff 100644 --- a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement01-expected.txt +++ b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement01-expected.txt @@ -1,2 +1,3 @@ -Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement01 -Status: Success +Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement01 +Status: failure +Detail: notnull: assertNotNull failed diff --git a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement02-expected.txt b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement02-expected.txt index afeb9f8..75bb08d 100644 --- a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement02-expected.txt +++ b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement02-expected.txt @@ -1,2 +1,3 @@ -Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement02 -Status: Success +Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement02 +Status: failure +Detail: notnull: assertNotNull failed diff --git a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement03-expected.txt b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement03-expected.txt index c889eb7..c2a3867 100644 --- a/LayoutTests/dom/html/level2/html/HTMLIsIndexElement03-expected.txt +++ b/LayoutTests/dom/html/level2/html/HTMLIsIndexElement03-expected.txt @@ -1,2 +1,3 @@ -Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement03 -Status: Success +Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIsIndexElement03 +Status: failure +Detail: Asize: assertEquals failed, actual 0, expected 2. diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt new file mode 100644 index 0000000..bfe4f75 --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt @@ -0,0 +1,10 @@ +Tests that when a position is available, no callbacks are invoked until permission is allowed. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Success callback invoked +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html new file mode 100644 index 0000000..cacdd85 --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/delayed-permission-allowed.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt new file mode 100644 index 0000000..292e2ee --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt @@ -0,0 +1,11 @@ +Tests that when a position is available, no callbacks are invoked until permission is denied. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS error.code is error.PERMISSION_DENIED +PASS error.message is "User denied Geolocation" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html new file mode 100644 index 0000000..0faec6e --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/delayed-permission-denied.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js new file mode 100644 index 0000000..f4242ca --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js @@ -0,0 +1,27 @@ +description("Tests that when a position is available, no callbacks are invoked until permission is allowed."); + +if (window.layoutTestController) + window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); + +function allowPermission() { + permissionSet = true; + if (window.layoutTestController) + layoutTestController.setGeolocationPermission(true); +} + +navigator.geolocation.getCurrentPosition(function() { + if (permissionSet) { + testPassed('Success callback invoked'); + finishJSTest(); + return; + } + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); +}, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); +}); +window.setTimeout(allowPermission, 100); + +window.jsTestIsAsync = true; +window.successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js new file mode 100644 index 0000000..aebd302 --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js @@ -0,0 +1,30 @@ +description("Tests that when a position is available, no callbacks are invoked until permission is denied."); + +if (window.layoutTestController) + window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); + +function denyPermission() { + permissionSet = true; + if (window.layoutTestController) + layoutTestController.setGeolocationPermission(false); +} + +var error; +navigator.geolocation.getCurrentPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); +}, function(e) { + if (permissionSet) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + return; + } + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); +}); +window.setTimeout(denyPermission, 100); + +window.jsTestIsAsync = true; +window.successfullyParsed = true; diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js index 93c3cb6..aaab749 100644 --- a/LayoutTests/fast/js/resources/js-test-pre.js +++ b/LayoutTests/fast/js/resources/js-test-pre.js @@ -23,7 +23,7 @@ function debug(msg) function escapeHTML(text) { - return text.replace(/&/g, "&").replace(/</g, "<"); + return text.replace(/&/g, "&").replace(/</g, "<").replace(/\0/g, "\\0"); } function testPassed(msg) diff --git a/LayoutTests/http/tests/appcache/origin-quota-expected.txt b/LayoutTests/http/tests/appcache/origin-quota-expected.txt new file mode 100644 index 0000000..1d530bb --- /dev/null +++ b/LayoutTests/http/tests/appcache/origin-quota-expected.txt @@ -0,0 +1,9 @@ +UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} +This test checks that per-origin application cache quotas are enforced. + +This test sets the quota for the origin to 20kb, and attempts to fill it up with 2 iframes that are 13kb each. The application cache download process should fail on the 2nd iframe and the UI Delegate should be informed of the exceeded quota. Increasing the size to 40kb. A 3rd iframe is added, which should succeed. + +PASS - cached iframe-1 +PASS - error caching iframe-2 as expected +PASS - cached iframe-3 + diff --git a/LayoutTests/http/tests/appcache/origin-quota.html b/LayoutTests/http/tests/appcache/origin-quota.html new file mode 100644 index 0000000..a7322fd --- /dev/null +++ b/LayoutTests/http/tests/appcache/origin-quota.html @@ -0,0 +1,77 @@ +<html> +<head> +<script> + +// Helpers. + +function log(message) { + document.getElementById("console").innerHTML += message + "<br>"; +} + +// Start and end. + +function startTest() { + if (window.layoutTestController) { + layoutTestController.clearAllApplicationCaches(); + layoutTestController.dumpApplicationCacheDelegateCallbacks(); + layoutTestController.setApplicationCacheOriginQuota(20*1024); + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } + + addFirstIFrame(); +} + +function finishTest() { + if (window.layoutTestController) + layoutTestController.notifyDone(); +} + +// Stages. + +function addIFrameWithContinuation(src, continuation) { + window.onmessage = continuation; + var iframe = document.createElement("iframe"); + iframe.src = src; + document.body.appendChild(iframe); +} + +function addFirstIFrame() { + // Expected to succeed. + addIFrameWithContinuation("resources/quota-origin-iframe-1.html", function(event) { + log(event.data); + addSecondIFrame(); + }); +} + +function addSecondIFrame() { + // Expected to fail, then increase the quota. + // NOTE: When this fails, the exceed callback will automatically increase it back to the default quota size. + addIFrameWithContinuation("resources/quota-origin-iframe-2.html", function(event) { + log(event.data); + addThirdIFrame(); + }); +} + +function addThirdIFrame() { + // Expected to succeed. + addIFrameWithContinuation("resources/quota-origin-iframe-3.html", function(event) { + log(event.data); + finishTest(); + }); +} + +</script> +</head> +<body onload="startTest()"> +<p>This test checks that per-origin application cache quotas are enforced.</p> +<p> + This test sets the quota for the origin to 20kb, and attempts to fill + it up with 2 iframes that are 13kb each. The application cache download + process should fail on the 2nd iframe and the UI Delegate should be + informed of the exceeded quota. Increasing the size to 40kb. A 3rd + iframe is added, which should succeed. +</p> +<pre id="console"></pre> +</body> +</html> diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.html b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.html new file mode 100644 index 0000000..c50959f --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.html @@ -0,0 +1,8 @@ +<html manifest="quota-origin-iframe-1.manifest"> +<script> +// iframe-1 is expected to succeed. +applicationCache.oncached = function() { parent.postMessage("PASS - cached iframe-1", "*"); }; +applicationCache.onerror = function() { parent.postMessage("FAIL - error caching iframe-1, expected this to succeed and fit in the quota", "*"); }; +applicationCache.onnoupdate = function() { parent.postMessage("FAIL - no update iframe-1, all caches should have been deleted before this test", "*"); }; +</script> +</html> diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.manifest b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.manifest new file mode 100644 index 0000000..63d3784 --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-1.manifest @@ -0,0 +1,7 @@ +CACHE MANIFEST + +# iframe-1 should succeed. The origin quota has been set to +# 20kb. Caching abe.png and this manifest will be ~13kb. + +CACHE: +abe.png diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.html b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.html new file mode 100644 index 0000000..0f1c11b --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.html @@ -0,0 +1,8 @@ +<html manifest="quota-origin-iframe-2.manifest"> +<script> +// iframe-2 is expected to fail due to exceeding the origin quota. +applicationCache.oncached = function() { parent.postMessage("FAIL - cached iframe-2, expected this this fail because it reached the quota", "*"); }; +applicationCache.onerror = function() { parent.postMessage("PASS - error caching iframe-2 as expected", "*"); }; +applicationCache.onnoupdate = function() { parent.postMessage("FAIL - no update iframe-2, all caches should have been deleted before this test", "*"); }; +</script> +</html> diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.manifest b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.manifest new file mode 100644 index 0000000..64292b0 --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-2.manifest @@ -0,0 +1,8 @@ +CACHE MANIFEST + +# iframe-2 should fail. The origin quota has been set to +# 20kb, with ~13kb already cached. Caching abe.png and this +# manifest (~13kb) should exceed the quota and fail. + +CACHE: +abe.png diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.html b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.html new file mode 100644 index 0000000..a185e54 --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.html @@ -0,0 +1,8 @@ +<html manifest="quota-origin-iframe-3.manifest"> +<script> +// iframe-3 is expected to succeed once the quota has been increased. +applicationCache.oncached = function() { parent.postMessage("PASS - cached iframe-3", "*"); }; +applicationCache.onerror = function() { parent.postMessage("FAIL - error caching iframe-3, expected this to succeed with the quota increased", "*"); }; +applicationCache.onnoupdate = function() { parent.postMessage("FAIL - no update iframe-3, all caches should have been deleted before this test", "*"); }; +</script> +</html> diff --git a/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.manifest b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.manifest new file mode 100644 index 0000000..bc29867 --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/quota-origin-iframe-3.manifest @@ -0,0 +1,8 @@ +CACHE MANIFEST + +# iframe-3 should succeed. The origin quota shuld have been +# raised to 40kb, with ~13kb already cached. Caching abe.png +# and this manifest will be ~13kb, bringing us up to 26kb. + +CACHE: +abe.png diff --git a/LayoutTests/platform/android-v8/fast/dom/DeviceMotion/window-property-expected.txt b/LayoutTests/platform/android-v8/fast/dom/DeviceMotion/window-property-expected.txt new file mode 100644 index 0000000..1bfbc1f --- /dev/null +++ b/LayoutTests/platform/android-v8/fast/dom/DeviceMotion/window-property-expected.txt @@ -0,0 +1,18 @@ +Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL typeof window.DeviceMotionEvent == 'object' should be true. Was false. +FAIL typeof window.DeviceMotionEvent == 'function' should be false. Was true. +PASS hasDeviceMotionEventProperty() is true +PASS 'DeviceMotionEvent' in window is true +PASS window.hasOwnProperty('DeviceMotionEvent') is true +PASS typeof window.ondevicemotion == 'object' is true +PASS hasOnDeviceMotionProperty() is true +PASS 'ondevicemotion' in window is true +FAIL window.hasOwnProperty('ondevicemotion') should be true. Was false. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/platform/android/test_expectations.txt b/LayoutTests/platform/android/test_expectations.txt index 6d01fd9..a21fd86 100644 --- a/LayoutTests/platform/android/test_expectations.txt +++ b/LayoutTests/platform/android/test_expectations.txt @@ -28,6 +28,8 @@ ietestcenter/Javascript/15.4.4.15-3-8.html SKIP // hangs the layout tests http:/ // This first block of tests are for features for which Android // should pass all tests. They are skipped only temporarily. // TODO: Fix these failing tests and remove them from this list. +fast/dom/Geolocation/delayed-permission-allowed.html IGNORE_RESULT // Requires layoutTestController.permissionSet b/2914450 +fast/dom/Geolocation/delayed-permission-denied.html IGNORE_RESULT // Requires layoutTestController.permissionSet b/2914450 fast/events/touch/basic-multi-touch-events.html IGNORE_RESULT // Requires multi-touch fast/events/touch/touch-target.html IGNORE_RESULT // Requires multi-touch http/tests/appcache/empty-manifest.html IGNORE_RESULT // flaky diff --git a/LayoutTests/storage/domstorage/complex-values-expected.txt b/LayoutTests/storage/domstorage/complex-values-expected.txt index 9a75e42..e1665e6 100644 --- a/LayoutTests/storage/domstorage/complex-values-expected.txt +++ b/LayoutTests/storage/domstorage/complex-values-expected.txt @@ -82,25 +82,25 @@ PASS storage.getItem('foo9') is "2" storage.foo10 = k PASS typeof storage['foo10'] is "string" -PASS storage['foo10'] is "ÿ찡�hello" +PASS storage['foo10'] is "ÿ찡\0hello" PASS typeof storage.foo10 is "string" -PASS storage.foo10 is "ÿ찡�hello" +PASS storage.foo10 is "ÿ찡\0hello" PASS typeof storage.getItem('foo10') is "string" -PASS storage.getItem('foo10') is "ÿ찡�hello" +PASS storage.getItem('foo10') is "ÿ찡\0hello" storage['foo11'] = k PASS typeof storage['foo11'] is "string" -PASS storage['foo11'] is "ÿ찡�hello" +PASS storage['foo11'] is "ÿ찡\0hello" PASS typeof storage.foo11 is "string" -PASS storage.foo11 is "ÿ찡�hello" +PASS storage.foo11 is "ÿ찡\0hello" PASS typeof storage.getItem('foo11') is "string" -PASS storage.getItem('foo11') is "ÿ찡�hello" +PASS storage.getItem('foo11') is "ÿ찡\0hello" storage.setItem('foo12', k) PASS typeof storage['foo12'] is "string" -PASS storage['foo12'] is "ÿ찡�hello" +PASS storage['foo12'] is "ÿ찡\0hello" PASS typeof storage.foo12 is "string" -PASS storage.foo12 is "ÿ찡�hello" +PASS storage.foo12 is "ÿ찡\0hello" PASS typeof storage.getItem('foo12') is "string" -PASS storage.getItem('foo12') is "ÿ찡�hello" +PASS storage.getItem('foo12') is "ÿ찡\0hello" Testing localStorage @@ -182,25 +182,25 @@ PASS storage.getItem('foo9') is "2" storage.foo10 = k PASS typeof storage['foo10'] is "string" -PASS storage['foo10'] is "ÿ찡�hello" +PASS storage['foo10'] is "ÿ찡\0hello" PASS typeof storage.foo10 is "string" -PASS storage.foo10 is "ÿ찡�hello" +PASS storage.foo10 is "ÿ찡\0hello" PASS typeof storage.getItem('foo10') is "string" -PASS storage.getItem('foo10') is "ÿ찡�hello" +PASS storage.getItem('foo10') is "ÿ찡\0hello" storage['foo11'] = k PASS typeof storage['foo11'] is "string" -PASS storage['foo11'] is "ÿ찡�hello" +PASS storage['foo11'] is "ÿ찡\0hello" PASS typeof storage.foo11 is "string" -PASS storage.foo11 is "ÿ찡�hello" +PASS storage.foo11 is "ÿ찡\0hello" PASS typeof storage.getItem('foo11') is "string" -PASS storage.getItem('foo11') is "ÿ찡�hello" +PASS storage.getItem('foo11') is "ÿ찡\0hello" storage.setItem('foo12', k) PASS typeof storage['foo12'] is "string" -PASS storage['foo12'] is "ÿ찡�hello" +PASS storage['foo12'] is "ÿ찡\0hello" PASS typeof storage.foo12 is "string" -PASS storage.foo12 is "ÿ찡�hello" +PASS storage.foo12 is "ÿ찡\0hello" PASS typeof storage.getItem('foo12') is "string" -PASS storage.getItem('foo12') is "ÿ찡�hello" +PASS storage.getItem('foo12') is "ÿ찡\0hello" PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/storage/indexeddb/open-cursor-expected.txt b/LayoutTests/storage/indexeddb/open-cursor-expected.txt new file mode 100644 index 0000000..ac58785 --- /dev/null +++ b/LayoutTests/storage/indexeddb/open-cursor-expected.txt @@ -0,0 +1,102 @@ +Test IndexedDB's openCursor. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +indexedDB.open('name', 'description') +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... + +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is 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 + +db = event.result +db.createObjectStore('test') +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... + +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is 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 + +objectStore = event.result +objectStore.add('myValue', 'myKey') +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... + +Opening cursor +objectStore.openCursor(keyRange) +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... + +Cursor opened successfully. +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is 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 event.result.direction is 0 +PASS event.result.key is 'myKey' +PASS event.result.value is 'myValue' + +Opening an empty cursor. +objectStore.openCursor(keyRange) +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... + +Empty cursor opened successfully. +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is 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 event.result is null +PASS successfullyParsed is true + +TEST COMPLETE diff --git a/LayoutTests/storage/indexeddb/open-cursor.html b/LayoutTests/storage/indexeddb/open-cursor.html new file mode 100644 index 0000000..f60365d --- /dev/null +++ b/LayoutTests/storage/indexeddb/open-cursor.html @@ -0,0 +1,13 @@ +<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> +<script src="resources/shared.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/open-cursor.js"></script> +</body> +</html> diff --git a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js new file mode 100644 index 0000000..e3c615c --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js @@ -0,0 +1,79 @@ +description("Test IndexedDB's openCursor."); +if (window.layoutTestController) + layoutTestController.waitUntilDone(); + +function emptyCursorSuccess() +{ + debug("Empty cursor opened successfully.") + verifySuccessEvent(event); + // FIXME: check that we can iterate the cursor. + shouldBe("event.result", "null"); + done(); +} + +function openEmptyCursor() +{ + debug("Opening an empty cursor."); + keyRange = IDBKeyRange.leftBound("InexistentKey"); + result = evalAndLog("objectStore.openCursor(keyRange)"); + verifyResult(result); + result.onsuccess = emptyCursorSuccess; +} + +function cursorSuccess() +{ + debug("Cursor opened successfully.") + verifySuccessEvent(event); + // FIXME: check that we can iterate the cursor. + shouldBe("event.result.direction", "0"); + shouldBe("event.result.key", "'myKey'"); + shouldBe("event.result.value", "'myValue'"); + debug(""); + openEmptyCursor(); +} + +function openCursor() +{ + debug("Opening cursor"); + keyRange = IDBKeyRange.leftBound("myKey"); + result = evalAndLog("objectStore.openCursor(keyRange)"); + verifyResult(result); + result.onsuccess = cursorSuccess; +} + +function populateObjectStore(objectStore) +{ + result = evalAndLog("objectStore.add('myValue', 'myKey')"); + verifyResult(result); + result.onsuccess = openCursor; + result.onerror = unexpectedErrorCallback; +} + +function createObjectStoreSuccess() +{ + verifySuccessEvent(event); + var objectStore = evalAndLog("objectStore = event.result"); + populateObjectStore(objectStore); +} + +function openSuccess() +{ + verifySuccessEvent(event); + var db = evalAndLog("db = event.result"); + result = evalAndLog("db.createObjectStore('test')"); + verifyResult(result); + result.onsuccess = createObjectStoreSuccess; + result.onerror = unexpectedErrorCallback; +} + +function test() +{ + result = evalAndLog("indexedDB.open('name', 'description')"); + verifyResult(result); + result.onsuccess = openSuccess; + result.onerror = unexpectedErrorCallback; +} + +test(); + +var successfullyParsed = true; |