Diff
Modified: trunk/LayoutTests/ChangeLog (106990 => 106991)
--- trunk/LayoutTests/ChangeLog 2012-02-07 22:08:07 UTC (rev 106990)
+++ trunk/LayoutTests/ChangeLog 2012-02-07 22:18:29 UTC (rev 106991)
@@ -1,3 +1,18 @@
+2012-02-07 Eugene Girard <gir...@chromium.org>
+
+ IndexedDB createIndex should fail if options arg is invalid
+ https://bugs.webkit.org/show_bug.cgi?id=58467
+
+ Reviewed by Tony Chang.
+
+ This ticket was fixed as part of https://bugs.webkit.org/show_bug.cgi?id=58471
+ Adding unit tests to verify correct operation.
+
+ * storage/indexeddb/index-basics-expected.txt:
+ * storage/indexeddb/index-basics-workers-expected.txt:
+ * storage/indexeddb/resources/index-basics.js:
+ (deleteExisting):
+
2012-02-07 Julien Chaffraix <jchaffr...@webkit.org>
Unreviewed gardening.
Modified: trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt (106990 => 106991)
--- trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt 2012-02-07 22:08:07 UTC (rev 106990)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt 2012-02-07 22:18:29 UTC (rev 106991)
@@ -14,6 +14,14 @@
store.createIndex('indexName', 'x')
store.createIndex('indexName2', 'y', {unique: false})
store.createIndex('zIndex', 'z', {unique: true})
+PASS indexObject2.unique is false
+PASS indexObject3.unique is true
+Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true)
+PASS Exception was thrown.
+PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Not an object.
+Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string')
+PASS Exception was thrown.
+PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Not an object.
PASS 'name' in indexObject is true
PASS indexObject.name is "indexName"
PASS 'objectStore' in indexObject is true
Modified: trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt (106990 => 106991)
--- trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt 2012-02-07 22:08:07 UTC (rev 106990)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt 2012-02-07 22:18:29 UTC (rev 106991)
@@ -15,6 +15,14 @@
[Worker] store.createIndex('indexName', 'x')
[Worker] store.createIndex('indexName2', 'y', {unique: false})
[Worker] store.createIndex('zIndex', 'z', {unique: true})
+PASS [Worker] indexObject2.unique is false
+PASS [Worker] indexObject3.unique is true
+[Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true)
+PASS [Worker] Exception was thrown.
+PASS [Worker] store.createIndex('failureIndex', 'zzz', true) threw TypeError: Not an object.
+[Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string')
+PASS [Worker] Exception was thrown.
+PASS [Worker] store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Not an object.
PASS [Worker] 'name' in indexObject is true
PASS [Worker] indexObject.name is "indexName"
PASS [Worker] 'objectStore' in indexObject is true
Modified: trunk/LayoutTests/storage/indexeddb/resources/index-basics.js (106990 => 106991)
--- trunk/LayoutTests/storage/indexeddb/resources/index-basics.js 2012-02-07 22:08:07 UTC (rev 106990)
+++ trunk/LayoutTests/storage/indexeddb/resources/index-basics.js 2012-02-07 22:18:29 UTC (rev 106991)
@@ -36,6 +36,10 @@
self.indexObject = evalAndLog("store.createIndex('indexName', 'x')");
self.indexObject2 = evalAndLog("store.createIndex('indexName2', 'y', {unique: false})");
self.indexObject3 = evalAndLog("store.createIndex('zIndex', 'z', {unique: true})");
+ shouldBeFalse("indexObject2.unique");
+ shouldBeTrue("indexObject3.unique");
+ evalAndExpectExceptionClass("store.createIndex('failureIndex', 'zzz', true)", "TypeError");
+ evalAndExpectExceptionClass("store.createIndex('failureIndex', 'zzz', 'string')", "TypeError");
addData();
}