/toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul

http://github.com/zpao/v8monkey · Unknown · 68 lines · 56 code · 12 blank · 0 comment · 0 complexity · 7ce79989a3f6f49879c246b0f29d45ea MD5 · raw file

  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. -->
  7. <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  8. <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
  9. <window title="Update Wizard pages: update check and billboard (never button test)"
  10. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  11. onload="runTestDefault();">
  12. <script type="application/javascript"
  13. src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  14. <script type="application/javascript"
  15. src="utils.js"/>
  16. <script type="application/javascript">
  17. <![CDATA[
  18. gPrefToCheck = PREF_APP_UPDATE_NEVER_BRANCH + Services.appinfo.version;
  19. const TESTS = [ {
  20. pageid: PAGEID_CHECKING
  21. }, {
  22. pageid: PAGEID_FOUND_BILLBOARD,
  23. extraDelayedCheckFunction: checkRemoteContentState,
  24. expectedRemoteContentState: "loading",
  25. extraDelayedFinishFunction: addRemoteContentLoadListener,
  26. neverButton: true
  27. }, {
  28. pageid: PAGEID_FOUND_BILLBOARD,
  29. extraStartFunction: waitForRemoteContentLoaded,
  30. expectedRemoteContentState: "loaded",
  31. extraDelayedCheckFunction: checkPrefHasUserValue,
  32. prefHasUserValue: false,
  33. neverButton: true,
  34. buttonClick: "extra2"
  35. } ];
  36. function runTest() {
  37. debugDump("entering");
  38. let url = URL_UPDATE + "?showBillboard=1&showNever=1" + getVersionParams();
  39. setUpdateURLOverride(url);
  40. // add the never preference for this version to verify that checking for
  41. // updates clears the preference.
  42. Services.prefs.setBoolPref(gPrefToCheck, true)
  43. gUP.checkForUpdates();
  44. }
  45. function finishTest() {
  46. checkPrefHasUserValue(true);
  47. finishTestDefault();
  48. }
  49. ]]>
  50. </script>
  51. <body xmlns="http://www.w3.org/1999/xhtml">
  52. <p id="display"></p>
  53. <div id="content" style="display: none"></div>
  54. <pre id="test"></pre>
  55. </body>
  56. </window>