summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-04 19:41:06 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-04 19:41:06 +0000
commit914368530ba622ff0117cd34bec058fb0d862155 (patch)
tree6c29459914d1b01ed27fad039d0b982d1dbc32c3 /testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html
parentc5ad76a2875ca5c06c5bbff7b2f2e3ff7b3599c3 (diff)
downloadUXP-914368530ba622ff0117cd34bec058fb0d862155.tar
UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.gz
UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.lz
UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.xz
UXP-914368530ba622ff0117cd34bec058fb0d862155.zip
Issue #439 - Remove web-platform tests from the tree.
This removes a total of 23,936 files we would never use nor have the capacity to properly maintain or keep up-to-date.
Diffstat (limited to 'testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html')
-rw-r--r--testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html207
1 files changed, 0 insertions, 207 deletions
diff --git a/testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html b/testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html
deleted file mode 100644
index 7653a5152..000000000
--- a/testing/web-platform/tests/IndexedDB/idbindex_getAllKeys.html
+++ /dev/null
@@ -1,207 +0,0 @@
-<!DOCTYPE html>
-<title>IndexedDB: Test IDBIndex.getAllKeys.</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script>
-setup({explicit_done: true});
-
-var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
-
-function doSetup(dbName, dbVersion, onsuccess) {
- var delete_request = indexedDB.deleteDatabase(dbName);
- delete_request.onerror = function() {
- assert_unreached('deleteDatabase should not fail');
- };
- delete_request.onsuccess = function(e) {
- var req = indexedDB.open(dbName, dbVersion);
- req.onsuccess = onsuccess;
- req.onerror = function() {
- assert_unreached('open should not fail');
- };
- req.onupgradeneeded = function(evt) {
- var connection = evt.target.result;
-
- var store = connection.createObjectStore('generated',
- {autoIncrement: true, keyPath: 'id'});
- var index = store.createIndex('test_idx', 'upper');
- alphabet.forEach(function(letter) {
- store.put({ch: letter, upper: letter.toUpperCase()});
- });
-
- store = connection.createObjectStore('out-of-line', null);
- index = store.createIndex('test_idx', 'upper');
- alphabet.forEach(function(letter) {
- store.put({ch: letter, upper: letter.toUpperCase()}, letter);
- });
-
- store = connection.createObjectStore('out-of-line-multi', null);
- index = store.createIndex('test_idx', 'attribs', {multiEntry: true});
- alphabet.forEach(function(letter) {
- attrs = [];
- if (['a', 'e', 'i', 'o', 'u'].indexOf(letter) != -1)
- attrs.push('vowel');
- else
- attrs.push('consonant');
- if (letter == 'a')
- attrs.push('first');
- if (letter == 'z')
- attrs.push('last');
- store.put({ch: letter, attribs: attrs}, letter.toUpperCase());
- });
-
- store = connection.createObjectStore('empty', null);
- index = store.createIndex('test_idx', 'upper');
- };
- };
-}
-
-function createGetAllKeysRequest(t, storeName, connection, range, maxCount) {
- var transaction = connection.transaction(storeName, 'readonly');
- var store = transaction.objectStore(storeName);
- var index = store.index('test_idx');
- var req = index.getAllKeys(range, maxCount);
- req.onerror = t.unreached_func('getAllKeys request should succeed');
- return req;
-}
-
-doSetup(location.pathname + '-IDBIndex.getAllKeys', 1, function(evt) {
- var connection = evt.target.result;
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection, 'C');
- req.onsuccess = t.step_func(function(evt) {
- var data = evt.target.result;
- assert_array_equals(evt.target.result, ['c']);
- t.done();
- });
- }, 'Single item get');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'empty', connection);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, [],
- 'getAllKeys() on empty object store should return empty array');
- t.done();
- });
- }, 'Empty object store');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, alphabet,
- 'getAllKeys() should return a..z');
- t.done();
- });
- }, 'Get all keys');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'generated', connection);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26],
- 'getAllKeys() should return 1..26');
- t.done();
- });
- }, 'Get all generated keys');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection, undefined,
- 10);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- 'abcdefghij'.split(''),
- 'getAllKeys() should return a..j');
- t.done();
- });
- }, 'maxCount=10');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection,
- IDBKeyRange.bound('G', 'M'));
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- 'ghijklm'.split(''),
- 'getAllKeys() should return g..m');
- t.done();
- });
- }, 'Get bound range');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection,
- IDBKeyRange.bound('G', 'M'), 3);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- ['g', 'h', 'i'],
- 'getAllKeys() should return g..i');
- t.done();
- });
- }, 'Get bound range with maxCount');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection,
- IDBKeyRange.bound('G', 'K', false, true));
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- ['g', 'h', 'i', 'j'],
- 'getAllKeys() should return g..j');
- t.done();
- });
- }, 'Get upper excluded');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection,
- IDBKeyRange.bound('G', 'K', true, false));
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result,
- ['h', 'i', 'j', 'k'],
- 'getAllKeys() should return h..k');
- t.done();
- });
- }, 'Get lower excluded');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'generated',
- connection, IDBKeyRange.bound(4, 15), 3);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, [],
- 'getAllKeys() should return []');
- t.done();
- });
- }, 'Get bound range (generated) with maxCount');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line',
- connection, "Doesn't exist");
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, [],
- 'getAllKeys() using a nonexistent key should return empty array');
- t.done();
- req.onerror = t.unreached_func('getAllKeys request should succeed');
- });
- }, 'Non existent key');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line', connection,
- undefined, 0);
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, alphabet,
- 'getAllKeys() should return a..z');
- t.done();
- });
- }, 'maxCount=0');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'out-of-line-multi', connection,
- 'vowel');
- req.onsuccess = t.step_func(function(evt) {
- assert_array_equals(evt.target.result, ['A','E','I','O','U'])
- t.done();
- });
- req.onerror = t.unreached_func('getAllKeys request should succeed');
- }, 'Retrieve multiEntry keys');
-
- // Explicit done needed in case async_test body fails synchronously.
- done();
-});
-
-</script>