blob: 7a07cd64ed2f10069ba0b24a8cedecfd2e497b11 [file] [log] [blame]
commit-queue@webkit.org45c0dad2011-05-20 18:30:35 +00001<!DOCTYPE html>
2<!--
3 original test: http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_create_objectStore.html
4 license of original test:
5 " Any copyright is dedicated to the Public Domain.
6 http://creativecommons.org/publicdomain/zero/1.0/ "
7-->
8<html>
9<head>
10<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
11<script src="../../../fast/js/resources/js-test-pre.js"></script>
commit-queue@webkit.org45c0dad2011-05-20 18:30:35 +000012<script src="../resources/shared.js"></script>
13</head>
14<body>
15<p id="description"></p>
16<div id="console"></div>
17<script>
18
19description("Test IndexedDB's creating object store with null name");
20if (window.layoutTestController)
21 layoutTestController.waitUntilDone();
22
23function test()
24{
25 indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
26 shouldBeFalse("indexedDB == null");
27 IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
28 shouldBeFalse("IDBDatabaseException == null");
29
30 name = window.location.pathname;
31 description = "My Test Database";
32 request = evalAndLog("indexedDB.open(name, description)");
33 request.onsuccess = openSuccess;
34 request.onerror = unexpectedErrorCallback;
35}
36
37function openSuccess()
38{
39 db = evalAndLog("db = event.target.result");
40
41 request = evalAndLog("request = db.setVersion('1')");
42 request.onsuccess = cleanDatabase;
43 request.onerror = unexpectedErrorCallback;
44}
45
46function cleanDatabase()
47{
48 deleteAllObjectStores(db);
49
commit-queue@webkit.orgada248d2011-06-22 18:03:33 +000050 objectStore = evalAndLog("objectStore = db.createObjectStore(null);");
51 shouldBe("objectStore.name", "'null'");
commit-queue@webkit.org45c0dad2011-05-20 18:30:35 +000052
53 done();
54}
55
56var successfullyParsed = true;
57
58test();
59
60</script>
61</body>
62</html>
63