Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
1 /**
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
4 */
6 let testGenerator = testSteps();
8 let testResult;
9 let testException;
11 function testFinishedCallback(result, exception)
12 {
13 throw new Error("Bad testFinishedCallback!");
14 }
16 function runTest()
17 {
18 testGenerator.next();
19 }
21 function finishTestNow()
22 {
23 if (testGenerator) {
24 testGenerator.close();
25 testGenerator = undefined;
26 }
27 }
29 function finishTest()
30 {
31 setTimeout(finishTestNow, 0);
32 setTimeout(testFinishedCallback, 0, testResult, testException);
33 }
35 function grabEventAndContinueHandler(event)
36 {
37 testGenerator.send(event);
38 }
40 function errorHandler(event)
41 {
42 throw new Error("indexedDB error, code " + event.target.error.name);
43 }
45 function continueToNextStep()
46 {
47 SimpleTest.executeSoon(function() {
48 testGenerator.next();
49 });
50 }