Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/not-opener.html

Issue 2042043002: Silencing console messages during some layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replicate-can-open-windows
Patch Set: Added verification of # of opened windows at the end of not-opener test. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 if (window.testRunner) { 4 if (window.testRunner) {
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 testRunner.setDumpConsoleMessages(false);
6 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
7 testRunner.setCanOpenWindows(); 8 testRunner.setCanOpenWindows();
8 } 9 }
9 10
10 function log(msg) { 11 function log(msg) {
11 var div = document.createElement("div"); 12 var div = document.createElement("div");
12 div.appendChild(document.createTextNode(msg)); 13 div.appendChild(document.createTextNode(msg));
13 document.getElementById("console").appendChild(div); 14 document.getElementById("console").appendChild(div);
14 } 15 }
15 16
16 var readyCount = 0; 17 var readyCount = 0;
17 window.addEventListener("message", function(e) { 18 window.addEventListener("message", function(e) {
18 if (e.data == "ready") { 19 if (e.data == "ready") {
19 ++readyCount; 20 ++readyCount;
20 if (readyCount == 2) { 21 if (readyCount == 2) {
21 helper.postMessage("set", "*"); 22 helper.postMessage("set", "*");
22 } 23 }
23 } else if (e.data == "pass") { 24 } else if (e.data == "pass") {
24 target.document.body.innerHTML = "Should have navigated this window. It should be still be same-origin."; 25 target.document.body.innerHTML = "Should have navigated this window. It should be still be same-origin.";
25 log("PASS"); 26 log("PASS");
27 log("There are currently " + testRunner.windowCount() + " windows opened .");
26 target.close(); 28 target.close();
27 helper.postMessage("cleanup", "*"); 29 helper.postMessage("cleanup", "*");
28 } else if (e.data == "done") { 30 } else if (e.data == "done") {
29 helper.close(); 31 helper.close();
30 if (window.testRunner) 32 if (window.testRunner)
31 testRunner.notifyDone(); 33 testRunner.notifyDone();
32 } 34 }
33 }, false); 35 }, false);
34 36
35 window.onload = function() { 37 window.onload = function() {
36 target = window.open("resources/ready.html", "targetWindow"); 38 target = window.open("resources/ready.html", "targetWindow");
37 helper = window.open("http://localhost:8000/security/frameNavigation/resourc es/not-opener-helper.html"); 39 helper = window.open("http://localhost:8000/security/frameNavigation/resourc es/not-opener-helper.html");
38 } 40 }
39 </script> 41 </script>
40 </head> 42 </head>
41 <body> 43 <body>
42 <div id="console"></div> 44 <div id="console"></div>
43 </body> 45 </body>
44 </html> 46 </html>
45 47
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698