testing/mochitest/tests/browser/browser_add_task.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/ */
     4 "use strict";
     6 let test1Complete = false;
     7 let test2Complete = false;
     9 function executeWithTimeout() {
    10   let deferred = Promise.defer();
    11   executeSoon(function() {
    12     ok(true, "we get here after a timeout");
    13     deferred.resolve();
    14   });
    15   return deferred.promise;
    16 }
    18 add_task(function asyncTest_no1() {
    19   yield executeWithTimeout();
    20   test1Complete = true;
    21 });
    23 add_task(function asyncTest_no2() {
    24   yield executeWithTimeout();
    25   test2Complete = true;
    26 });
    28 add_task(function() {
    29   ok(test1Complete, "We have been through test 1");
    30   ok(test2Complete, "We have been through test 2");
    31 });

mercurial