summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/examples/doc-idb-run-to-completion.html
blob: a18161f6adc8ec0350e0414a1564a2312518fa90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<script>
function test() {
  var DBOpenRequest = window.indexedDB.open("toDoList", 5);
  DBOpenRequest.onupgradeneeded = function(event) {
    var db = DBOpenRequest.result;
    db.createObjectStore("toDoList");
  };

  DBOpenRequest.onsuccess = function(event) {
    var db = DBOpenRequest.result;
    var transaction = db.transaction(["toDoList"], "readwrite");

    // This will trigger the debugger's onNewScript which will save the
    // microtask queue and perform one or more microtask checkpoints.
    eval("var newScript;");

    // If IDB transactions were processed by the debugger's microtask
    // checkpoints then this store will throw an exception.
    transaction.objectStore("toDoList");

    debugger;
  };
}
    </script>
  </head>
  <body>loading...</body>
</html>