Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / console-resource-errors.html
1 <html>
2 <head>
3 <script src="console-test.js"></script>
4 <script src="inspector-test.js"></script>
5
6 <script>
7
8 function performActions()
9 {
10     loadXHR();
11     loadIframe();
12 }
13
14 function loadXHR()
15 {
16     var xhr = new XMLHttpRequest();
17     xhr.open("GET","non-existent-xhr", false);
18     xhr.send(null);
19 }
20
21 function loadIframe()
22 {
23     var iframe = document.createElement("iframe");
24     iframe.src = "resources/console-resource-errors-iframe.html";
25     document.body.appendChild(iframe);
26 }
27
28 function test()
29 {
30     InspectorTest.addConsoleSniffer(addMessage, true);
31
32     var messageCount = 0;
33     function addMessage(uiMessage)
34     {
35         if (uiMessage.toString().indexOf("non-existent-iframe") !== -1) {
36             InspectorTest.expandConsoleMessages();
37             InspectorTest.dumpConsoleMessagesWithClasses(true);
38             InspectorTest.completeTest();
39          }
40     }
41
42     InspectorTest.evaluateInPage("performActions()");
43 }
44
45 </script>
46 </head>
47
48 <body onload="runTest()">
49 <p>
50 Tests that errors to load a resource cause error messages to be logged to console.
51 </p>
52 </body>
53 </html>