| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 | 5 |
| 6 <script> | 6 <script> |
| 7 function createScriptsAndRun() | 7 function createScriptsAndRun() |
| 8 { | 8 { |
| 9 eval("window.foo1 = function() {}\n//# sourceURL=script1.js"); | 9 eval("window.foo1 = function() {}\n//# sourceURL=script1.js"); |
| 10 eval("window.foo2 = function() {}\n//# sourceURL=script2.js"); | 10 eval("window.foo2 = function() {}\n//# sourceURL=script2.js"); |
| 11 eval("window.foo3 = function() {}\n//# sourceURL=script3.js"); | 11 eval("window.foo3 = function() {}\n//# sourceURL=script3.js"); |
| 12 eval("window.foo4 = function() {}\n//# sourceURL=script4.js"); | 12 eval("window.foo4 = function() {}\n//# sourceURL=script4.js"); |
| 13 eval("window.foo5 = function() {}\n//# sourceURL=script5.js"); | 13 eval("window.foo5 = function() {}\n//# sourceURL=script5.js"); |
| 14 | 14 |
| 15 runTest(); | 15 runTest(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 function test() | 18 function test() |
| 19 { | 19 { |
| 20 var framesOpened = 0; | 20 var framesOpened = 0; |
| 21 | 21 |
| 22 InspectorTest.runDebuggerTestSuite([ | 22 InspectorTest.runDebuggerTestSuite([ |
| 23 function testSourceFramesCount(next) | 23 function testSourceFramesCount(next) |
| 24 { | 24 { |
| 25 var panel = WebInspector.panels.sources; | 25 var panel = UI.panels.sources; |
| 26 | 26 |
| 27 InspectorTest.showScriptSource("source-frame-count.html", function()
{}); | 27 InspectorTest.showScriptSource("source-frame-count.html", function()
{}); |
| 28 InspectorTest.showScriptSource("script1.js", function() {}); | 28 InspectorTest.showScriptSource("script1.js", function() {}); |
| 29 InspectorTest.showScriptSource("script2.js", function() {}); | 29 InspectorTest.showScriptSource("script2.js", function() {}); |
| 30 InspectorTest.showScriptSource("script3.js", function() {}); | 30 InspectorTest.showScriptSource("script3.js", function() {}); |
| 31 InspectorTest.showScriptSource("script4.js", function() {}); | 31 InspectorTest.showScriptSource("script4.js", function() {}); |
| 32 InspectorTest.showScriptSource("script5.js", reloadThePage); | 32 InspectorTest.showScriptSource("script5.js", reloadThePage); |
| 33 | 33 |
| 34 function reloadThePage() | 34 function reloadThePage() |
| 35 { | 35 { |
| 36 InspectorTest.addResult("Reloading page..."); | 36 InspectorTest.addResult("Reloading page..."); |
| 37 InspectorTest.reloadPage(didReload); | 37 InspectorTest.reloadPage(didReload); |
| 38 function didCreateSourceFrame() | 38 function didCreateSourceFrame() |
| 39 { | 39 { |
| 40 framesOpened++; | 40 framesOpened++; |
| 41 } | 41 } |
| 42 InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "wa
sShown", didCreateSourceFrame, true); | 42 InspectorTest.addSniffer(SourceFrame.SourceFrame.prototype, "was
Shown", didCreateSourceFrame, true); |
| 43 | 43 |
| 44 } | 44 } |
| 45 | 45 |
| 46 function didReload() | 46 function didReload() |
| 47 { | 47 { |
| 48 if (framesOpened > 3) | 48 if (framesOpened > 3) |
| 49 InspectorTest.addResult("Too many frames opened: " + framesO
pened); | 49 InspectorTest.addResult("Too many frames opened: " + framesO
pened); |
| 50 else | 50 else |
| 51 InspectorTest.addResult("Less than 3 frames opened"); | 51 InspectorTest.addResult("Less than 3 frames opened"); |
| 52 InspectorTest.addResult("Visible view: " + panel.visibleView._ui
SourceCode.name()); | 52 InspectorTest.addResult("Visible view: " + panel.visibleView._ui
SourceCode.name()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 } | 79 } |
| 80 </script> | 80 </script> |
| 81 | 81 |
| 82 </head> | 82 </head> |
| 83 | 83 |
| 84 <body onload="createScriptsAndRun()"> | 84 <body onload="createScriptsAndRun()"> |
| 85 <p>Tests that scripts panel does not create too many source frames.</p> | 85 <p>Tests that scripts panel does not create too many source frames.</p> |
| 86 | 86 |
| 87 </body> | 87 </body> |
| 88 </html> | 88 </html> |
| OLD | NEW |