From f05b935882198ccf7d81675736e3aeb089c5113a Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 5 May 2011 14:36:32 +0100 Subject: Merge WebKit at r74534: Initial merge by git. Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb --- .../private-browsing-affects-storage-expected.txt | 8 +- .../private-browsing-affects-storage-expected.txt | 8 +- LayoutTests/storage/hash-change-with-xhr.js | 6 + .../storage/indexeddb/cursor-delete-expected.txt | 133 ++++++++++++++++++++ LayoutTests/storage/indexeddb/cursor-delete.html | 132 ++++++++++++++++++++ .../indexeddb/cursor-index-delete-expected.txt | 134 ++++++++++++++++++++ .../storage/indexeddb/cursor-index-delete.html | 136 +++++++++++++++++++++ .../indexeddb/objectstore-basics-expected.txt | 31 +++-- .../storage/indexeddb/objectstore-basics.html | 45 ++++--- .../transaction-crash-on-abort-expected.txt | 32 +++++ .../indexeddb/transaction-crash-on-abort.html | 44 +++++++ .../private-browsing-noread-nowrite-expected.txt | 15 +++ .../storage/private-browsing-noread-nowrite.html | 102 ++++++++++++++++ .../storage/private-browsing-readonly-expected.txt | 13 -- LayoutTests/storage/private-browsing-readonly.html | 101 --------------- 15 files changed, 781 insertions(+), 159 deletions(-) create mode 100644 LayoutTests/storage/indexeddb/cursor-delete-expected.txt create mode 100644 LayoutTests/storage/indexeddb/cursor-delete.html create mode 100644 LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt create mode 100644 LayoutTests/storage/indexeddb/cursor-index-delete.html create mode 100644 LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt create mode 100644 LayoutTests/storage/indexeddb/transaction-crash-on-abort.html create mode 100644 LayoutTests/storage/private-browsing-noread-nowrite-expected.txt create mode 100644 LayoutTests/storage/private-browsing-noread-nowrite.html delete mode 100644 LayoutTests/storage/private-browsing-readonly-expected.txt delete mode 100644 LayoutTests/storage/private-browsing-readonly.html (limited to 'LayoutTests/storage') diff --git a/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt b/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt index 6de4296..2fea061 100644 --- a/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt +++ b/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt @@ -1,7 +1,7 @@ This is a test to make sure that when private browsing is on any attempt to change the localStorage area fail. -Initial value of testItem is: InitialValue +Initial value of testItem is: null Caught exception trying to change item: Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 -After change attempt, testItem is: InitialValue -After remove attempt, testItem is: InitialValue -After clear attempt, testItem is: InitialValue +After change attempt, testItem is: null +After remove attempt, testItem is: null +After clear attempt, testItem is: null diff --git a/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt b/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt index ed2017a..58c99f2 100644 --- a/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt +++ b/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt @@ -1,7 +1,7 @@ This is a test to make sure that when private browsing is on any attempt to change the sessionStorage area fail. -Initial value of testItem is: InitialValue +Initial value of testItem is: null Caught exception trying to change item: Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 -After change attempt, testItem is: InitialValue -After remove attempt, testItem is: InitialValue -After clear attempt, testItem is: InitialValue +After change attempt, testItem is: null +After remove attempt, testItem is: null +After clear attempt, testItem is: null diff --git a/LayoutTests/storage/hash-change-with-xhr.js b/LayoutTests/storage/hash-change-with-xhr.js index 4290681..7f56f79 100644 --- a/LayoutTests/storage/hash-change-with-xhr.js +++ b/LayoutTests/storage/hash-change-with-xhr.js @@ -81,6 +81,12 @@ function invokeBack() function runTest() { + // Location changes need to happen outside the onload handler to generate history entries. + setTimeout(runTestsInner, 0); +} + +function runTestsInner() +{ backIterations = 10; consecutiveFailures = 0; successes = 0; diff --git a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt new file mode 100644 index 0000000..1fdf9ed --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt @@ -0,0 +1,133 @@ +Test IndexedDB's openCursor. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +webkitIndexedDB.open('name') +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +db = event.result +db.setVersion('new version') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +setVersionSuccess(): +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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +trans = event.result +PASS trans !== null is true +Deleted all object stores. +objectStore = db.createObjectStore('test') +objectStore.add('myValue1', 'myKey1') +objectStore.add('myValue2', 'myKey2') +objectStore.add('myValue3', 'myKey3') +objectStore.add('myValue4', 'myKey4') +openCursor1 +trans = db.transaction('test', webkitIDBTransaction.READ_WRITE) +trans.objectStore('test').openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +event.result.delete() +PASS event.result.value is "myValue1" +event.result.continue() +event.result.delete() +PASS event.result.value is "myValue2" +event.result.continue() +event.result.delete() +PASS event.result.value is "myValue3" +event.result.continue() +event.result.delete() +PASS event.result.value is "myValue4" +event.result.continue() +PASS counter is 5 +trans.objectStore('test').openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +WARN: shouldBe() expects string arguments +PASS null is null +trans = db.transaction('test', webkitIDBTransaction.READ_WRITE) +objectStore = trans.objectStore('test') +objectStore.add('myValue1', 'myKey1') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +openCursor2 +objectStore.openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS [object IDBCursor] is non-null. +event.result.delete() +objectStore.get('myKey1') +Error event fired: +PASS 'result' in event is false +PASS 'code' in event is true +PASS 'message' in event is true +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 '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/cursor-delete.html b/LayoutTests/storage/indexeddb/cursor-delete.html new file mode 100644 index 0000000..ce62d6a --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-delete.html @@ -0,0 +1,132 @@ + + + + + + + + +

+
+ + + diff --git a/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt new file mode 100644 index 0000000..4598556 --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt @@ -0,0 +1,134 @@ +Test IndexedDB's openCursor. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +webkitIndexedDB.open('name') +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +db = event.result +db.setVersion('new version') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +setVersionSuccess(): +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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +trans = event.result +PASS trans !== null is true +Deleted all object stores. +objectStore = db.createObjectStore('test') +objectStore.createIndex('testIndex', 'x') +objectStore.add({x: 1}, 'myKey1') +objectStore.add({x: 2}, 'myKey2') +objectStore.add({x: 3}, 'myKey3') +objectStore.add({x: 4}, 'myKey4') +openCursor1 +trans = db.transaction('test', webkitIDBTransaction.READ_WRITE) +trans.objectStore('test').index('testIndex').openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +event.result.delete() +PASS event.result.key is counter++ +event.result.continue() +event.result.delete() +PASS event.result.key is counter++ +event.result.continue() +event.result.delete() +PASS event.result.key is counter++ +event.result.continue() +event.result.delete() +PASS event.result.key is counter++ +event.result.continue() +PASS counter is 5 +trans.objectStore('test').index('testIndex').openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.result is null +trans = db.transaction('test', webkitIDBTransaction.READ_WRITE) +objectStore = trans.objectStore('test') +objectStore.add({x: 1}, 'myKey1') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +openCursor2 +index = event.source.index('testIndex') +index.openCursor({range: keyRange}) +PASS 'onsuccess' in result is true +PASS 'onerror' 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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS [object IDBCursor] is non-null. +event.result.delete() +index.get(1) +Error event fired: +PASS 'result' in event is false +PASS 'code' in event is true +PASS 'message' in event is true +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 '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/cursor-index-delete.html b/LayoutTests/storage/indexeddb/cursor-index-delete.html new file mode 100644 index 0000000..ea10f02 --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-index-delete.html @@ -0,0 +1,136 @@ + + + + + + + + +

+
+ + + diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt index e736d2f..17746d3 100644 --- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt +++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt @@ -98,22 +98,13 @@ PASS store.indexNames.item(100) is null transaction = db.transaction() store = transaction.objectStore('storeName') Try to insert data with a Date key: -store.add({x: 'foo'}, new Date()) -PASS Exception thrown -PASS code is DOMException.TYPE_MISMATCH_ERR +store.add({x: 'foo'}, testDate) Try to insert a value not handled by structured clone: store.add({x: 'bar', y: document.getElementById('console')}, 'bar') PASS Exception thrown PASS code is DOMException.NOT_SUPPORTED_ERR Try to insert data where key path yields a Date key: -store.add({x: new Date()}, 'foo') -PASS Adding data where key path yielded Date key resulted in error. -store.add({x: 'value'}, 'key') -PASS 'onsuccess' in result is true -PASS 'onerror' in result is true -PASS 'readyState' in result is true -An event should fire shortly... - +store.add({x: new Date(), y: 'value'}, 'key') addSuccess(): Success event fired: PASS 'result' in event is true @@ -127,7 +118,7 @@ PASS 'readyState' in event.target is true PASS event.target.readyState is event.target.DONE PASS event.result is "key" -event.source.add({x: 'value'}, 'zzz') +event.source.add({x: 'foo'}, 'zzz') PASS 'onsuccess' in result is true PASS 'onerror' in result is true PASS 'readyState' in result is true @@ -208,8 +199,22 @@ PASS 'onerror' in event.target is true PASS 'readyState' in event.target is true PASS event.target.readyState is event.target.DONE -PASS event.result.x is "value" +PASS event.result.y is "value" store = event.source +store.get(testDate) +getSuccessDateKey(): +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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.result.x is "foo" store.delete('key') PASS 'onsuccess' in result is true PASS 'onerror' in result is true diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html index 3d2a1d2..a368c01 100644 --- a/LayoutTests/storage/indexeddb/objectstore-basics.html +++ b/LayoutTests/storage/indexeddb/objectstore-basics.html @@ -136,6 +136,7 @@ function checkMetadata() addData(); } +var testDate = new Date("August 25, 1991 20:57:08"); function addData() { @@ -144,17 +145,13 @@ function addData() window.store = evalAndLog("store = transaction.objectStore('storeName')"); debug("Try to insert data with a Date key:"); - // FIXME: This should work in the future. - try { - debug("store.add({x: 'foo'}, new Date())"); - store.add({x: 'foo'}, new Date()); - testFailed("Passing a Date as key argument should have thrown."); - } catch (err) { - testPassed("Exception thrown"); - code = err.code; - shouldBe("code", "DOMException.TYPE_MISMATCH_ERR"); - } + result = evalAndLog("store.add({x: 'foo'}, testDate)"); + result.onsuccess = addDateSuccess; + result.onerror = unexpectedErrorCallback; +} +function addDateSuccess() +{ debug("Try to insert a value not handled by structured clone:"); try { debug("store.add({x: 'bar', y: document.getElementById('console')}, 'bar')"); @@ -166,19 +163,8 @@ function addData() shouldBe("code", "DOMException.NOT_SUPPORTED_ERR"); } - // FIXME: This should work in the future. debug("Try to insert data where key path yields a Date key:"); - result = evalAndLog("store.add({x: new Date()}, 'foo')"); - result.onsuccess = unexpectedSuccessCallback; - result.onerror = addKeyPathYieldingDateFailure; -} - -function addKeyPathYieldingDateFailure() -{ - testPassed("Adding data where key path yielded Date key resulted in error."); - - result = evalAndLog("store.add({x: 'value'}, 'key')"); - verifyResult(result); + result = evalAndLog("store.add({x: new Date(), y: 'value'}, 'key')"); result.onsuccess = addSuccess; result.onerror = unexpectedErrorCallback; } @@ -189,7 +175,7 @@ function addSuccess() verifySuccessEvent(event); shouldBeEqualToString("event.result", "key"); - result = evalAndLog("event.source.add({x: 'value'}, 'zzz')"); + result = evalAndLog("event.source.add({x: 'foo'}, 'zzz')"); verifyResult(result); result.onsuccess = unexpectedSuccessCallback; result.onerror = addAgainFailure; @@ -248,8 +234,19 @@ function getSuccess() { debug("getSuccess():"); verifySuccessEvent(event); - shouldBeEqualToString("event.result.x", "value"); + shouldBeEqualToString("event.result.y", "value"); + var store = evalAndLog("store = event.source"); + result = evalAndLog("store.get(testDate)"); + result.onsuccess = getSuccessDateKey; + result.onerror = unexpectedErrorCallback; +} + +function getSuccessDateKey() +{ + debug("getSuccessDateKey():"); + verifySuccessEvent(event); + shouldBeEqualToString("event.result.x", "foo"); result = evalAndLog("store.delete('key')"); verifyResult(result); diff --git a/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt b/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt new file mode 100644 index 0000000..413643c --- /dev/null +++ b/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt @@ -0,0 +1,32 @@ +Test IndexedDB transaction does not crash on abort. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS 'webkitIndexedDB' in window is true +PASS webkitIndexedDB == null is false +webkitIndexedDB.open('name') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +openSuccess(): +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 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +db = event.result +db.transaction([]) +window.gc() +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html b/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html new file mode 100644 index 0000000..1b13c87 --- /dev/null +++ b/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html @@ -0,0 +1,44 @@ + + + + + + + + +

+
+ + + diff --git a/LayoutTests/storage/private-browsing-noread-nowrite-expected.txt b/LayoutTests/storage/private-browsing-noread-nowrite-expected.txt new file mode 100644 index 0000000..7542ba6 --- /dev/null +++ b/LayoutTests/storage/private-browsing-noread-nowrite-expected.txt @@ -0,0 +1,15 @@ +This test makes sure that attempts to change the database during private browsing fail. +Setup statement 1 completed successfully +Setup statement 2 completed successfully +Private browsing statement 1 completed with an error +not authorized +Private browsing statement 2 completed with an error +not authorized +Private browsing statement 3 completed with an error +not authorized +Private browsing statement 4 completed with an error +not authorized +Private browsing statement 5 completed with an error +access to PrivateTest1.randomData is prohibited +Test ended + diff --git a/LayoutTests/storage/private-browsing-noread-nowrite.html b/LayoutTests/storage/private-browsing-noread-nowrite.html new file mode 100644 index 0000000..b9b5882 --- /dev/null +++ b/LayoutTests/storage/private-browsing-noread-nowrite.html @@ -0,0 +1,102 @@ + + + + + +This test makes sure that attempts to change the database during private browsing fail.
+
+ + diff --git a/LayoutTests/storage/private-browsing-readonly-expected.txt b/LayoutTests/storage/private-browsing-readonly-expected.txt deleted file mode 100644 index d5f4e0b..0000000 --- a/LayoutTests/storage/private-browsing-readonly-expected.txt +++ /dev/null @@ -1,13 +0,0 @@ -This test makes sure that attempts to change the database during private browsing fail. -Setup statement 1 completed successfully -Setup statement 2 completed successfully -Private browsing statement 1 completed with an error -not authorized -Private browsing statement 2 completed with an error -not authorized -Private browsing statement 3 completed with an error -not authorized -Private browsing statement 4 completed with an error -not authorized -Test ended - diff --git a/LayoutTests/storage/private-browsing-readonly.html b/LayoutTests/storage/private-browsing-readonly.html deleted file mode 100644 index 972b123..0000000 --- a/LayoutTests/storage/private-browsing-readonly.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - -This test makes sure that attempts to change the database during private browsing fail.
-
- - -- cgit v1.1