Changeset 75938 in webkit


Ignore:
Timestamp:
Jan 17, 2011 6:25:50 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-01-17 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.

Chromium: updated DevTools tests.

  • src/js/Tests.js: (.TestSuite.prototype._waitForScriptPause): (.TestSuite.prototype._waitUntilScriptsAreParsed.waitForAllScripts): (.TestSuite.prototype._waitUntilScriptsAreParsed):
Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

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

    r75931 r75938  
     12011-01-17  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Chromium: updated DevTools tests.
     6
     7        * src/js/Tests.js:
     8        (.TestSuite.prototype._waitForScriptPause):
     9        (.TestSuite.prototype._waitUntilScriptsAreParsed.waitForAllScripts):
     10        (.TestSuite.prototype._waitUntilScriptsAreParsed):
     11
    1122011-01-17  Adam Barth  <abarth@webkit.org>
    213
  • trunk/Source/WebKit/chromium/src/js/Tests.js

    r73916 r75938  
    216216
    217217
     218TestSuite.prototype.testEnableResourcesTab = function()
     219{
     220    // FIXME once reference is removed downstream.
     221}
     222
     223TestSuite.prototype.testCompletionOnPause = function()
     224{
     225    // FIXME once reference is removed downstream.
     226}
     227
    218228// UI Tests
    219 
    220 
    221 /**
    222  * Tests that resources tab is enabled when corresponding item is selected.
    223  */
    224 TestSuite.prototype.testEnableResourcesTab = function()
    225 {
    226     this.showPanel("resources");
    227 
    228     var test = this;
    229     this.addSniffer(WebInspector, "updateResource",
    230         function(payload) {
    231             test.assertEquals("simple_page.html", payload.lastPathComponent);
    232             WebInspector.panels.resources.refresh();
    233             WebInspector.panels.resources.revealAndSelectItem(WebInspector.resources[payload.id]);
    234 
    235             test.releaseControl();
    236         });
    237 
    238     // Following call should lead to reload that we capture in the
    239     // addResource override.
    240     WebInspector.panels.resources._enableResourceTracking();
    241 
    242     // We now have some time to report results to controller.
    243     this.takeControl();
    244 };
    245229
    246230
     
    626610
    627611/**
    628  * Tests that console auto completion works when script execution is paused.
    629  */
    630 TestSuite.prototype.testCompletionOnPause = function()
    631 {
    632     this.showPanel("scripts");
    633     var test = this;
    634     this._executeCodeWhenScriptsAreParsed("handleClick()", ["completion_on_pause.html"]);
    635 
    636     this._waitForScriptPause(
    637         {
    638             functionsOnStack: ["innerFunction", "handleClick", ""],
    639             lineNumber: 9,
    640             lineText: "    debugger;"
    641         },
    642         showConsole);
    643 
    644     function showConsole() {
    645         if (WebInspector.currentFocusElement === WebInspector.console.promptElement)
    646             testLocalsCompletion();
    647         else {
    648             test.addSniffer(WebInspector.console, "afterShow", testLocalsCompletion);
    649             WebInspector.showConsole();
    650         }
    651     }
    652 
    653     function testLocalsCompletion() {
    654         checkCompletions("th", ["parameter1", "closureLocal", "p", "createClosureLocal"], testThisCompletion);
    655     }
    656 
    657     function testThisCompletion() {
    658         checkCompletions("this.", ["field1", "field2", "m"], testFieldCompletion);
    659     }
    660 
    661     function testFieldCompletion() {
    662         checkCompletions("this.field1.", ["id", "name"], function() { test.releaseControl(); });
    663     }
    664 
    665     function checkCompletions(expression, expectedProperties, callback) {
    666         test.addSniffer(WebInspector.console, "_reportCompletions",
    667             function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {
    668                 test.assertTrue(!isException, "Exception while collecting completions");
    669                 for (var i = 0; i < expectedProperties.length; i++) {
    670                     var name = expectedProperties[i];
    671                     test.assertTrue(result[name], "Name " + name + " not found among the completions: " + JSON.stringify(result));
    672                 }
    673                 setTimeout(callback, 0);
    674             });
    675       WebInspector.console.prompt.text = expression;
    676       WebInspector.console.prompt.autoCompleteSoon();
    677     }
    678 
    679     this.takeControl();
    680 };
    681 
    682 
    683 /**
    684612 * Checks current execution line against expectations.
    685613 * @param {WebInspector.SourceFrame} sourceFrame
     
    732660    test.addSniffer(
    733661        WebInspector.debuggerModel,
    734         "pausedScript",
     662        "_pausedScript",
    735663        function(details) {
    736664            var callFrames = details.callFrames;
     
    806734            callback();
    807735        else
    808             test.addSniffer(WebInspector.debuggerModel, "parsedScriptSource", waitForAllScripts);
     736            test.addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", waitForAllScripts);
    809737    }
    810738
     
    840768
    841769/**
    842  * Tests "Pause" button will pause debugger when a snippet is evaluated.
    843  */
    844 TestSuite.prototype.testPauseInEval = function()
    845 {
    846     this.showPanel("scripts");
    847 
    848     var test = this;
    849 
    850     var pauseButton = document.getElementById("scripts-pause");
    851     pauseButton.click();
    852 
    853     devtools.tools.evaluateJavaScript("fib(10)");
    854 
    855     this.addSniffer(WebInspector.debuggerModel, "pausedScript",
    856         function() {
    857             test.releaseControl();
    858         });
    859 
    860     test.takeControl();
    861 };
    862 
    863 
    864 /**
    865770 * Key event with given key identifier.
    866771 */
Note: See TracChangeset for help on using the changeset viewer.