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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_deleted.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>Attempting to use deleted IDBObjectStore</title>
4 <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html# object-store">
5 <link rel=assert title="InvalidStateError Occurs if a request is made on a sourc e object that has been deleted or removed.">
6 <link rel=author href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
7 <script src=../../../resources/testharness.js></script>
8 <script src=../../../resources/testharnessreport.js></script>
9 <script src=support.js></script>
10
11 <script>
12 var db,
13 add_success = false,
14 t = async_test(document.title, {timeout: 10000})
15
16 var open_rq = createdb(t);
17 open_rq.onupgradeneeded = function(e) {
18 db = e.target.result;
19
20 var objStore = db.createObjectStore("store", { autoIncrement: true });
21 assert_equals(db.objectStoreNames[0], "store", "objectStoreNames");
22
23 var rq_add = objStore.add(1);
24 rq_add.onsuccess = function() { add_success = true; };
25 rq_add.onerror = fail(t, 'rq_add.error');
26
27 objStore.createIndex("idx", "a");
28 db.deleteObjectStore("store");
29 assert_equals(db.objectStoreNames.length, 0, "objectStoreNames.length af ter delete");
30
31 assert_throws(null, function() { objStore.add(2); });
32 assert_throws(null, function() { objStore.put(3); });
33 assert_throws(null, function() { objStore.get(1); });
34 assert_throws(null, function() { objStore.clear(); });
35 assert_throws(null, function() { objStore.count(); });
36 assert_throws(null, function() { objStore.delete(1); });
37 assert_throws(null, function() { objStore.openCursor(); });
38 assert_throws(null, function() { objStore.index("idx"); });
39 assert_throws(null, function() { objStore.deleteIndex("idx"); });
40 assert_throws(null, function() { objStore.createIndex("idx2", "a"); });
41 }
42
43 open_rq.onsuccess = function() {
44 assert_true(add_success, "First add was successful");
45 t.done();
46 }
47 </script>
48
49 <div id=log></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698