Title: [88362] trunk/LayoutTests
- Revision
- 88362
- Author
- [email protected]
- Date
- 2011-06-08 11:15:01 -0700 (Wed, 08 Jun 2011)
Log Message
2011-06-08 Mark Pilgrim <[email protected]>
Reviewed by Tony Chang.
IndexedDB test: key paths as arrays
https://bugs.webkit.org/show_bug.cgi?id=62291
* storage/indexeddb/keypath-as-array-expected.txt: Added.
* storage/indexeddb/keypath-as-array.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (88361 => 88362)
--- trunk/LayoutTests/ChangeLog 2011-06-08 18:12:15 UTC (rev 88361)
+++ trunk/LayoutTests/ChangeLog 2011-06-08 18:15:01 UTC (rev 88362)
@@ -1,3 +1,13 @@
+2011-06-08 Mark Pilgrim <[email protected]>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB test: key paths as arrays
+ https://bugs.webkit.org/show_bug.cgi?id=62291
+
+ * storage/indexeddb/keypath-as-array-expected.txt: Added.
+ * storage/indexeddb/keypath-as-array.html: Added.
+
2011-05-25 Xiaomei Ji <[email protected]>
Reviewed by Ryosuke Niwa.
Added: trunk/LayoutTests/storage/indexeddb/keypath-as-array-expected.txt (0 => 88362)
--- trunk/LayoutTests/storage/indexeddb/keypath-as-array-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/keypath-as-array-expected.txt 2011-06-08 18:15:01 UTC (rev 88362)
@@ -0,0 +1,28 @@
+Test IndexedDB key path corner cases
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;
+PASS indexedDB == null is false
+IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;
+PASS IDBDatabaseException == null is false
+IDBCursor = window.IDBCursor || window.webkitIDBCursor;
+PASS IDBCursor == null is false
+IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
+PASS IDBKeyRange == null is false
+indexedDB.open(name, description)
+db = event.target.result
+request = db.setVersion('1')
+Deleted all object stores.
+test keypath as array
+db.createObjectStore('foo', {keyPath: ['foo'], autoIncrement: true})
+db.createObjectStore('foobar', {keyPath: ['foo', 'bar'], autoIncrement: true})
+db.createObjectStore('empty', {keyPath: [], autoIncrement: true})
+db.createObjectStore('nested', {keyPath: [[]], autoIncrement: true})
+db.createObjectStore('arrayofempty', {keyPath: ['', ''], autoIncrement: true})
+db.createObjectStore('arrayoffloat', {keyPath: [1.0, 2.0], autoIncrement: true})
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/indexeddb/keypath-as-array.html (0 => 88362)
--- trunk/LayoutTests/storage/indexeddb/keypath-as-array.html (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/keypath-as-array.html 2011-06-08 18:15:01 UTC (rev 88362)
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB key path corner cases");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
+ shouldBeFalse("indexedDB == null");
+ IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
+ shouldBeFalse("IDBDatabaseException == null");
+ IDBCursor = evalAndLog("IDBCursor = window.IDBCursor || window.webkitIDBCursor;");
+ shouldBeFalse("IDBCursor == null");
+ IDBKeyRange = evalAndLog("IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;");
+ shouldBeFalse("IDBKeyRange == null");
+
+ name = window.location.pathname;
+ description = "My Test Database";
+ request = evalAndLog("indexedDB.open(name, description)");
+ request._onsuccess_ = openSuccess;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ db = evalAndLog("db = event.target.result");
+
+ request = evalAndLog("request = db.setVersion('1')");
+ request._onsuccess_ = testGroup1;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function testGroup1()
+{
+ deleteAllObjectStores(db);
+
+ debug("test keypath as array");
+ evalAndLog("db.createObjectStore('foo', {keyPath: ['foo'], autoIncrement: true})");
+ evalAndLog("db.createObjectStore('foobar', {keyPath: ['foo', 'bar'], autoIncrement: true})");
+ evalAndLog("db.createObjectStore('empty', {keyPath: [], autoIncrement: true})");
+ evalAndLog("db.createObjectStore('nested', {keyPath: [[]], autoIncrement: true})");
+ evalAndLog("db.createObjectStore('arrayofempty', {keyPath: ['', ''], autoIncrement: true})");
+ evalAndLog("db.createObjectStore('arrayoffloat', {keyPath: [1.0, 2.0], autoIncrement: true})");
+ done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes