idbobjectstore_index.any.js (584B)
1 // META: global=window,worker 2 // META: title=IDBObjectStore.index() - returns an index 3 // META: script=resources/support.js 4 5 'use strict'; 6 7 async_test(t => { 8 let db; 9 10 let open_rq = createdb(t); 11 open_rq.onupgradeneeded = t.step_func(e => { 12 db = e.target.result; 13 14 db.createObjectStore('store').createIndex('index', 'indexedProperty'); 15 }); 16 17 open_rq.onsuccess = t.step_func(e => { 18 let index = 19 db.transaction('store', 'readonly').objectStore('store').index('index'); 20 21 assert_true(index instanceof IDBIndex, 'instanceof IDBIndex'); 22 t.done(); 23 }); 24 });