Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webexposed/indexeddb-renames-should-not-be-exposed.html |
| diff --git a/third_party/WebKit/LayoutTests/webexposed/indexeddb-renames-should-not-be-exposed.html b/third_party/WebKit/LayoutTests/webexposed/indexeddb-renames-should-not-be-exposed.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..46d35a14d4d8285045d29309c55c5dceabf5eea3 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webexposed/indexeddb-renames-should-not-be-exposed.html |
| @@ -0,0 +1,39 @@ |
| +<!DOCTYPE html> |
| +<script src='../resources/testharness.js'></script> |
| +<script src='../resources/testharnessreport.js'></script> |
| +<script> |
| + |
| +// This test makes sure that the IndexedDB object store and index name setters |
| +// are only exposed when the experimental Web Platform features flag is set. |
| +// This is implemented in Blink because our bindings generator does not support |
| +// separate settings for exposing a property's getter and setter. |
| +// |
| +// TODO(crbug.com/644889): Remove this test after we ship IndexedDB v2. |
| + |
| +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
|
| + 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.
|
| + indexedDB.deleteDatabase(dbName); |
| + const request = indexedDB.open(dbName, 1); |
| + request.onupgradeneeded = testCase.step_func(event => { |
| + const database = event.target.result; |
| + const transaction = event.target.transaction; |
| + const store = database.createObjectStore('books'); |
| + store.name = 'renamed_books'; |
| + assert_equals( |
| + store.name, 'books', |
| + 'IndexedDB object store renaming should not be web-exposed'); |
| + const authorIndex = store.createIndex('by_author', 'author'); |
| + authorIndex.name = 'renamed_by_author'; |
| + assert_equals( |
| + authorIndex.name, 'by_author', |
| + 'IndexedDB object store renaming should not be web-exposed'); |
| + }); |
| + 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.
|
| + const database = event.target.result; |
| + database.close(); |
| + testCase.done(); |
| + }; |
| + request.onerror = testCase.unreached_func( |
| + 'The IndexedDB request should not receive an error event'); |
| +}, 'IndexedDB object store and index renaming should not be web-exposed\nThis test is expected to fail in LayoutTests/webexposed'); |
| +</script> |