| Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_getAll.html
|
| diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getall.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_getAll.html
|
| similarity index 85%
|
| rename from third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getall.html
|
| rename to third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_getAll.html
|
| index fc4f5d11a63acdcdf7f57650e608d465d10f7277..503ee4f3e6f0407fb2ec8191cc42e401cb50616b 100644
|
| --- a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getall.html
|
| +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_getAll.html
|
| @@ -1,8 +1,9 @@
|
| <!DOCTYPE html>
|
| <title>IndexedDB: Test IDBObjectStore.getAll.</title>
|
| -<script src="../../resources/testharness.js"></script>
|
| -<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| <script>
|
| +setup({explicit_done: true});
|
|
|
| var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
|
|
|
| @@ -39,9 +40,7 @@ function doSetup(dbName, dbVersion, onsuccess) {
|
| function createGetAllRequest(t, storeName, connection, range, maxCount) {
|
| var transaction = connection.transaction(storeName, 'readonly');
|
| var store = transaction.objectStore(storeName);
|
| - // TODO(cmumford): Simplify once crbug.com/335871 is closed.
|
| - var req = maxCount !== undefined ? store.getAll(range, maxCount) :
|
| - range !== undefined ? store.getAll(range) : store.getAll();
|
| + var req = store.getAll(range, maxCount);
|
| req.onerror = t.unreached_func('getAll request should succeed');
|
| return req;
|
| }
|
| @@ -81,7 +80,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| var req = createGetAllRequest(t, 'out-of-line', connection);
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result,
|
| - alphabet.map(c => 'value-' + c));
|
| + alphabet.map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Get all values');
|
| @@ -91,8 +90,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| 10);
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result,
|
| - ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
|
| - .map(c => 'value-' + c));
|
| + 'abcdefghij'.split('').map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Test maxCount');
|
| @@ -102,8 +100,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| IDBKeyRange.bound('g', 'm'));
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result,
|
| - ['g', 'h', 'i', 'j', 'k', 'l', 'm']
|
| - .map(c => 'value-' + c));
|
| + 'ghijklm'.split('').map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Get bound range');
|
| @@ -113,7 +110,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| IDBKeyRange.bound('g', 'm'), 3);
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result, ['g', 'h', 'i']
|
| - .map(c => 'value-' + c));
|
| + .map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Get bound range with maxCount');
|
| @@ -123,7 +120,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| IDBKeyRange.bound('g', 'k', false, true));
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result, ['g', 'h', 'i', 'j']
|
| - .map(c => 'value-' + c));
|
| + .map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Get upper excluded');
|
| @@ -133,7 +130,7 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| IDBKeyRange.bound('g', 'k', true, false));
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result, ['h', 'i', 'j', 'k']
|
| - .map(c => 'value-' + c));
|
| + .map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'Get lower excluded');
|
| @@ -144,8 +141,8 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| req.onsuccess = t.step_func(function(evt) {
|
| var data = evt.target.result;
|
| assert_true(Array.isArray(data));
|
| - assert_array_equals(data.map(e => e.ch), ['d', 'e', 'f']);
|
| - assert_array_equals(data.map(e => e.id), [4, 5, 6]);
|
| + assert_array_equals(data.map(function(e) { return e.ch; }), ['d', 'e', 'f']);
|
| + assert_array_equals(data.map(function(e) { return e.id; }), [4, 5, 6]);
|
| t.done();
|
| });
|
| }, 'Get bound range (generated) with maxCount');
|
| @@ -165,10 +162,13 @@ doSetup(location.pathname + '-IDBObjectStore.getAll', 1, function(evt) {
|
| var req = createGetAllRequest(t, 'out-of-line', connection, undefined, 0);
|
| req.onsuccess = t.step_func(function(evt) {
|
| assert_array_equals(evt.target.result,
|
| - alphabet.map(c => 'value-' + c));
|
| + alphabet.map(function(c) { return 'value-' + c; }));
|
| t.done();
|
| });
|
| }, 'zero maxCount');
|
| +
|
| + // Explicit done needed in case async_test body fails synchronously.
|
| + done();
|
| });
|
|
|
| </script>
|
|
|