Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/storage/indexeddb/resources/rename-common.js |
| diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/rename-common.js b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/rename-common.js |
| index ac3ff5996e7fd997387b0811f51f863d1f8d1515..c24a9fb92bd2c30d08a428086a72a6f3d7549b5b 100644 |
| --- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/rename-common.js |
| +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/rename-common.js |
| @@ -75,6 +75,19 @@ const createDatabase = (testCase, setupCallback) => { |
| migrateDatabase(testCase, 1, setupCallback)); |
| }; |
| +// Opens an IndexedDB database without performing schema changes. |
| +// |
| +// The given version number must match the database's current version. |
| +// |
| +// Returns a promise that resolves to an IndexedDB database. The caller must |
| +// close the database. |
| +const openDatabase = (testCase, version) => { |
| + const request = indexedDB.open(databaseName(testCase), version); |
|
jsbell
2016/09/16 18:17:28
Maybe add onupgradeneeded = testCase.unreached_fun
pwnall
2016/09/17 01:34:21
I thought EventWatcher is supposed to reject its p
|
| + const eventWatcher = requestWatcher(testCase, request); |
| + return eventWatcher.wait_for('success').then( |
| + event => event.target.result); |
| +} |
| + |
| // The data in the 'books' object store records in the first example of the |
| // IndexedDB specification. |
| const BOOKS_RECORD_DATA = [ |