content/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginrule.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 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     5 <!--
     6   xml query with binding in rule
     7 -->
     9 <window title="XUL Template Tests" width="500" height="600"
    10         onload="test_template();"
    11         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    12   <script type="application/javascript"
    13           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    15   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
    17   <data id="output">
    18     <label anyid="true" container="true" empty="true" value="Class Reptiles"/>
    19     <label anyid="true" container="true" empty="true" value="Class Birds"/>
    20   </data>
    22 <script src="templates_shared.js"/>
    24 <script>
    25 <![CDATA[
    26 SimpleTest.waitForExplicitFinish();
    28 var testid ="xml query with binding in rule";
    29 var queryType = "xml";
    30 var isTreeBuilder = false;
    31 var needsOpen = false;
    32 var notWorkingYet = false;
    33 var notWorkingYetDynamic = false;
    34 var expectedOutput = document.getElementById("output");
    36 Components.classes["@mozilla.org/consoleservice;1"].
    37            getService(Components.interfaces.nsIConsoleService).reset();
    39 expectLoggedMessages = function()
    40 {
    41   // check log to ensure that two rows have been added
    42   var initialNumber = Number(document.getElementById("root").firstChild.nextSibling.id.substring(3));
    43   expectConsoleMessage('', 'row' + initialNumber, true, true, '1 matching rule 1');
    44   expectConsoleMessage('', 'row' + (initialNumber + 1), true, true, '1 matching rule 1');
    45 }
    47 var changes = [];
    48 ]]>
    49 </script>
    51 <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root"
    52       flags="logging" datasources="animals.xml" querytype="xml" ref=".">
    53 <template>
    54 <query expr="class/name"/>
    55 <rule id="rule">
    56 <binding subject="?" predicate="concat('Class ', text())" object="?text"/>
    57 <action>
    58 <label uri="?" value="?text"/>
    59 </action>
    60 </rule>
    61 </template>
    62 </vbox>
    64 </window>

mercurial