toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <?xml version="1.0"?>
     2 <!--
     3 /* Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/publicdomain/zero/1.0/
     5  */
     7 /**
     8  * Removes files and preferences for previous application update tests in case
     9  * any of them had a fatal error. The test name ensures that it will run after
    10  * all other tests as long as the test naming uses the same format as the
    11  * existing tests.
    12  */
    13 -->
    15 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
    16 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
    18 <window title="Application Update test cleanup"
    19         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    20         onload="runTest();">
    21 <script type="application/javascript"
    22         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    23 <script type="application/javascript"
    24         src="utils.js"/>
    26 <script type="application/javascript">
    27 <![CDATA[
    29 /**
    30  * If the application update tests left behind any of the files it uses it could
    31  * be a very bad thing. The purpose of this test is to prevent that from
    32  * happening.
    33  */
    34 function runTest() {
    35   debugDump("entering");
    37   SimpleTest.waitForExplicitFinish();
    39   closeUpdateWindow();
    41   resetPrefs();
    42   resetFiles();
    43   removeUpdateDirsAndFiles();
    44   reloadUpdateManagerData();
    46   let file = getUpdatesXMLFile(true);
    47   ok(!file.exists(), file.path + " should not exist");
    49   file = getUpdatesXMLFile(false);
    50   ok(!file.exists(), file.path + " should not exist");
    52   let dir = getUpdatesDir();
    54   file = dir.clone();
    55   file.append(FILE_UPDATE_STATUS);
    56   ok(!file.exists(), file.path + " should not exist");
    58   file = dir.clone();
    59   file.append(FILE_UPDATE_ARCHIVE);
    60   ok(!file.exists(), file.path + " should not exist");
    62   let addonPrepDir = Services.dirsvc.get(NS_APP_USER_PROFILE_50_DIR,
    63                                          AUS_Ci.nsILocalFile);
    64   addonPrepDir.append(ADDON_PREP_DIR);
    65   // Not being able to remove the directory used to create the test add-ons
    66   // will not adversely affect subsequent tests so wrap it in a try lock and
    67   // don't test whether its removal was successful.
    68   try {
    69     removeDirRecursive(addonPrepDir);
    70   }
    71   catch (e) {
    72     dump("Unable to remove directory\n" +
    73          "path: " + addonPrepDir.path + "\n" +
    74          "Exception: " + e + "\n");
    75   }
    77   resetAddons(SimpleTest.finish);
    78 }
    80 ]]>
    81 </script>
    83 <body xmlns="http://www.w3.org/1999/xhtml">
    84   <p id="display"></p>
    85   <div id="content" style="display: none"></div>
    86   <pre id="test"></pre>
    87 </body>
    88 </window>

mercurial