summaryrefslogtreecommitdiffstats
path: root/dom/archivereader/test/helpers.js
blob: 3ba4304360495f0799588d8135b2e7cb0448a4a8 (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
31
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

var testGenerator;

function runTest()
{
  SimpleTest.waitForExplicitFinish();

  SpecialPowers.pushPrefEnv({'set': [ ["dom.archivereader.enabled", true] ]}, function() {
    SpecialPowers.createFiles(filesToCreate(),
                              function (files) {
                                testGenerator = testSteps(files);
                                return testGenerator.next();
                              },
                              function (msg) {
                                ok(false, "File creation error: " + msg);
                                finishTest();
                              });
  });
}

function finishTest()
{
  SpecialPowers.popPrefEnv(function() {
    testGenerator.close();
    SimpleTest.finish();
  });
}