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

Unified Diff: LayoutTests/storage/indexeddb/resources/key-type-binary.js

Issue 1087923003: Indexed DB: Adopt BufferSource model for binary keys (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test's shared lib usage Created 5 years, 7 months 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: LayoutTests/storage/indexeddb/resources/key-type-binary.js
diff --git a/LayoutTests/storage/indexeddb/resources/key-type-binary.js b/LayoutTests/storage/indexeddb/resources/key-type-binary.js
deleted file mode 100644
index 1cecebc177015518762a4abf570c398715dc6aa1..0000000000000000000000000000000000000000
--- a/LayoutTests/storage/indexeddb/resources/key-type-binary.js
+++ /dev/null
@@ -1,85 +0,0 @@
-if (this.importScripts) {
- importScripts('../../../fast/js/resources/js-test-pre.js');
- importScripts('shared.js');
-}
-
-description("Test IndexedDB binary keys");
-
-indexedDBTest(prepareDatabase, testValidBinaryKeys);
-function prepareDatabase()
-{
- db = event.target.result;
- event.target.transaction.onabort = unexpectedAbortCallback;
- objectStore = evalAndLog("db.createObjectStore('store');");
- debug("");
-}
-
-function testValidBinaryKeys()
-{
- preamble();
- evalAndLog("trans = db.transaction('store', 'readwrite')");
- evalAndLog("store = trans.objectStore('store')");
-
- var n = 0, cases = [
- "[]",
- "[0]",
- "[0, 0]",
- "[0, 1]",
- "[1]",
- "[1, 0]",
- "[1, 1]",
- "[255]",
- ];
-
- (function testCase() {
- if (!cases.length)
- return;
-
- key = cases.shift();
- value = n++;
-
- debug("");
- request = evalAndLog("store.put(" + JSON.stringify(value) + ", new Uint8Array(" + key + "));");
- request.onerror = unexpectedErrorCallback;
- request.onsuccess = function() {
- shouldBeEqualToString("request.result.toString()", "[object Uint8Array]");
- shouldBe("[].slice.call(request.result).toString()", key + ".toString()");
-
- request = evalAndLog("store.get(new Uint8Array(" + key + "));");
- request.onerror = unexpectedErrorCallback;
- request.onsuccess = function() {
- shouldBe("request.result", JSON.stringify(value));
- testCase();
- };
- };
- }());
-
- trans.oncomplete = testInvalidBinaryKeys;
-}
-
-function testInvalidBinaryKeys()
-{
- preamble();
- evalAndLog("trans = db.transaction('store', 'readwrite')");
- evalAndLog("store = trans.objectStore('store')");
-
- var cases = [
- "new Uint8ClampedArray([1,2,3])",
- "new Uint16Array([1,2,3])",
- "new Uint32Array([1,2,3])",
- "new Int8Array([1,2,3])",
- "new Int16Array([1,2,3])",
- "new Int32Array([1,2,3])",
- "new Float32Array([1,2,3])",
- "new Float64Array([1,2,3])",
- "new Uint8Array([1,2,3]).buffer",
- "new DataView(new Uint8Array([1,2,3]).buffer)"
- ];
-
- cases.forEach(function(testCase) {
- debug("");
- evalAndExpectException("store.put('value', " + testCase + ")", "0", "'DataError'");
- });
-
- finishJSTest();
-}
« no previous file with comments | « LayoutTests/storage/indexeddb/key-type-binary-expected.txt ('k') | Source/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698