toolkit/content/tests/chrome/window_preferences_beforeaccept.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     3 <!--
     4   XUL Widget Test for preferences window with beforeaccept
     5 -->
     6 <prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     7             title="preferences window"
     8             width="300" height="300"
     9             windowtype="test:preferences"
    10             buttons="accept,cancel"
    11             onbeforeaccept="return beforeAccept();"
    12             onload="onDialogLoad();"
    13 >
    14   <script type="application/javascript">
    15   <![CDATA[
    16     function onDialogLoad() {
    17       var pref = document.getElementById("tests.beforeaccept.dialogShown");
    18       pref.value = true;
    20       // call the onload handler we were passed
    21       window.arguments[0]();
    22     }
    24     function beforeAccept() {
    25       var beforeAcceptPref = document.getElementById("tests.beforeaccept.called");
    26       var oldValue = beforeAcceptPref.value;
    27       beforeAcceptPref.value = true;
    29       return !!oldValue;
    30     }
    31   ]]>
    32   </script>
    34   <prefpane id="sample_pane" label="Sample Prefpane">
    35     <preferences id="sample_preferences">
    36       <preference id="tests.beforeaccept.called"
    37                   name="tests.beforeaccept.called"
    38                   type="bool"/>
    39       <preference id="tests.beforeaccept.dialogShown"
    40                   name="tests.beforeaccept.dialogShown"
    41                   type="bool"/>
    42     </preferences>
    43   </prefpane>
    44   <label>Test Prefpane</label>
    45 </prefwindow>

mercurial