dom/indexedDB/test/browserHelpers.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 }

mercurial