Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbdatabase_deleteObjectStore4-not_reused.htm

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>IDBDatabase.deleteObjectStore() - the object store is not reused</title>
4 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
5 <script src=../../../resources/testharness.js></script>
6 <script src=../../../resources/testharnessreport.js></script>
7 <script src=support.js></script>
8
9 <script>
10
11 var t = async_test(document.title, {timeout: 10000}),
12 keys = [],
13 open_rq = createdb(t)
14
15 open_rq.onupgradeneeded = function(e) {
16 var db = e.target.result
17
18 var objStore = db.createObjectStore("resurrected", { autoIncrement: true, ke yPath: "k" });
19 objStore.add({k:5}).onsuccess = function(e) { keys.push(e.target.result); }
20 objStore.add({}).onsuccess = function(e) { keys.push(e.target.result); }
21 objStore.createIndex("idx", "i");
22 assert_true(objStore.indexNames.contains("idx"));
23 assert_equals(objStore.keyPath, "k", "keyPath");
24
25 db.deleteObjectStore("resurrected");
26
27 var objStore2 = db.createObjectStore("resurrected", { autoIncrement: true }) ;
28 objStore2.add("Unicorns'R'us").onsuccess = function(e) { keys.push(e.target. result); };
29 assert_false(objStore2.indexNames.contains("idx"), "index exist on new objst ore");
30 assert_equals(objStore2.keyPath, null, "keyPath");
31
32 assert_throws("NotFoundError", function() { objStore2.index("idx"); });
33 }
34
35 open_rq.onsuccess = function(e) {
36 assert_object_equals(keys, [5, 6, 1], "keys");
37 t.done();
38 }
39
40 </script>
41
42 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698