OLD | NEW |
1 // Copyright (c) 2012 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 function test() | 5 function test() |
6 { | 6 { |
7 if (document.location.hash === '#tab1') { | 7 if (document.location.hash === '#tab1') { |
8 prepareDatabase(function () { doSetVersion(2); }); | 8 prepareDatabase(function () { doSetVersion(2); }); |
9 } else if (document.location.hash === '#tab2') { | 9 } else if (document.location.hash === '#tab2') { |
10 doSetVersion(3); | 10 doSetVersion(3); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 { | 42 { |
43 // Open the database and try a setVersion | 43 // Open the database and try a setVersion |
44 var openreq = window.indexedDB.open('version-change-blocked', version); | 44 var openreq = window.indexedDB.open('version-change-blocked', version); |
45 openreq.onerror = unexpectedErrorCallback; | 45 openreq.onerror = unexpectedErrorCallback; |
46 var upgradeneededComplete = false; | 46 var upgradeneededComplete = false; |
47 openreq.onblocked = function(e) { | 47 openreq.onblocked = function(e) { |
48 result('setVersion(' + version + ') blocked'); | 48 result('setVersion(' + version + ') blocked'); |
49 }; | 49 }; |
50 openreq.onupgradeneeded = function(e) { | 50 openreq.onupgradeneeded = function(e) { |
51 openreq.transaction.oncomplete = function(e2) { | 51 openreq.transaction.oncomplete = function(e2) { |
| 52 db = openreq.result; |
52 result('setVersion(' + version + ') complete'); | 53 result('setVersion(' + version + ') complete'); |
53 }; | 54 }; |
54 }; | 55 }; |
55 } | 56 } |
OLD | NEW |