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

Side by Side Diff: LayoutTests/storage/indexeddb/mozilla/resources/readonly-transactions.js

Issue 58533003: Move fast/js/resources files to resources. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // original test: 1 // original test:
2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_readonly_tra nsactions.html 2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_readonly_tra nsactions.html
3 // license of original test: 3 // license of original test:
4 // " Any copyright is dedicated to the Public Domain. 4 // " Any copyright is dedicated to the Public Domain.
5 // http://creativecommons.org/publicdomain/zero/1.0/ " 5 // http://creativecommons.org/publicdomain/zero/1.0/ "
6 6
7 if (this.importScripts) { 7 if (this.importScripts) {
8 importScripts('../../../../fast/js/resources/js-test-pre.js'); 8 importScripts('../../../../resources/js-test.js');
9 importScripts('../../resources/shared.js'); 9 importScripts('../../resources/shared.js');
10 } 10 }
11 11
12 description("Test IndexedDB's readonly transactions"); 12 description("Test IndexedDB's readonly transactions");
13 13
14 indexedDBTest(prepareDatabase, setVersionComplete); 14 indexedDBTest(prepareDatabase, setVersionComplete);
15 function prepareDatabase() 15 function prepareDatabase()
16 { 16 {
17 db = event.target.result; 17 db = event.target.result;
18 event.target.transaction.onabort = unexpectedAbortCallback; 18 event.target.transaction.onabort = unexpectedAbortCallback;
19 19
20 osName = "test store"; 20 osName = "test store";
21 objectStore = evalAndLog("objectStore = db.createObjectStore(osName, { autoI ncrement: true });"); 21 objectStore = evalAndLog("objectStore = db.createObjectStore(osName, { autoI ncrement: true });");
22 } 22 }
23 23
24 function setVersionComplete() 24 function setVersionComplete()
25 { 25 {
26 evalAndExpectException("db.transaction([osName]).objectStore(osName).add({}) ;", "0", "'ReadOnlyError'"); 26 evalAndExpectException("db.transaction([osName]).objectStore(osName).add({}) ;", "0", "'ReadOnlyError'");
27 evalAndExpectException("db.transaction(osName).objectStore(osName).add({});" , "0", "'ReadOnlyError'"); 27 evalAndExpectException("db.transaction(osName).objectStore(osName).add({});" , "0", "'ReadOnlyError'");
28 key1 = evalAndLog("key1 = 1;"); 28 key1 = evalAndLog("key1 = 1;");
29 key2 = evalAndLog("key2 = 2;"); 29 key2 = evalAndLog("key2 = 2;");
30 evalAndExpectException("db.transaction([osName]).objectStore(osName).put({}, key1);", "0", "'ReadOnlyError'"); 30 evalAndExpectException("db.transaction([osName]).objectStore(osName).put({}, key1);", "0", "'ReadOnlyError'");
31 evalAndExpectException("db.transaction(osName).objectStore(osName).put({}, k ey2);", "0", "'ReadOnlyError'"); 31 evalAndExpectException("db.transaction(osName).objectStore(osName).put({}, k ey2);", "0", "'ReadOnlyError'");
32 evalAndExpectException("db.transaction([osName]).objectStore(osName).put({}, key1);", "0", "'ReadOnlyError'"); 32 evalAndExpectException("db.transaction([osName]).objectStore(osName).put({}, key1);", "0", "'ReadOnlyError'");
33 evalAndExpectException("db.transaction(osName).objectStore(osName).put({}, k ey1);", "0", "'ReadOnlyError'"); 33 evalAndExpectException("db.transaction(osName).objectStore(osName).put({}, k ey1);", "0", "'ReadOnlyError'");
34 evalAndExpectException("db.transaction([osName]).objectStore(osName).delete( key1);", "0", "'ReadOnlyError'"); 34 evalAndExpectException("db.transaction([osName]).objectStore(osName).delete( key1);", "0", "'ReadOnlyError'");
35 evalAndExpectException("db.transaction(osName).objectStore(osName).delete(ke y2);", "0", "'ReadOnlyError'"); 35 evalAndExpectException("db.transaction(osName).objectStore(osName).delete(ke y2);", "0", "'ReadOnlyError'");
36 finishJSTest(); 36 finishJSTest();
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698