1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 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="Update Wizard pages: update check and billboard (never button test)" 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 +gPrefToCheck = PREF_APP_UPDATE_NEVER_BRANCH + Services.appinfo.version; 1.26 + 1.27 +const TESTS = [ { 1.28 + pageid: PAGEID_CHECKING 1.29 +}, { 1.30 + pageid: PAGEID_FOUND_BILLBOARD, 1.31 + extraDelayedCheckFunction: checkRemoteContentState, 1.32 + expectedRemoteContentState: "loading", 1.33 + extraDelayedFinishFunction: addRemoteContentLoadListener, 1.34 + neverButton: true 1.35 +}, { 1.36 + pageid: PAGEID_FOUND_BILLBOARD, 1.37 + extraStartFunction: waitForRemoteContentLoaded, 1.38 + expectedRemoteContentState: "loaded", 1.39 + extraDelayedCheckFunction: checkPrefHasUserValue, 1.40 + prefHasUserValue: false, 1.41 + neverButton: true, 1.42 + buttonClick: "extra2" 1.43 +} ]; 1.44 + 1.45 +function runTest() { 1.46 + debugDump("entering"); 1.47 + 1.48 + let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showNever=1" + 1.49 + getVersionParams(); 1.50 + setUpdateURLOverride(url); 1.51 + 1.52 + // add the never preference for this version to verify that checking for 1.53 + // updates clears the preference. 1.54 + Services.prefs.setBoolPref(gPrefToCheck, true) 1.55 + 1.56 + gUP.checkForUpdates(); 1.57 +} 1.58 + 1.59 +function finishTest() { 1.60 + checkPrefHasUserValue(true); 1.61 + finishTestDefault(); 1.62 +} 1.63 + 1.64 +]]> 1.65 +</script> 1.66 + 1.67 +<body xmlns="http://www.w3.org/1999/xhtml"> 1.68 + <p id="display"></p> 1.69 + <div id="content" style="display: none"></div> 1.70 + <pre id="test"></pre> 1.71 +</body> 1.72 +</window>