| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="inspector-test.js"></script> | 3 <script src="inspector-test.js"></script> |
| 4 <script src="console-test.js"></script> | 4 <script src="console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function accessFrame() | 6 function accessFrame() |
| 7 { | 7 { |
| 8 // Should fail. | 8 // Should fail. |
| 9 try { | 9 try { |
| 10 var host = frames[0].location.host; | 10 var host = frames[0].location.host; |
| 11 } catch (e) {} | 11 } catch (e) {} |
| 12 | 12 |
| 13 // Should fail. | 13 // Should fail. |
| 14 try { | 14 try { |
| 15 frames[0].location.reload(); | 15 frames[0].location.reload(); |
| 16 } catch (e) {} | 16 } catch (e) {} |
| 17 | 17 |
| 18 // Should fail. | 18 // Should fail. |
| 19 frames[0].postMessage("fail", "http://127.0.0.1:8000"); | 19 frames[0].postMessage("fail", "http://127.0.0.1:8000"); |
| 20 } | 20 } |
| 21 | 21 |
| 22 function test() | 22 function test() |
| 23 { | 23 { |
| 24 var finishAttemptsLeft = 4; | 24 var finishAttemptsLeft = 2; |
| 25 InspectorTest.addConsoleSniffer(maybeFinish, true); | 25 InspectorTest.addConsoleSniffer(maybeFinish, true); |
| 26 ConsoleAgent.setMonitoringXHREnabled(true, step1); | 26 ConsoleAgent.setMonitoringXHREnabled(true, step1); |
| 27 | 27 |
| 28 function step1() | 28 function step1() |
| 29 { | 29 { |
| 30 InspectorTest.evaluateInPage("accessFrame()", maybeFinish); | 30 InspectorTest.evaluateInPage("accessFrame()", maybeFinish); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function maybeFinish() | 33 function maybeFinish() |
| 34 { | 34 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 InspectorTest.completeTest(); | 45 InspectorTest.completeTest(); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 </script> | 48 </script> |
| 49 </head> | 49 </head> |
| 50 <body onload="runTest()"> | 50 <body onload="runTest()"> |
| 51 <p>Tests that cross origin errors are logged with source url and line number.</p
> | 51 <p>Tests that cross origin errors are logged with source url and line number.</p
> |
| 52 <iframe src="http://localhost:8000/inspector/resources/cross-origin-iframe.html"
></iframe> | 52 <iframe src="http://localhost:8000/inspector/resources/cross-origin-iframe.html"
></iframe> |
| 53 </body> | 53 </body> |
| 54 </html> | 54 </html> |
| OLD | NEW |