| 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 loadScript() | 6 function loadScript() |
| 7 { | 7 { |
| 8 var script = document.createElement('script'); | 8 var script = document.createElement('script'); |
| 9 script.type = "text/javascript"; | 9 script.type = "text/javascript"; |
| 10 script.src = "../resources/source2.js"; | 10 script.src = "../resources/source2.js"; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 InspectorTest.dumpConsoleMessages(); | 22 InspectorTest.dumpConsoleMessages(); |
| 23 InspectorTest.evaluateInPage("loadScript()"); | 23 InspectorTest.evaluateInPage("loadScript()"); |
| 24 | 24 |
| 25 function onScriptAdded(event) | 25 function onScriptAdded(event) |
| 26 { | 26 { |
| 27 if (!event.data.contentURL().endsWith("source2.js")) | 27 if (!event.data.contentURL().endsWith("source2.js")) |
| 28 return; | 28 return; |
| 29 | 29 |
| 30 InspectorTest.addResult("script was added"); | 30 InspectorTest.addResult("script was added"); |
| 31 var message = Console.ConsoleView.instance()._visibleViewMessages[0]; | 31 var message = Console.ConsoleView.instance()._visibleViewMessages[0]; |
| 32 var anchorElement = message.element().querySelector(".console-message-ur
l"); | 32 var anchorElement = message.element().querySelector(".devtools-link"); |
| 33 anchorElement.click(); | 33 anchorElement.click(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 InspectorFrontendHost.openInNewTab = function() | 36 InspectorFrontendHost.openInNewTab = function() |
| 37 { | 37 { |
| 38 InspectorTest.addResult("Failure: Open link in new tab!!"); | 38 InspectorTest.addResult("Failure: Open link in new tab!!"); |
| 39 InspectorTest.completeTest(); | 39 InspectorTest.completeTest(); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 UI.inspectorView._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelect
ed, panelChanged); | 42 UI.inspectorView._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelect
ed, panelChanged); |
| 43 | 43 |
| 44 function panelChanged() | 44 function panelChanged() |
| 45 { | 45 { |
| 46 InspectorTest.addResult("Panel " + UI.inspectorView._tabbedPane._current
Tab.id + " was opened"); | 46 InspectorTest.addResult("Panel " + UI.inspectorView._tabbedPane._current
Tab.id + " was opened"); |
| 47 InspectorTest.completeTest(); | 47 InspectorTest.completeTest(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 } | 51 } |
| 52 | 52 |
| 53 </script> | 53 </script> |
| 54 </head> | 54 </head> |
| 55 | 55 |
| 56 <body onload="runTest()"> | 56 <body onload="runTest()"> |
| 57 <p> | 57 <p> |
| 58 Tests a handling of a click on the link in a message, which had been shown befor
e its originating script was added. | 58 Tests a handling of a click on the link in a message, which had been shown befor
e its originating script was added. |
| 59 </p> | 59 </p> |
| 60 </body> | 60 </body> |
| 61 </html> | 61 </html> |
| OLD | NEW |