OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src='../resources/testharness.js'></script> | |
3 <script src='../resources/testharnessreport.js'></script> | |
4 <script> | |
5 | |
6 // This test makes sure that the IndexedDB object store and index name setters | |
7 // are only exposed when the experimental Web Platform features flag is set. | |
8 // This is implemented in Blink because our bindings generator does not support | |
9 // separate settings for exposing a property's getter and setter. | |
10 // | |
11 // TODO(crbug.com/644889): Remove this test after we ship IndexedDB v2. | |
12 | |
13 async_test(testCase => { | |
foolip
2016/09/09 08:12:17
FWIW, in upstream web-platform-tests, this seems t
pwnall
2016/09/09 20:50:34
Done.
I used t, though it doesn't mesh well with
foolip
2016/09/09 22:31:17
Right, so it wouldn't work to use only arrow funct
| |
14 const dbName = 'db' + self.location.pathname + '-' + testCase.name; | |
foolip
2016/09/09 08:12:17
Looks like the web platform is missing an mktemp f
pwnall
2016/09/09 20:50:34
What it really needs is a makeAllMyTestsPass() :D
foolip
2016/09/09 22:31:17
Acknowledged.
| |
15 indexedDB.deleteDatabase(dbName); | |
16 const request = indexedDB.open(dbName, 1); | |
17 request.onupgradeneeded = testCase.step_func(event => { | |
18 const database = event.target.result; | |
19 const transaction = event.target.transaction; | |
20 const store = database.createObjectStore('books'); | |
21 store.name = 'renamed_books'; | |
22 assert_equals( | |
23 store.name, 'books', | |
24 'IndexedDB object store renaming should not be web-exposed'); | |
25 const authorIndex = store.createIndex('by_author', 'author'); | |
26 authorIndex.name = 'renamed_by_author'; | |
27 assert_equals( | |
28 authorIndex.name, 'by_author', | |
29 'IndexedDB object store renaming should not be web-exposed'); | |
30 }); | |
31 request.onsuccess = event => { | |
foolip
2016/09/09 08:12:17
testCase.step_func, or even step_func_done if you
pwnall
2016/09/09 20:50:34
Done.
| |
32 const database = event.target.result; | |
33 database.close(); | |
34 testCase.done(); | |
35 }; | |
36 request.onerror = testCase.unreached_func( | |
37 'The IndexedDB request should not receive an error event'); | |
38 }, 'IndexedDB object store and index renaming should not be web-exposed\nThis te st is expected to fail in LayoutTests/webexposed'); | |
39 </script> | |
OLD | NEW |