testing/xpcshell/example/unit/test_do_get_tempdir.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/xpcshell/example/unit/test_do_get_tempdir.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:set ts=2 sw=2 sts=2 et: */
     1.6 +/* Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.8 +
     1.9 +/* This tests that do_get_tempdir returns a directory that we can write to. */
    1.10 +
    1.11 +const Ci = Components.interfaces;
    1.12 +
    1.13 +function run_test() {
    1.14 +  let tmpd = do_get_tempdir();
    1.15 +  do_check_true(tmpd.exists());
    1.16 +  tmpd.append("testfile");
    1.17 +  tmpd.create(Ci.nsIFile.NORMAL_FILE_TYPE, 600);
    1.18 +  do_check_true(tmpd.exists());
    1.19 +}

mercurial