1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginrule.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 1.7 + 1.8 +<!-- 1.9 + xml query with binding in rule 1.10 +--> 1.11 + 1.12 +<window title="XUL Template Tests" width="500" height="600" 1.13 + onload="test_template();" 1.14 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.15 + <script type="application/javascript" 1.16 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.17 + 1.18 + <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> 1.19 + 1.20 + <data id="output"> 1.21 + <label anyid="true" container="true" empty="true" value="Class Reptiles"/> 1.22 + <label anyid="true" container="true" empty="true" value="Class Birds"/> 1.23 + </data> 1.24 + 1.25 +<script src="templates_shared.js"/> 1.26 + 1.27 +<script> 1.28 +<![CDATA[ 1.29 +SimpleTest.waitForExplicitFinish(); 1.30 + 1.31 +var testid ="xml query with binding in rule"; 1.32 +var queryType = "xml"; 1.33 +var isTreeBuilder = false; 1.34 +var needsOpen = false; 1.35 +var notWorkingYet = false; 1.36 +var notWorkingYetDynamic = false; 1.37 +var expectedOutput = document.getElementById("output"); 1.38 + 1.39 +Components.classes["@mozilla.org/consoleservice;1"]. 1.40 + getService(Components.interfaces.nsIConsoleService).reset(); 1.41 + 1.42 +expectLoggedMessages = function() 1.43 +{ 1.44 + // check log to ensure that two rows have been added 1.45 + var initialNumber = Number(document.getElementById("root").firstChild.nextSibling.id.substring(3)); 1.46 + expectConsoleMessage('', 'row' + initialNumber, true, true, '1 matching rule 1'); 1.47 + expectConsoleMessage('', 'row' + (initialNumber + 1), true, true, '1 matching rule 1'); 1.48 +} 1.49 + 1.50 +var changes = []; 1.51 +]]> 1.52 +</script> 1.53 + 1.54 +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 1.55 + flags="logging" datasources="animals.xml" querytype="xml" ref="."> 1.56 +<template> 1.57 +<query expr="class/name"/> 1.58 +<rule id="rule"> 1.59 +<binding subject="?" predicate="concat('Class ', text())" object="?text"/> 1.60 +<action> 1.61 +<label uri="?" value="?text"/> 1.62 +</action> 1.63 +</rule> 1.64 +</template> 1.65 +</vbox> 1.66 + 1.67 +</window>