tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / storage / indexeddb / mozilla / create-objectstore-null-name.html
1 <!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 <script src="../../../fast/js/resources/js-test-pre.js"></script>
11 <script src="../resources/shared.js"></script>
12 </head>
13 <body>
14 <p id="description"></p>
15 <div id="console"></div>
16 <script>
17
18 description("Test IndexedDB's creating object store with null name");
19 if (window.layoutTestController)
20     layoutTestController.waitUntilDone();
21
22 function test()
23 {
24     indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
25     shouldBeFalse("indexedDB == null");
26     IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
27     shouldBeFalse("IDBDatabaseException == null");
28
29     name = window.location.pathname;
30     description = "My Test Database";
31     request = evalAndLog("indexedDB.open(name, description)");
32     request.onsuccess = openSuccess;
33     request.onerror = unexpectedErrorCallback;
34 }
35
36 function openSuccess()
37 {
38     db = evalAndLog("db = event.target.result");
39
40     request = evalAndLog("request = db.setVersion('1')");
41     request.onsuccess = cleanDatabase;
42     request.onerror = unexpectedErrorCallback;
43 }
44
45 function cleanDatabase()
46 {
47     deleteAllObjectStores(db);
48
49     objectStore = evalAndLog("objectStore = db.createObjectStore(null);");
50     shouldBe("objectStore.name", "'null'");
51
52     done();
53 }
54
55
56 test();
57
58 </script>
59 </body>
60 </html>
61