Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html

Issue 352953002: DevTools: properly support targets in LiveEditSupport (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <script src="../../../http/tests/inspector/live-edit-test.js"></script> 5 <script src="../../../http/tests/inspector/live-edit-test.js"></script>
6 <script src="resources/edit-me-breakpoints.js"></script> 6 <script src="resources/edit-me-breakpoints.js"></script>
7 <script> 7 <script>
8 function loadDynamicAnonymousScript() 8 function loadDynamicAnonymousScript()
9 { 9 {
10 function testFunction() 10 function testFunction()
11 { 11 {
12 debugger; 12 debugger;
13 } 13 }
14 var scriptElement = document.createElement("script"); 14 var scriptElement = document.createElement("script");
15 scriptElement.textContent = String(testFunction); 15 scriptElement.textContent = String(testFunction);
16 docuemnt.head.appendChild(scriptElement); 16 docuemnt.head.appendChild(scriptElement);
17 } 17 }
18 18
19 function test() 19 function test()
20 { 20 {
21 var panel = WebInspector.inspectorView.showPanel("sources"); 21 var panel = WebInspector.inspectorView.showPanel("sources");
22 var liveEditSupport = WebInspector.targetManager.targets()[0].debuggerScript Mapping.liveEditSupport();
22 23
23 function pathToFileName(path) 24 function pathToFileName(path)
24 { 25 {
25 return path.substring(path.lastIndexOf("/") + 1); 26 return path.substring(path.lastIndexOf("/") + 1);
26 } 27 }
27 28
28 function dumpBreakpointStorageAndLocations() 29 function dumpBreakpointStorageAndLocations()
29 { 30 {
30 var breakpointManager = WebInspector.breakpointManager; 31 var breakpointManager = WebInspector.breakpointManager;
31 var breakpoints = breakpointManager._storage._setting.get(); 32 var breakpoints = breakpointManager._storage._setting.get();
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 InspectorTest.addResult("Setting breakpoint:"); 334 InspectorTest.addResult("Setting breakpoint:");
334 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr eakpoint.prototype, "_addResolvedLocation", breakpointResolved); 335 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr eakpoint.prototype, "_addResolvedLocation", breakpointResolved);
335 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); 336 InspectorTest.setBreakpoint(sourceFrame, 2, "", true);
336 } 337 }
337 338
338 function breakpointResolved(location) 339 function breakpointResolved(location)
339 { 340 {
340 script = WebInspector.debuggerModel.scriptForId(location.scriptI d); 341 script = WebInspector.debuggerModel.scriptForId(location.scriptI d);
341 342
342 dumpBreakpointStorageAndLocations(); 343 dumpBreakpointStorageAndLocations();
343 liveEditUISourceCode = WebInspector.liveEditSupport.uiSourceCode ForLiveEdit(uiSourceCode); 344 liveEditUISourceCode = liveEditSupport.uiSourceCodeForLiveEdit(u iSourceCode);
344 InspectorTest.showUISourceCode(liveEditUISourceCode, didShowLive EditScriptSource); 345 InspectorTest.showUISourceCode(liveEditUISourceCode, didShowLive EditScriptSource);
345 } 346 }
346 347
347 function didShowLiveEditScriptSource(sourceFrame) 348 function didShowLiveEditScriptSource(sourceFrame)
348 { 349 {
349 liveEditSourceFrame = sourceFrame; 350 liveEditSourceFrame = sourceFrame;
350 InspectorTest.assertTrue(liveEditSourceFrame !== javaScriptSourc eFrame, "Edited and original javaScriptSourceFrames should differ."); 351 InspectorTest.assertTrue(liveEditSourceFrame !== javaScriptSourc eFrame, "Edited and original javaScriptSourceFrames should differ.");
351 InspectorTest.assertTrue(liveEditUISourceCode !== uiSourceCode, "Edited and original uiSourceCodes should differ."); 352 InspectorTest.assertTrue(liveEditUISourceCode !== uiSourceCode, "Edited and original uiSourceCodes should differ.");
352 InspectorTest.addResult("Editing source:"); 353 InspectorTest.addResult("Editing source:");
353 liveEditSourceFrame._textEditor.main = true; 354 liveEditSourceFrame._textEditor.main = true;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 InspectorTest.addResult("Setting breakpoint:"); 396 InspectorTest.addResult("Setting breakpoint:");
396 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr eakpoint.prototype, "_addResolvedLocation", breakpointResolved); 397 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr eakpoint.prototype, "_addResolvedLocation", breakpointResolved);
397 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); 398 InspectorTest.setBreakpoint(sourceFrame, 2, "", true);
398 } 399 }
399 400
400 function breakpointResolved(location) 401 function breakpointResolved(location)
401 { 402 {
402 script = WebInspector.debuggerModel.scriptForId(location.scriptI d); 403 script = WebInspector.debuggerModel.scriptForId(location.scriptI d);
403 404
404 dumpBreakpointStorageAndLocations(); 405 dumpBreakpointStorageAndLocations();
405 liveEditUISourceCode = WebInspector.liveEditSupport.uiSourceCode ForLiveEdit(uiSourceCode); 406 liveEditUISourceCode = liveEditSupport.uiSourceCodeForLiveEdit(u iSourceCode);
406 InspectorTest.showUISourceCode(liveEditUISourceCode, didShowLive EditScriptSource); 407 InspectorTest.showUISourceCode(liveEditUISourceCode, didShowLive EditScriptSource);
407 } 408 }
408 409
409 function didShowLiveEditScriptSource(sourceFrame) 410 function didShowLiveEditScriptSource(sourceFrame)
410 { 411 {
411 liveEditSourceFrame = sourceFrame; 412 liveEditSourceFrame = sourceFrame;
412 InspectorTest.assertTrue(liveEditSourceFrame !== javaScriptSourc eFrame, "Edited and original javaScriptSourceFrames should differ."); 413 InspectorTest.assertTrue(liveEditSourceFrame !== javaScriptSourc eFrame, "Edited and original javaScriptSourceFrames should differ.");
413 InspectorTest.assertTrue(liveEditUISourceCode !== uiSourceCode, "Edited and original uiSourceCodes should differ."); 414 InspectorTest.assertTrue(liveEditUISourceCode !== uiSourceCode, "Edited and original uiSourceCodes should differ.");
414 liveEditSourceFrame._textEditor.main = true; 415 liveEditSourceFrame._textEditor.main = true;
415 InspectorTest.addResult("Editing source:"); 416 InspectorTest.addResult("Editing source:");
(...skipping 19 matching lines...) Expand all
435 ]); 436 ]);
436 }; 437 };
437 438
438 </script> 439 </script>
439 </head> 440 </head>
440 <body onload="runTest()"> 441 <body onload="runTest()">
441 <p>Tests breakpoints are correctly dimmed and restored in JavaScriptSourceFrame during live edit.</p> 442 <p>Tests breakpoints are correctly dimmed and restored in JavaScriptSourceFrame during live edit.</p>
442 <a href="https://bugs.webkit.org/show_bug.cgi?id=99598">Bug 99598</a> 443 <a href="https://bugs.webkit.org/show_bug.cgi?id=99598">Bug 99598</a>
443 </body> 444 </body>
444 </html> 445 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698