PageRenderTime 14ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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