toolkit/components/console/tests/test_hugeURIs.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.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
michael@0 3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
michael@0 4 <!--
michael@0 5 https://bugzilla.mozilla.org/show_bug.cgi?id=796179
michael@0 6 -->
michael@0 7 <window title="Mozilla Bug 796179"
michael@0 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 9 onload="RunTest();">
michael@0 10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
michael@0 11
michael@0 12 <!-- Detect severe performance and memory issues when large amounts of errors
michael@0 13 are reported from CSS embedded in a file with a long data URI. Addressed
michael@0 14 by 786108 for issues internal to the style system and by 796179 for issues
michael@0 15 related to the error console. This error console test should finish quickly
michael@0 16 with those patches and run for a very long time or OOM otherwise. -->
michael@0 17
michael@0 18 <!-- test results are displayed in the html:body -->
michael@0 19 <body xmlns="http://www.w3.org/1999/xhtml">
michael@0 20 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=796179"
michael@0 21 target="_blank">Mozilla Bug 796179</a>
michael@0 22 <div id="badSVG" style="max-width: 1; max-height: 1; overflow: hidden"></div>
michael@0 23 </body>
michael@0 24
michael@0 25 <!-- display the error console so we can test its reaction to the test -->
michael@0 26 <iframe id="errorConsoleFrame" height="400" src="chrome://global/content/console.xul"></iframe>
michael@0 27
michael@0 28 <!-- test code -->
michael@0 29 <script type="application/javascript">
michael@0 30 <![CDATA[
michael@0 31 function RunTest()
michael@0 32 {
michael@0 33 // Create the bad SVG and add it to the document.
michael@0 34 var img = new Array;
michael@0 35 img.push('<img src="data:image/svg+xml,');
michael@0 36 img.push(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="300px" height="300px">'));
michael@0 37
michael@0 38 for (var i = 0 ; i < 10000 ; i++)
michael@0 39 img.push(encodeURIComponent('<circle cx="0" cy="0" r="1" style="xxx-invalid-property: 0;"/>'));
michael@0 40
michael@0 41 img.push(encodeURIComponent('</svg>'));
michael@0 42 img.push('" />');
michael@0 43
michael@0 44 document.getElementById('badSVG').innerHTML = img.join('');
michael@0 45
michael@0 46 // We yield control of the thread, allowing the error console to render.
michael@0 47 // If we get control back without timing out or OOMing then the test passed.
michael@0 48 SimpleTest.waitForExplicitFinish();
michael@0 49 SimpleTest.executeSoon(function() {
michael@0 50 // Clean up.
michael@0 51 var elem = document.getElementById('errorConsoleFrame');
michael@0 52 elem.parentNode.removeChild(elem);
michael@0 53 elem = document.getElementById('badSVG');
michael@0 54 elem.parentNode.removeChild(elem);
michael@0 55 elem = null;
michael@0 56
michael@0 57 // Finish the test with a pass.
michael@0 58 ok(true, 'Error console rendered OK.');
michael@0 59 SimpleTest.finish();
michael@0 60 }, 0);
michael@0 61 }
michael@0 62 ]]>
michael@0 63 </script>
michael@0 64 </window>

mercurial