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<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
11<script src="../../fast/js/resources/js-test-post-function.js"></script>
12<script src="../../fast/js/resources/js-test-pre.js"></script>
13<script src="resources/shared.js"></script>
14</head>
15
16<body>
17<p id="description"></p>
18<div id="console"></div>
19<script>
20
21<!--
22description("Test IndexedDB's creating object store with bad options");
23-->
24if (window.layoutTestController)
25 layoutTestController.waitUntilDone();
26
27function test()
28{
29 shouldBeTrue("'webkitIndexedDB' in window");
30 shouldBeFalse("webkitIndexedDB == null");
31
32 name = window.location.pathname;
33 description = "My Test Database";
34 request = evalAndLog("webkitIndexedDB.open(name, description)");
35 request.onsuccess = openSuccess;
36 request.onerror = unexpectedErrorCallback;
37}
38
39function openSuccess()
40{
41 debug("openSuccess():");
42 db = evalAndLog("db = event.target.result");
43
44 request = evalAndLog("request = db.setVersion('version 1')");
45 request.onsuccess = cleanDatabase;
46 request.onerror = unexpectedErrorCallback;
47}
48
49function cleanDatabase()
50{
51 debug("cleanDatabase():");
52 deleteAllObjectStores(db);
53 evalAndExpectException("db.createObjectStore('foo', 'bar');", "webkitIDBDatabaseException.CONSTRAINT_ERR");
54
55 done();
56}
57
58var successfullyParsed = true;
59
60test();
61
62</script>
63</body>
64</html>
65