2011-01-21 Yury Semikhatsky <yurys@chromium.org>
[WebKit-https.git] / LayoutTests / http / tests / security / cross-origin-script-window-onerror-redirected.html
1 <html>
2 <body>
3 <p>
4 Test that window.onerror won't reveal any potentially sensitive script content if the latter is loaded from a different domain after a redirect. The test passes if you don't see any data from the linked resource. <a href="https://bugs.webkit.org/show_bug.cgi?id=52903">Bug 52903.</a>
5 </p>
6 <div id="result"></div>
7 <script>
8 if (window.layoutTestController) {
9   layoutTestController.waitUntilDone();
10   layoutTestController.dumpAsText();
11 }
12
13 window.onerror = function(message, url, line) {
14   document.getElementById("result").textContent = "window.onerror message: " + message + " at " + url + ": " + line;
15   if (window.layoutTestController)
16     layoutTestController.notifyDone();
17   return false;
18 }
19 </script>
20 <script src="resources/redir.php?url=http://localhost:8000/security/resources/cross-origin-script.txt">
21 </script>
22 </body>
23 </html>