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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getallkeys.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
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getall.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getallkeys.html
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getallkeys.html b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getallkeys.html
deleted file mode 100644
index 8ca26eac529be274ab0c62da1df9e305668a6f27..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getallkeys.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<!DOCTYPE html>
-<title>IndexedDB: Test IDBObjectStore.getAllKeys.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script>
-
-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'});
- alphabet.forEach(function(letter) {
- store.put({ch: letter});
- });
-
- store = connection.createObjectStore('out-of-line', null);
- alphabet.forEach(function(letter) {
- store.put('value-' + letter, letter);
- });
-
- store = connection.createObjectStore('empty', null);
- };
- };
-}
-
-function createGetAllKeysRequest(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.getAllKeys(range, maxCount) :
- range !== undefined ? store.getAllKeys(range) :
- store.getAllKeys();
- req.onerror = t.unreached_func('getAllKeys request should succeed');
- return req;
-}
-
-doSetup(location.pathname + '-IDBObjectStore.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) {
- assert_array_equals(evt.target.result, ['c']);
- t.done();
- });
- }, 'Single item get');
-
- async_test(function(t) {
- var req = createGetAllKeysRequest(t, 'generated', connection, 3);
- req.onsuccess = t.step_func(function(evt) {
- var data = evt.target.result;
- assert_true(Array.isArray(data));
- assert_array_equals(data, [3]);
- t.done();
- });
- }, 'Single item get (generated key)');
-
- 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 an empty ' +
- 'array');
- t.done();
- });
- }, 'getAllKeys on 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);
- t.done();
- });
- }, 'Get all values');
-
- 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,
- ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']);
- t.done();
- });
- }, 'Test maxCount');
-
- 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,
- ['g', 'h', 'i', 'j', 'k', 'l', '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']);
- 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']);
- 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']);
- 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) {
- var data = evt.target.result;
- assert_true(Array.isArray(data));
- assert_array_equals(data, [4, 5, 6]);
- 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 an ' +
- '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);
- t.done();
- });
- }, 'zero maxCount');
-});
-
-</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-getall.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698