test_bug704320_policyset2.html (1324B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 This checks if the right policies are applied from a given string (including whitespace, invalid policy strings, etc). It doesn't do a complete check for all load types; that's done in another test. 5 https://bugzilla.mozilla.org/show_bug.cgi?id=704320 6 --> 7 8 <head> 9 <meta charset="utf-8"> 10 <title>Test policies for Bug 704320</title> 11 <script src="/tests/SimpleTest/SimpleTest.js"></script> 12 <script type="application/javascript" src="referrerHelper.js"></script> 13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 14 15 <script type="application/javascript"> 16 17 SimpleTest.waitForExplicitFinish(); 18 var advance = function() { tests.next(); }; 19 20 /** 21 * This is the main test routine -- serialized by use of a generator. 22 * It resets the counter, then performs two tests in sequence using 23 * the same iframe. 24 */ 25 var tests = (function*() { 26 var iframe = document.getElementById("testframe"); 27 const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test"; 28 29 yield resetCounter(); 30 yield iframe.src = sjs + "&policy=" + escape(' \f\r\n\t '); 31 yield checkIndividualResults("whitespace only policy", ["full"]); 32 33 // complete. 34 SimpleTest.finish(); 35 })(); 36 37 </script> 38 </head> 39 40 <body onload="tests.next();"> 41 <iframe id="testframe"></iframe> 42 43 </body> 44 </html>