Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbindex_getAll.html

Issue 1419013007: update-w3c-deps import using blink 83a52878976eaffc8753993a7689c9c178664fba: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbindex_getAll.html
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/index-getall.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbindex_getAll.html
similarity index 78%
rename from third_party/WebKit/LayoutTests/storage/indexeddb/index-getall.html
rename to third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbindex_getAll.html
index 400e1cd27eb031eb850fede083eaf4c7d5f6ac61..29eac72433c0ab7ee5a23f239180d8dd47446dfa 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/index-getall.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbindex_getAll.html
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<title>IndexedDB: Test IDBIndex.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('');
var ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
@@ -68,9 +69,7 @@ function createGetAllRequest(t, storeName, connection, range, maxCount) {
var transaction = connection.transaction(storeName, 'readonly');
var store = transaction.objectStore(storeName);
var index = store.index('test_idx');
- // TODO(cmumford): Simplify once crbug.com/335871 is fixed.
- var req = maxCount !== undefined ? index.getAll(range, maxCount) :
- range !== undefined ? index.getAll(range) : index.getAll();
+ var req = index.getAll(range, maxCount);
req.onerror = t.unreached_func('getAll request should succeed');
return req;
}
@@ -82,8 +81,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), ['c']);
- assert_array_equals(data.map(e => e.upper), ['C']);
+ assert_array_equals(data.map(function(e) { return e.ch; }), ['c']);
+ assert_array_equals(data.map(function(e) { return e.upper; }), ['C']);
t.done();
});
}, 'Single item get');
@@ -102,8 +101,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), alphabet);
- assert_array_equals(data.map(e => e.upper), ALPHABET);
+ assert_array_equals(data.map(function(e) { return e.ch; }), alphabet);
+ assert_array_equals(data.map(function(e) { return e.upper; }), ALPHABET);
t.done();
});
}, 'Get all keys');
@@ -114,8 +113,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), 'abcdefghij'.split(''));
- assert_array_equals(data.map(e => e.upper), 'ABCDEFGHIJ'.split(''));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'abcdefghij'.split(''));
+ assert_array_equals(data.map(function(e) { return e.upper; }), 'ABCDEFGHIJ'.split(''));
t.done();
});
}, 'maxCount=10');
@@ -125,8 +124,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
IDBKeyRange.bound('G', 'M'));
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
- assert_array_equals(data.map(e => e.ch), 'ghijklm'.split(''));
- assert_array_equals(data.map(e => e.upper), 'GHIJKLM'.split(''));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'ghijklm'.split(''));
+ assert_array_equals(data.map(function(e) { return e.upper; }), 'GHIJKLM'.split(''));
t.done();
});
}, 'Get bound range');
@@ -137,8 +136,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), 'ghi'.split(''));
- assert_array_equals(data.map(e => e.upper), 'GHI'.split(''));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'ghi'.split(''));
+ assert_array_equals(data.map(function(e) { return e.upper; }), 'GHI'.split(''));
t.done();
});
}, 'Get bound range with maxCount');
@@ -149,8 +148,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), 'ghij'.split(''));
- assert_array_equals(data.map(e => e.upper), 'GHIJ'.split(''));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'ghij'.split(''));
+ assert_array_equals(data.map(function(e) { return e.upper; }), 'GHIJ'.split(''));
t.done();
});
}, 'Get upper excluded');
@@ -161,8 +160,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), 'hijk'.split(''));
- assert_array_equals(data.map(e => e.upper), 'HIJK'.split(''));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'hijk'.split(''));
+ assert_array_equals(data.map(function(e) { return e.upper; }), 'HIJK'.split(''));
t.done();
});
}, 'Get lower excluded');
@@ -195,8 +194,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), alphabet);
- assert_array_equals(data.map(e => e.upper), ALPHABET);
+ assert_array_equals(data.map(function(e) { return e.ch; }), alphabet);
+ assert_array_equals(data.map(function(e) { return e.upper; }), ALPHABET);
t.done();
});
}, 'maxCount=0');
@@ -207,8 +206,8 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), 'abcdefghijklm'.split(''));
- assert_true(data.every(e => e.half === 'first'));
+ assert_array_equals(data.map(function(e) { return e.ch; }), 'abcdefghijklm'.split(''));
+ assert_true(data.every(function(e) { return e.half === 'first'; }));
t.done();
});
}, 'Retrieve multiEntry key');
@@ -219,12 +218,15 @@ doSetup(location.pathname + '-IDBIndex.getAll', 1, function(evt) {
req.onsuccess = t.step_func(function(evt) {
var data = evt.target.result;
assert_class_string(data, 'Array', 'result should be an array');
- assert_array_equals(data.map(e => e.ch), ['a', 'e', 'i', 'o', 'u']);
+ assert_array_equals(data.map(function(e) { return e.ch; }), ['a', 'e', 'i', 'o', 'u']);
assert_array_equals(data[0].attribs, ['vowel', 'first']);
- assert_true(data.every(e => e.attribs[0] === 'vowel'));
+ assert_true(data.every(function(e) { return e.attribs[0] === 'vowel'; }));
t.done();
});
}, 'Retrieve one key multiple values');
+
+ // Explicit done needed in case async_test body fails synchronously.
+ done();
});
</script>

Powered by Google App Engine
This is Rietveld 408576698