Title: [88715] trunk/LayoutTests
Revision
88715
Author
[email protected]
Date
2011-06-13 15:32:47 -0700 (Mon, 13 Jun 2011)

Log Message

2011-06-13  Mark Pilgrim  <[email protected]>

        Reviewed by Eric Seidel.

        IndexedDB test: Infinity as key
        https://bugs.webkit.org/show_bug.cgi?id=62285

        * storage/indexeddb/key-type-infinity-expected.txt: Added.
        * storage/indexeddb/key-type-infinity.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88714 => 88715)


--- trunk/LayoutTests/ChangeLog	2011-06-13 22:30:02 UTC (rev 88714)
+++ trunk/LayoutTests/ChangeLog	2011-06-13 22:32:47 UTC (rev 88715)
@@ -2,6 +2,16 @@
 
         Reviewed by Eric Seidel.
 
+        IndexedDB test: Infinity as key
+        https://bugs.webkit.org/show_bug.cgi?id=62285
+
+        * storage/indexeddb/key-type-infinity-expected.txt: Added.
+        * storage/indexeddb/key-type-infinity.html: Added.
+
+2011-06-13  Mark Pilgrim  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
         IndexedDB test: odd database names
         https://bugs.webkit.org/show_bug.cgi?id=62322
 

Added: trunk/LayoutTests/storage/indexeddb/key-type-infinity-expected.txt (0 => 88715)


--- trunk/LayoutTests/storage/indexeddb/key-type-infinity-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/key-type-infinity-expected.txt	2011-06-13 22:32:47 UTC (rev 88715)
@@ -0,0 +1,26 @@
+Test IndexedDB key types
+
+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.
+db.createObjectStore('foo');
+test key as infinity
+request = objectStore.add([], Infinity);
+test key as negative infinity
+request = objectStore.add([], -Infinity);
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/key-type-infinity.html (0 => 88715)


--- trunk/LayoutTests/storage/indexeddb/key-type-infinity.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/key-type-infinity.html	2011-06-13 22:32:47 UTC (rev 88715)
@@ -0,0 +1,75 @@
+<!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 types");
+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);
+
+    objectStore = evalAndLog("db.createObjectStore('foo');");
+    debug("test key as infinity");
+    request = evalAndLog("request = objectStore.add([], Infinity);");
+    request._onsuccess_ = testGroup2;
+    request._onerror_ = unexpectedErrorCallback;
+}
+
+function testGroup2()
+{
+    debug("test key as negative infinity");
+    request = evalAndLog("request = objectStore.add([], -Infinity);");
+    request._onsuccess_ = testGroup3;
+    request._onerror_ = unexpectedErrorCallback;
+}
+
+function testGroup3()
+{
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to