summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-27 11:19:51 +0100
committerSteve Block <steveblock@google.com>2010-08-27 11:25:32 +0100
commitd6a678bd9ba533f341e478d39d4d37328e56edc0 (patch)
tree4662494bcd44373b3110e68e94d5824bb3d33bd8 /LayoutTests
parente45c1cdad9627f8b5f50f55c4a9642c1703a616a (diff)
downloadexternal_webkit-d6a678bd9ba533f341e478d39d4d37328e56edc0.zip
external_webkit-d6a678bd9ba533f341e478d39d4d37328e56edc0.tar.gz
external_webkit-d6a678bd9ba533f341e478d39d4d37328e56edc0.tar.bz2
Add missing Indexed DB tests at r65615
These should have been added as part of the merge to WebKit r65615 See http://trac.webkit.org/changeset/65509 Change-Id: I18ff50f54caa6682e8adfc6ae152bce4e94636a9
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/storage/indexeddb/database-description-expected.txt74
-rw-r--r--LayoutTests/storage/indexeddb/database-description.html13
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/database-description.js56
3 files changed, 143 insertions, 0 deletions
diff --git a/LayoutTests/storage/indexeddb/database-description-expected.txt b/LayoutTests/storage/indexeddb/database-description-expected.txt
new file mode 100644
index 0000000..c90d33d
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/database-description-expected.txt
@@ -0,0 +1,74 @@
+Test IDBFactory.open's description parameter.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'indexedDB' in window is true
+PASS indexedDB == null is false
+indexedDB.open('abcd', 'first')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' 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 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.description is "first"
+indexedDB.open('abcd', 'second')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' 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 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS firstDB.description is "first"
+PASS secondDB.description is "second"
+indexedDB.open('abcd')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' 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 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS firstDB.description is "first"
+PASS secondDB.description is "second"
+PASS event.result.description is "second"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/database-description.html b/LayoutTests/storage/indexeddb/database-description.html
new file mode 100644
index 0000000..ca6a4d6
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/database-description.html
@@ -0,0 +1,13 @@
+<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 src="script-tests/database-description.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/script-tests/database-description.js b/LayoutTests/storage/indexeddb/script-tests/database-description.js
new file mode 100644
index 0000000..bb4acba
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/script-tests/database-description.js
@@ -0,0 +1,56 @@
+description("Test IDBFactory.open's description parameter.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ shouldBeTrue("'indexedDB' in window");
+ shouldBeFalse("indexedDB == null");
+
+ result = evalAndLog("indexedDB.open('abcd', 'first')");
+ verifyResult(result);
+ result.onsuccess = firstSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function firstSuccess()
+{
+ verifySuccessEvent(event);
+ window.firstDB = event.result;
+
+ shouldBeEqualToString('event.result.description', 'first');
+
+ result = evalAndLog("indexedDB.open('abcd', 'second')");
+ verifyResult(result);
+ result.onsuccess = secondSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function secondSuccess()
+{
+ verifySuccessEvent(event);
+ window.secondDB = event.result;
+
+ shouldBeEqualToString('firstDB.description', 'first');
+ shouldBeEqualToString('secondDB.description', 'second');
+
+ result = evalAndLog("indexedDB.open('abcd')");
+ verifyResult(result);
+ result.onsuccess = thirdSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function thirdSuccess()
+{
+ verifySuccessEvent(event);
+
+ shouldBeEqualToString('firstDB.description', 'first');
+ shouldBeEqualToString('secondDB.description', 'second');
+ shouldBeEqualToString('event.result.description', 'second');
+
+ done();
+}
+
+test();
+
+var successfullyParsed = true;