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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/update/tests/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<!--
     1.6 +/* Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.8 + */
     1.9 +-->
    1.10 +
    1.11 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
    1.12 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
    1.13 +
    1.14 +<window title="Test notification with invalid certificate attribute name with no update"
    1.15 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.16 +        onload="runTestDefault();">
    1.17 +<script type="application/javascript"
    1.18 +        src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    1.19 +<script type="application/javascript"
    1.20 +        src="utils.js"/>
    1.21 +
    1.22 +<script type="application/javascript">
    1.23 +<![CDATA[
    1.24 +
    1.25 +const TESTS = [ {
    1.26 +  pageid: PAGEID_ERROR_EXTRA,
    1.27 +  extraDelayedCheckFunction: checkErrorExtraPage,
    1.28 +  shouldBeHidden: false,
    1.29 +  displayedTextElem: "errorCertCheckNoUpdateLabel",
    1.30 +  buttonClick: "finish"
    1.31 +} ];
    1.32 +
    1.33 +function runTest() {
    1.34 +  debugDump("entering");
    1.35 +
    1.36 +  Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
    1.37 +                             "Invalid Attribute Name");
    1.38 +  Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
    1.39 +  Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
    1.40 +
    1.41 +  let url = URL_HTTPS_UPDATE_XML + "?noUpdates=1";
    1.42 +  gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
    1.43 +  debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
    1.44 +  gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
    1.45 +
    1.46 +  errorsPrefObserver.init(PREF_APP_UPDATE_CERT_ERRORS,
    1.47 +                          PREF_APP_UPDATE_CERT_MAXERRORS);
    1.48 +
    1.49 +  gAUS.notify(null);
    1.50 +}
    1.51 +
    1.52 +]]>
    1.53 +</script>
    1.54 +
    1.55 +<body xmlns="http://www.w3.org/1999/xhtml">
    1.56 +  <p id="display"></p>
    1.57 +  <div id="content" style="display: none"></div>
    1.58 +  <pre id="test"></pre>
    1.59 +</body>
    1.60 +</window>

mercurial