summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /LayoutTests
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt8
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt6
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html40
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen.html27
-rw-r--r--LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt12
-rw-r--r--LayoutTests/storage/indexeddb/create-and-remove-object-store.html7
-rw-r--r--LayoutTests/storage/indexeddb/create-object-store-options-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/create-object-store-options.html12
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete-expected.txt9
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete.html7
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt183
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-autoincrement.html181
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt10
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html10
14 files changed, 437 insertions, 77 deletions
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt
new file mode 100644
index 0000000..4d7e1f0
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt
@@ -0,0 +1,8 @@
+
+Tests the keygen element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.getElementById("keys").options is undefined
+
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt
deleted file mode 100644
index a6f14fb..0000000
--- a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-This test verifies that list-box-style select form control for keygen works properly when selecting from option element.
-
-You should see the word "SUCCESS" below
-
-SUCCESS
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html
deleted file mode 100644
index 2667715..0000000
--- a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<html><head>
-</head><body>
-<keygen id="keys" />
-
-<p>This test verifies that list-box-style select form control for keygen works properly when selecting from option element.
-</p><p>You should see the word "SUCCESS" below</p>
-
-<div id="result">FAILED</div>
-
-<script>
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
-function test(elementId)
-{
- var testKeygenElement = document.getElementById(elementId);
-
- // Add two option elements here in case the webkit port used doesn't implement the WebCore::getSupportedKeySizes() function
-
- var testOption1 = document.createElement("option");
- var testOption1Text = document.createTextNode("foo1");
- testOption1.appendChild(testOption1Text);
- testKeygenElement.appendChild(testOption1);
-
- var testOption2 = document.createElement("option");
- var testOption2Text = document.createTextNode("foo2");
- testOption2.appendChild(testOption2Text);
- testKeygenElement.appendChild(testOption2);
-
- if (testKeygenElement.options[1].index == 1)
- {
- var result = document.getElementById("result");
- result.innerHTML = "SUCCESS";
- }
-}
-test("keys");
-</script>
-
-
-</body></html>
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html b/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html
new file mode 100644
index 0000000..59196ac
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<keygen id="keys" />
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function test(elementId)
+{
+ description('Tests the keygen element.');
+
+ shouldBe('document.getElementById("keys").options', 'undefined');
+}
+
+test("keys");
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt b/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
index fd14c83..21f7d8d 100644
--- a/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
+++ b/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
@@ -50,6 +50,18 @@ Adding 'tmp' again
PASS code is webkitIDBDatabaseException.CONSTRAINT_ERR
trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
trans.objectStore('tmp').get(0)
+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 undefined
Trying create
PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
Trying remove
diff --git a/LayoutTests/storage/indexeddb/create-and-remove-object-store.html b/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
index c5284af..7bde468 100644
--- a/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
+++ b/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
@@ -76,12 +76,15 @@ function cleaned()
}
trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
req = evalAndLog("trans.objectStore('tmp').get(0)");
- req.onsuccess = unexpectedSuccessCallback;
- req.onerror = tryOnceMore;
+ req.onsuccess = tryOnceMore;
+ req.onerror = unexpectedErrorCallback;
}
function tryOnceMore()
{
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
+
testCreateAndRemove();
done();
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
index 83016d6..9e727a5 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
+++ b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
@@ -17,8 +17,6 @@ Deleted all object stores.
db.createObjectStore('a', {keyPath: 'a'})
db.createObjectStore('b')
db.createObjectStore('c', {autoIncrement: true});
-PASS Exception thrown
-PASS code is webkitIDBDatabaseException.UNKNOWN_ERR
trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
PASS trans.mode is webkitIDBTransaction.READ_WRITE
trans.objectStore('a').put({'a': 0})
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options.html b/LayoutTests/storage/indexeddb/create-object-store-options.html
index 4abb8f6..eacb09d 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options.html
+++ b/LayoutTests/storage/indexeddb/create-object-store-options.html
@@ -44,16 +44,8 @@ function cleaned()
evalAndLog("db.createObjectStore('a', {keyPath: 'a'})");
evalAndLog("db.createObjectStore('b')");
- try {
- // FIXME: This should work in the future.
- debug("db.createObjectStore('c', {autoIncrement: true});");
- db.createObjectStore('c', {autoIncrement: true});
- testFailed('createObjectStore with autoIncrement = true should throw');
- } catch (err) {
- testPassed("Exception thrown");
- code = err.code;
- shouldBe("code", "webkitIDBDatabaseException.UNKNOWN_ERR");
- }
+ debug("db.createObjectStore('c', {autoIncrement: true});");
+ db.createObjectStore('c', {autoIncrement: true});
trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
shouldBe("trans.mode", "webkitIDBTransaction.READ_WRITE");
diff --git a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
index 8d1bba2..bed1d0d 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
+++ b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
@@ -115,10 +115,10 @@ 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
+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
@@ -126,6 +126,7 @@ 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 undefined
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/cursor-delete.html b/LayoutTests/storage/indexeddb/cursor-delete.html
index 9e1ddc3..a3290b9 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete.html
+++ b/LayoutTests/storage/indexeddb/cursor-delete.html
@@ -115,13 +115,14 @@ function deleteObject()
shouldBeNonNull(event.result);
evalAndLog("event.result.delete()");
result = evalAndLog("objectStore.get('myKey1')");
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = verifyObjectDeleted;
+ result.onsuccess = verifyObjectDeleted;
+ result.onerror = unexpectedErrorCallback;
}
function verifyObjectDeleted()
{
- verifyErrorEvent(event);
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
done();
}
diff --git a/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt b/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
new file mode 100644
index 0000000..8e36c96
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
@@ -0,0 +1,183 @@
+Test IndexedDB's IDBObjectStore auto-increment feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('Address Book')
+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.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.
+createObjectStore():
+store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})
+db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})
+db.createObjectStore('PlainOldStore', {autoIncrement: false})
+storeNames = db.objectStoreNames
+PASS store.name is "StoreWithKeyPath"
+PASS store.keyPath is 'id'
+PASS storeNames.contains('StoreWithKeyPath') is true
+PASS storeNames.contains('StoreWithAutoIncrement') is true
+PASS storeNames.contains('PlainOldStore') is true
+PASS storeNames.length is 3
+setVersionCompleted():
+trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+store = trans.objectStore('StoreWithKeyPath')
+Insert in object store with key gen and key path
+store.add({name: 'Lincoln', number: '7012'})
+addLincolnError():
+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 event.code is webkitIDBDatabaseException.UNKNOWN_ERR
+store = trans.objectStore('StoreWithAutoIncrement')
+Insert into object store with key gen using explicit key
+store.add({name: 'Lincoln'}, 1)
+addWithExplicitKeyError():
+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 event.code is webkitIDBDatabaseException.DATA_ERR
+Insert into object store with key gen and no key path
+store.add({name: 'Lincoln', number: '7012'})
+addLincolnSuccess():
+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 1
+store.get(1)
+getLincolnSuccess():
+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.name is "Lincoln"
+PASS event.result.number is "7012"
+store.put({name: 'Abraham', number: '2107'})
+putAbrahamSuccess():
+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 2
+store.get(2)
+getAbrahamSuccess():
+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.name is "Abraham"
+PASS event.result.number is "2107"
+store = trans.objectStore('PlainOldStore')
+Try adding with no key to object store without auto increment.
+store.add({name: 'Adam'})
+addAdamError():
+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 event.code is webkitIDBDatabaseException.DATA_ERR
+store.add({name: 'Adam'}, 1)
+addAdamSuccess():
+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 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/objectstore-autoincrement.html b/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
new file mode 100644
index 0000000..2b44a7a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
@@ -0,0 +1,181 @@
+<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>
+
+description("Test IndexedDB's IDBObjectStore auto-increment feature.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('Address Book')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ debug("openSuccess():");
+ verifySuccessEvent(event);
+ window.db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = setVersionCompleted;
+
+ deleteAllObjectStores(db, createObjectStore);
+}
+
+function createObjectStore()
+{
+ debug("createObjectStore():");
+ window.store = evalAndLog("store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})");
+ evalAndLog("db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})");
+ evalAndLog("db.createObjectStore('PlainOldStore', {autoIncrement: false})");
+ var storeNames = evalAndLog("storeNames = db.objectStoreNames");
+
+ shouldBeEqualToString("store.name", "StoreWithKeyPath");
+ shouldBe("store.keyPath", "'id'");
+ shouldBe("storeNames.contains('StoreWithKeyPath')", "true");
+ shouldBe("storeNames.contains('StoreWithAutoIncrement')", "true");
+ shouldBe("storeNames.contains('PlainOldStore')", "true");
+ shouldBe("storeNames.length", "3");
+
+ // Let the setVersion transaction complete.
+}
+
+function setVersionCompleted()
+{
+ debug("setVersionCompleted():");
+
+ window.trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = done;
+
+ window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
+
+ debug("Insert in object store with key gen and key path");
+ result = evalAndLog("store.add({name: 'Lincoln', number: '7012'})");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addLincolnError;
+}
+
+function addLincolnError()
+{
+ debug("addLincolnError():");
+ verifyErrorEvent(event);
+ // FIXME: This should be implemented, but we make it an error for now.
+ shouldBe("event.code", "webkitIDBDatabaseException.UNKNOWN_ERR");
+
+ window.store = evalAndLog("store = trans.objectStore('StoreWithAutoIncrement')");
+ debug("Insert into object store with key gen using explicit key");
+ result = evalAndLog("store.add({name: 'Lincoln'}, 1)");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addWithExplicitKeyError;
+}
+
+function addWithExplicitKeyError()
+{
+ debug("addWithExplicitKeyError():");
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
+
+ debug("Insert into object store with key gen and no key path");
+ result = evalAndLog("store.add({name: 'Lincoln', number: '7012'})");
+ result.onsuccess = addLincolnSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addLincolnSuccess()
+{
+ debug("addLincolnSuccess():");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "1");
+
+ result = evalAndLog("store.get(1)");
+ result.onsuccess = getLincolnSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getLincolnSuccess()
+{
+ debug("getLincolnSuccess():");
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result.name", "Lincoln");
+ shouldBeEqualToString("event.result.number", "7012");
+
+ result = evalAndLog("store.put({name: 'Abraham', number: '2107'})");
+ result.onsuccess = putAbrahamSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function putAbrahamSuccess()
+{
+ debug("putAbrahamSuccess():");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "2");
+
+ result = evalAndLog("store.get(2)");
+ result.onsuccess = getAbrahamSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getAbrahamSuccess()
+{
+ debug("getAbrahamSuccess():");
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result.name", "Abraham");
+ shouldBeEqualToString("event.result.number", "2107");
+
+ window.store = evalAndLog("store = trans.objectStore('PlainOldStore')");
+ debug("Try adding with no key to object store without auto increment.");
+ result = evalAndLog("store.add({name: 'Adam'})");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addAdamError;
+}
+
+function addAdamError()
+{
+ debug("addAdamError():");
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
+
+ result = evalAndLog("store.add({name: 'Adam'}, 1)");
+ result.onsuccess = addAdamSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addAdamSuccess()
+{
+ debug("addAdamSuccess():");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "1");
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
index 37492db..45f0708 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
@@ -110,10 +110,10 @@ PASS 'onerror' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
-Error event fired:
-PASS 'result' in event is false
-PASS 'code' in event is true
-PASS 'message' in event is true
+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
@@ -121,7 +121,7 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+PASS event.result is undefined
PASS event.source.indexNames.contains('indexName') is false
PASS successfullyParsed is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
index a08f071..f9b1e78 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
@@ -105,14 +105,14 @@ function getValueAgain()
result = evalAndLog("store.get('key')");
verifyResult(result);
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = verifyError;
+ result.onsuccess = verifyNotFound;
+ result.onerror = unexpectedErrorCallback;
}
-function verifyError()
+function verifyNotFound()
{
- verifyErrorEvent(event);
- shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
shouldBeFalse("event.source.indexNames.contains('indexName')");
done();