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

Side by Side Diff: chrome/test/data/indexeddb/bug_90635.js

Issue 10216002: Fix IDB pyauto tests on cros by preventing restore after restart (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/indexeddb/bug_90635.html ('k') | chrome/test/data/indexeddb/shared.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 window.indexedDB = window.indexedDB || window.webkitIndexedDB;
6 window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;
7
8 function unexpectedErrorCallback()
9 {
10 document.title = 'fail - unexpected error callback';
11 }
12 function unexpectedAbortCallback()
13 {
14 document.title = 'fail - unexpected abort callback';
15 }
16
17 function test() 5 function test()
18 { 6 {
19 if (document.location.hash === '#part1') { 7 if (document.location.hash === '#part1') {
20 testPart1(); 8 testPart1();
21 } else if (document.location.hash === '#part2') { 9 } else if (document.location.hash === '#part2') {
22 testPart2(); 10 testPart2();
23 } else { 11 } else {
24 document.title = 'fail - no hash'; 12 result('fail - unexpected hash');
25 } 13 }
26 } 14 }
27 15
28 function testPart1() 16 function testPart1()
29 { 17 {
30 var delreq = window.indexedDB.deleteDatabase('bug90635'); 18 var delreq = window.indexedDB.deleteDatabase('bug90635');
31 delreq.onerror = unexpectedErrorCallback; 19 delreq.onerror = unexpectedErrorCallback;
32 delreq.onsuccess = function() { 20 delreq.onsuccess = function() {
33 var openreq = window.indexedDB.open('bug90635'); 21 var openreq = window.indexedDB.open('bug90635');
34 openreq.onerror = unexpectedErrorCallback; 22 openreq.onerror = unexpectedErrorCallback;
(...skipping 30 matching lines...) Expand all
65 function test_store(db, msg) { 53 function test_store(db, msg) {
66 var transaction = db.transaction(['store1', 'store2', 'store3'], 54 var transaction = db.transaction(['store1', 'store2', 'store3'],
67 IDBTransaction.READ_ONLY); 55 IDBTransaction.READ_ONLY);
68 var store1 = transaction.objectStore('store1'); 56 var store1 = transaction.objectStore('store1');
69 var store2 = transaction.objectStore('store2'); 57 var store2 = transaction.objectStore('store2');
70 var store3 = transaction.objectStore('store3'); 58 var store3 = transaction.objectStore('store3');
71 59
72 if (store1.keyPath !== null || 60 if (store1.keyPath !== null ||
73 store2.keyPath !== '' || 61 store2.keyPath !== '' ||
74 store3.keyPath !== 'some_path') { 62 store3.keyPath !== 'some_path') {
75 document.title = 'fail - ' + msg; 63 result('fail - ' + msg);
76 } else { 64 } else {
77 document.title = 'pass - ' + msg; 65 result('pass - ' + msg);
78 } 66 }
79 } 67 }
OLDNEW
« no previous file with comments | « chrome/test/data/indexeddb/bug_90635.html ('k') | chrome/test/data/indexeddb/shared.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698