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

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 <?xml version="1.0"?>
     2 <!--
     3 /* Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/publicdomain/zero/1.0/
     5  */
     6 -->
     8 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     9 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
    11 <window title="Test update check with invalid certificate attribute name with no update"
    12         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    13         onload="runTestDefault();">
    14 <script type="application/javascript"
    15         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    16 <script type="application/javascript"
    17         src="utils.js"/>
    19 <script type="application/javascript">
    20 <![CDATA[
    22 const TESTS = [ {
    23   pageid: PAGEID_CHECKING
    24 }, {
    25   pageid: PAGEID_ERROR_EXTRA,
    26   extraDelayedCheckFunction: checkErrorExtraPage,
    27   shouldBeHidden: false,
    28   displayedTextElem: "errorCertCheckNoUpdateLabel",
    29   buttonClick: "finish"
    30 } ];
    32 function runTest() {
    33   debugDump("entering");
    35   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
    36                              "Invalid Attribute Name");
    37   Services.prefs.setIntPref(PREF_APP_UPDATE_CERT_ERRORS, 1);
    38   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
    39   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
    41   let url = URL_HTTPS_UPDATE_XML + "?noUpdates=1";
    42   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
    43   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
    44   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
    46   gUP.checkForUpdates();
    47 }
    49 ]]>
    50 </script>
    52 <body xmlns="http://www.w3.org/1999/xhtml">
    53   <p id="display"></p>
    54   <div id="content" style="display: none"></div>
    55   <pre id="test"></pre>
    56 </body>
    57 </window>

mercurial