Changeset 97613 in webkit
- Timestamp:
- Oct 17, 2011 6:39:06 AM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r97609 r97613 1 2011-10-17 Yury Semikhatsky <yurys@chromium.org> 2 3 [Chromium] Web Inspector: don't check for debugger pause details in interactive ui tests 4 https://bugs.webkit.org/show_bug.cgi?id=70228 5 6 Removed debugger pause details validation. The only check left is that debugger pause event is fired when expected. 7 8 Reviewed by Pavel Feldman. 9 10 * src/js/Tests.js: 11 (.TestSuite.prototype.testPauseWhenLoadingDevTools): 12 (.TestSuite.prototype.testPauseWhenScriptIsRunning.didEvaluateInConsole): 13 (.TestSuite.prototype.testPauseWhenScriptIsRunning.testScriptPause): 14 (.TestSuite.prototype.testPauseWhenScriptIsRunning): 15 (.TestSuite.prototype.testPauseInSharedWorkerInitialization): 16 (.TestSuite.prototype._waitForScriptPause): 17 1 18 2011-10-17 Mikhail Naganov <mnaganov@chromium.org> 2 19 -
trunk/Source/WebKit/chromium/src/js/Tests.js
r97266 r97613 355 355 { 356 356 this.showPanel("scripts"); 357 var test = this;358 359 var expectations = {360 functionsOnStack: ["callDebugger"],361 lineNumber: 8,362 lineText: " debugger;"363 };364 365 357 366 358 // Script execution can already be paused. 367 if (WebInspector.currentPanel().paused) { 368 var callFrame = WebInspector.currentPanel()._presentationModel.selectedCallFrame; 369 this.assertEquals(expectations.functionsOnStack[0], callFrame._callFrame.functionName); 370 var callbackInvoked = false; 371 this._checkSourceFrameWhenLoaded(expectations, function() { 372 callbackInvoked = true; 373 if (test.controlTaken_) 374 test.releaseControl(); 375 }); 376 if (!callbackInvoked) { 377 test.takeControl(); 378 } 359 if (WebInspector.debuggerModel.debuggerPausedDetails) 379 360 return; 380 } 381 382 this._waitForScriptPause( 383 { 384 functionsOnStack: ["callDebugger"], 385 lineNumber: 8, 386 lineText: " debugger;" 387 }, 388 function() { 389 test.releaseControl(); 390 }); 361 362 this._waitForScriptPause(this.releaseControl.bind(this)); 391 363 this.takeControl(); 392 364 }; … … 398 370 { 399 371 this.showPanel("scripts"); 400 var test = this; 401 402 test.evaluateInConsole_( 372 373 this.evaluateInConsole_( 403 374 'setTimeout("handleClick()" , 0)', 404 function(resultText) { 405 test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); 406 testScriptPauseAfterDelay(); 407 }); 408 409 // Wait for some time to make sure that inspected page is running the 410 // infinite loop. 411 function testScriptPauseAfterDelay() { 412 setTimeout(testScriptPause, 300); 375 didEvaluateInConsole.bind(this)); 376 377 function didEvaluateInConsole(resultText) { 378 this.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); 379 // Wait for some time to make sure that inspected page is running the 380 // infinite loop. 381 setTimeout(testScriptPause.bind(this), 300); 413 382 } 414 383 … … 418 387 WebInspector.panels.scripts.pauseButton.click(); 419 388 420 test._waitForScriptPause( 421 { 422 functionsOnStack: ["handleClick", ""], 423 lineNumber: 5, 424 lineText: " while(true) {" 425 }, 426 function() { 427 test.releaseControl(); 428 }); 389 this._waitForScriptPause(this.releaseControl.bind(this)); 429 390 } 430 391 … … 586 547 if (WebInspector.debuggerModel.debuggerPausedDetails) 587 548 return; 588 this._waitForScriptPause( 589 { 590 functionsOnStack: [""], 591 lineNumber: 1, 592 lineText: "debugger;" 593 }, 594 this.releaseControl.bind(this)); 549 this._waitForScriptPause(this.releaseControl.bind(this)); 595 550 this.takeControl(); 596 551 }; … … 685 640 686 641 /** 687 * Checks current execution line against expectations.688 * @param {WebInspector.SourceFrame} sourceFrame689 * @param {number} lineNumber Expected line number690 * @param {string} lineContent Expected line text691 */692 TestSuite.prototype._checkExecutionLine = function(sourceFrame, lineNumber, lineContent)693 {694 this.assertEquals(lineNumber, sourceFrame._executionLineNumber + 1, "Unexpected execution line number.");695 this.assertEquals(lineContent, sourceFrame._textModel.line(lineNumber - 1), "Unexpected execution line text.");696 }697 698 699 /**700 642 * Checks that all expected scripts are present in the scripts list 701 643 * in the Scripts panel. … … 726 668 /** 727 669 * Waits for script pause, checks expectations, and invokes the callback. 728 * @param {Object} expectations Dictionary of expectations729 670 * @param {function():void} callback 730 671 */ 731 TestSuite.prototype._waitForScriptPause = function( expectations,callback)672 TestSuite.prototype._waitForScriptPause = function(callback) 732 673 { 733 674 function pauseListener(event) { 734 var callFrames = event.data.callFrames;735 var functionsOnStack = [];736 for (var i = 0; i < callFrames.length; i++)737 functionsOnStack.push(callFrames[i].functionName);738 739 this.assertEquals(expectations.functionsOnStack.join(","), functionsOnStack.join(","), "Unexpected stack.");740 741 // Check that execution line where the script is paused is742 // expected one.743 this._checkSourceFrameWhenLoaded(expectations, callback);744 745 675 WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this); 676 callback(); 746 677 } 747 678 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this); 748 };749 750 751 /**752 * Waits for current source frame to load, checks expectations, and invokes753 * the callback.754 * @param {Object} expectations Dictionary of expectations755 * @param {function():void} callback756 */757 TestSuite.prototype._checkSourceFrameWhenLoaded = function(expectations, callback)758 {759 var test = this;760 761 var frame = WebInspector.currentPanel().visibleView;762 763 if (frame._textViewer)764 checkExecLine();765 else {766 setTimeout(function() {767 test._checkSourceFrameWhenLoaded(expectations, callback);768 }, 100);769 }770 function checkExecLine() {771 test._checkExecutionLine(frame, expectations.lineNumber, expectations.lineText);772 callback();773 }774 679 }; 775 680
Note: See TracChangeset
for help on using the changeset viewer.