Changeset 97613 in webkit


Ignore:
Timestamp:
Oct 17, 2011 6:39:06 AM (13 years ago)
Author:
yurys@chromium.org
Message:

[Chromium] Web Inspector: don't check for debugger pause details in interactive ui tests
https://bugs.webkit.org/show_bug.cgi?id=70228

Removed debugger pause details validation. The only check left is that debugger pause event is fired when expected.

Reviewed by Pavel Feldman.

  • src/js/Tests.js:

(.TestSuite.prototype.testPauseWhenLoadingDevTools):
(.TestSuite.prototype.testPauseWhenScriptIsRunning.didEvaluateInConsole):
(.TestSuite.prototype.testPauseWhenScriptIsRunning.testScriptPause):
(.TestSuite.prototype.testPauseWhenScriptIsRunning):
(.TestSuite.prototype.testPauseInSharedWorkerInitialization):
(.TestSuite.prototype._waitForScriptPause):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r97609 r97613  
     12011-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
    1182011-10-17  Mikhail Naganov  <mnaganov@chromium.org>
    219
  • trunk/Source/WebKit/chromium/src/js/Tests.js

    r97266 r97613  
    355355{
    356356    this.showPanel("scripts");
    357     var test = this;
    358 
    359     var expectations = {
    360             functionsOnStack: ["callDebugger"],
    361             lineNumber: 8,
    362             lineText: "  debugger;"
    363         };
    364 
    365357
    366358    // 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)
    379360        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));
    391363    this.takeControl();
    392364};
     
    398370{
    399371    this.showPanel("scripts");
    400     var test = this;
    401 
    402     test.evaluateInConsole_(
     372
     373    this.evaluateInConsole_(
    403374        '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);
    413382    }
    414383
     
    418387        WebInspector.panels.scripts.pauseButton.click();
    419388
    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));
    429390    }
    430391
     
    586547    if (WebInspector.debuggerModel.debuggerPausedDetails)
    587548        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));
    595550    this.takeControl();
    596551};
     
    685640
    686641/**
    687  * Checks current execution line against expectations.
    688  * @param {WebInspector.SourceFrame} sourceFrame
    689  * @param {number} lineNumber Expected line number
    690  * @param {string} lineContent Expected line text
    691  */
    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 /**
    700642 * Checks that all expected scripts are present in the scripts list
    701643 * in the Scripts panel.
     
    726668/**
    727669 * Waits for script pause, checks expectations, and invokes the callback.
    728  * @param {Object} expectations  Dictionary of expectations
    729670 * @param {function():void} callback
    730671 */
    731 TestSuite.prototype._waitForScriptPause = function(expectations, callback)
     672TestSuite.prototype._waitForScriptPause = function(callback)
    732673{
    733674    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 is
    742         // expected one.
    743         this._checkSourceFrameWhenLoaded(expectations, callback);
    744 
    745675        WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this);
     676        callback();
    746677    }
    747678    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this);
    748 };
    749 
    750 
    751 /**
    752  * Waits for current source frame to load, checks expectations, and invokes
    753  * the callback.
    754  * @param {Object} expectations  Dictionary of expectations
    755  * @param {function():void} callback
    756  */
    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     }
    774679};
    775680
Note: See TracChangeset for help on using the changeset viewer.