1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../inspector/inspector-test.js"></script>
5 <script src=
"../inspector/debugger-test.js"></script>
7 function appendDynamicScriptElement(src
, content
)
9 var scriptElement
= document
.createElement("script");
11 scriptElement
.src
= src
;
13 scriptElement
.textContent
= content
;
14 document
.head
.appendChild(scriptElement
);
17 function loadScripts()
19 var sourceURLComment
= "\n //# sourceURL=";
20 window
.eval("function fooEval() {}");
21 window
.eval("function fooEvalSourceURL() {}" + sourceURLComment
+ "evalSourceURL.js");
22 appendDynamicScriptElement("", "function fooScriptElementContent1() {}");
23 appendDynamicScriptElement("", "function fooScriptElementContent2() {}");
24 appendDynamicScriptElement("", "function fooScriptElementContentSourceURL() {}" + sourceURLComment
+ "scriptElementContentSourceURL.js");
25 appendDynamicScriptElement("resources/dynamic-script.js");
30 if (window
.testRunner
)
31 testRunner
.waitUntilDone();
35 function scriptLoaded()
37 if (window
.testRunner
)
38 testRunner
.showWebInspector();
44 InspectorTest
.startDebuggerTest(step2
);
48 InspectorTest
.runAfterPendingDispatches(step3
);
53 var panel
= WebInspector
.panels
.sources
;
54 var uiSourceCodes
= WebInspector
.workspace
.uiSourceCodesForProjectType(WebInspector
.projectTypes
.Network
);
55 var urls
= uiSourceCodes
.map(function(uiSourceCode
) { return uiSourceCode
.name(); });
58 var whiteList
= ["debugger-test.js", "dynamic-script.js", "dynamic-scripts.html", "evalSourceURL.js", "inspector-test.js", "scriptElementContentSourceURL.js"];
61 for (var i
= 0; i
< whiteList
.length
; ++i
) {
62 if (url
.indexOf(whiteList
[i
]) !== -1)
68 urls
= urls
.filter(filter
);
70 InspectorTest
.addResult("UISourceCodes:");
71 for (var i
= 0; i
< urls
.length
; ++i
)
72 InspectorTest
.addResult(" " + urls
[i
]);
73 InspectorTest
.completeDebuggerTest();
78 <body onload=
"onload()">
79 <p>Tests that scripts for dynamically added script elements are shown in sources panel if inspector is opened after the scripts were loaded.
</p>
80 <a href=
"https://bugs.webkit.org/show_bug.cgi?id=99324">Bug
99324</a>