dom/xbl/test/test_bug389322.xhtml

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.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2 <!--
michael@0 3 https://bugzilla.mozilla.org/show_bug.cgi?id=389322
michael@0 4 -->
michael@0 5 <head>
michael@0 6 <title>Test for Bug 389322</title>
michael@0 7 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 9 <script>var ctorRan = false;</script>
michael@0 10 <bindings xmlns="http://www.mozilla.org/xbl">
michael@0 11 <binding id="test">
michael@0 12 <implementation>
michael@0 13 <field name="field"><![CDATA[
michael@0 14 (function () {
michael@0 15 try {
michael@0 16 let (x=1) (x);
michael@0 17 var success = true;
michael@0 18 }
michael@0 19 catch (e) { success = false; }
michael@0 20 XPCNativeWrapper.unwrap(window).report("XBL fields", success)
michael@0 21 return ""
michael@0 22 }())
michael@0 23 ]]></field>
michael@0 24 <property name="property">
michael@0 25 <getter><![CDATA[
michael@0 26 try {
michael@0 27 let (x=1) (x);
michael@0 28 var success = true;
michael@0 29 }
michael@0 30 catch (e) { success = false; }
michael@0 31 XPCNativeWrapper.unwrap(window).report("XBL property getters", success)
michael@0 32 return 1
michael@0 33 ]]></getter>
michael@0 34 <setter><![CDATA[
michael@0 35 try {
michael@0 36 let (x=1) (x);
michael@0 37 var success = true
michael@0 38 }
michael@0 39 catch (e) { success = false }
michael@0 40 XPCNativeWrapper.unwrap(window).report("XBL property setters", success)
michael@0 41 return val
michael@0 42 ]]></setter>
michael@0 43 </property>
michael@0 44 <method name="method">
michael@0 45 <body><![CDATA[
michael@0 46 try {
michael@0 47 let (x=1) (x);
michael@0 48 var success = true;
michael@0 49 }
michael@0 50 catch (e) { success = false; }
michael@0 51 XPCNativeWrapper.unwrap(window).report("XBL methods", success)
michael@0 52 ]]></body>
michael@0 53 </method>
michael@0 54 <constructor><![CDATA[
michael@0 55 this.property += 1
michael@0 56 var x = this.field;
michael@0 57 this.method()
michael@0 58 try {
michael@0 59 let (x=1) (x);
michael@0 60 var success = true
michael@0 61 }
michael@0 62 catch (e) { success = false }
michael@0 63 var win = XPCNativeWrapper.unwrap(window);
michael@0 64 win.report("XBL constructors", success)
michael@0 65
michael@0 66 var ev = document.createEvent("Events")
michael@0 67 ev.initEvent("custom", false, false)
michael@0 68 this.dispatchEvent(ev)
michael@0 69 win.ctorRan = true;
michael@0 70 ]]></constructor>
michael@0 71 </implementation>
michael@0 72 <handlers>
michael@0 73 <handler action='
michael@0 74 try {
michael@0 75 let (x=1) (x);
michael@0 76 var success = true
michael@0 77 }
michael@0 78 catch (e) { success = false }
michael@0 79 report("XBL event handlers", success);
michael@0 80 ' event="custom"/>
michael@0 81 </handlers>
michael@0 82 </binding>
michael@0 83 </bindings>
michael@0 84 </head>
michael@0 85 <body>
michael@0 86 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=389322">Mozilla Bug 389322</a>
michael@0 87 <p id="display" style="-moz-binding: url(#test)"></p>
michael@0 88 <div id="content" style="display: none">
michael@0 89
michael@0 90 </div>
michael@0 91 <pre id="test">
michael@0 92 <script class="testbody" type="text/javascript">
michael@0 93 <![CDATA[
michael@0 94
michael@0 95 /** Test for Bug 389322 **/
michael@0 96 SimpleTest.waitForExplicitFinish();
michael@0 97 addLoadEvent(function() {
michael@0 98 is(ctorRan, true, "Constructor should have run");
michael@0 99 });
michael@0 100 addLoadEvent(SimpleTest.finish);
michael@0 101
michael@0 102 function report(testName, success) {
michael@0 103 is(success, true, "JS 1.7 should work in " + testName);
michael@0 104 }
michael@0 105 ]]>
michael@0 106 </script>
michael@0 107 <script type="text/javascript; version=1.7"><![CDATA[
michael@0 108 try {
michael@0 109 let (x=1) (x);
michael@0 110 var success = true;
michael@0 111 }
michael@0 112 catch (e) { success = false; }
michael@0 113 report("HTML script tags with explicit version", success)
michael@0 114 ]]></script>
michael@0 115 <script type="text/javascript"><![CDATA[
michael@0 116 try {
michael@0 117 let (x=1) (x);
michael@0 118 var success = false;
michael@0 119 }
michael@0 120 catch (e) { success = true; }
michael@0 121 is(success, true, "JS 1.7 should not work in versionless HTML script tags");
michael@0 122 ]]></script>
michael@0 123 </pre>
michael@0 124 </body>
michael@0 125 </html>
michael@0 126

mercurial