[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:54:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 26317601fde82f688a7464612d77704d02f2d569
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 1 12:13:16 2010 +0000

    2010-09-01  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: move debugger tests to the new test harness
            https://bugs.webkit.org/show_bug.cgi?id=44939
    
            * http/tests/inspector/debugger-test.js: Removed.
            * http/tests/inspector/debugger-test2.js:
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
            (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
            (initialize_DebuggerTest.InspectorTest.runTestFunctionAndWaitUntilPaused):
            (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
            (initialize_DebuggerTest.InspectorTest.waitUntilResumed):
            (initialize_DebuggerTest.InspectorTest.resumeExecution):
            (initialize_DebuggerTest.InspectorTest.captureStackTrace):
            (initialize_DebuggerTest.InspectorTest._pausedScript):
            (initialize_DebuggerTest.InspectorTest._resumedScript):
            (initialize_DebuggerTest.InspectorTest.waitUntilCurrentSourceFrameIsLoaded):
            (initialize_DebuggerTest.InspectorTest._showScriptSource):
            (initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
            (initialize_DebuggerTest.InspectorTest.expandProperties):
            (initialize_DebuggerTest.InspectorTest._expandProperty):
            (initialize_DebuggerTest.InspectorTest._findChildPropertyTreeElement):
            (initialize_DebuggerTest):
            * http/tests/inspector/inspector-test2.js:
            (initialize_InspectorTest.InspectorTest.completeTest):
            (initialize_InspectorTest.InspectorTest.evaluateInPage):
            (initialize_InspectorTest.InspectorTest.addResult.addResultToPage):
            (initialize_InspectorTest.InspectorTest.addResult):
            (initialize_InspectorTest.InspectorTest.addObject):
            (initialize_InspectorTest.InspectorTest.reloadPage):
            (initialize_InspectorTest.InspectorTest.pageReloaded):
            (initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
            (initialize_InspectorTest.InspectorTest.enableResourceTracking):
            (initialize_InspectorTest.InspectorTest.disableResourceTracking):
            (initialize_InspectorTest.InspectorTest._addSniffer):
            (runTest.runTestInFrontend):
            (runTest):
            (didEvaluateForTestInFrontend):
            * inspector/debugger-breakpoints-not-activated-on-reload.html:
            * inspector/debugger-cyclic-ref-expected.txt:
            * inspector/debugger-cyclic-ref.html:
            * inspector/debugger-eval-while-paused-expected.txt:
            * inspector/debugger-eval-while-paused.html:
            * inspector/debugger-no-nested-pause-expected.txt:
            * inspector/debugger-no-nested-pause.html:
            * inspector/debugger-pause-in-eval-script-expected.txt:
            * inspector/debugger-pause-in-eval-script.html:
            * inspector/debugger-pause-on-debugger-statement-expected.txt:
            * inspector/debugger-pause-on-debugger-statement.html:
            * inspector/debugger-proto-property-expected.txt:
            * inspector/debugger-proto-property.html:
            * inspector/debugger-step-in-expected.txt:
            * inspector/debugger-step-in.html:
            * inspector/debugger-step-out-expected.txt:
            * inspector/debugger-step-out.html:
            * inspector/debugger-step-over-expected.txt:
            * inspector/debugger-step-over.html:
            * inspector/dom-breakpoints-expected.txt:
            * inspector/dom-breakpoints.html:
            * inspector/extensions-api-expected.txt:
            * inspector/extensions-audits-api-expected.txt:
            * inspector/extensions-audits-expected.txt:
            * inspector/extensions-expected.txt:
            * inspector/report-protocol-errors.html:
            * platform/chromium/inspector/debugger-step-in-expected.txt:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66596 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 81f62cc..30d13c5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,72 @@
+2010-09-01  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: move debugger tests to the new test harness
+        https://bugs.webkit.org/show_bug.cgi?id=44939
+
+        * http/tests/inspector/debugger-test.js: Removed.
+        * http/tests/inspector/debugger-test2.js:
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
+        (initialize_DebuggerTest.InspectorTest.runTestFunctionAndWaitUntilPaused):
+        (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
+        (initialize_DebuggerTest.InspectorTest.waitUntilResumed):
+        (initialize_DebuggerTest.InspectorTest.resumeExecution):
+        (initialize_DebuggerTest.InspectorTest.captureStackTrace):
+        (initialize_DebuggerTest.InspectorTest._pausedScript):
+        (initialize_DebuggerTest.InspectorTest._resumedScript):
+        (initialize_DebuggerTest.InspectorTest.waitUntilCurrentSourceFrameIsLoaded):
+        (initialize_DebuggerTest.InspectorTest._showScriptSource):
+        (initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
+        (initialize_DebuggerTest.InspectorTest.expandProperties):
+        (initialize_DebuggerTest.InspectorTest._expandProperty):
+        (initialize_DebuggerTest.InspectorTest._findChildPropertyTreeElement):
+        (initialize_DebuggerTest):
+        * http/tests/inspector/inspector-test2.js:
+        (initialize_InspectorTest.InspectorTest.completeTest):
+        (initialize_InspectorTest.InspectorTest.evaluateInPage):
+        (initialize_InspectorTest.InspectorTest.addResult.addResultToPage):
+        (initialize_InspectorTest.InspectorTest.addResult):
+        (initialize_InspectorTest.InspectorTest.addObject):
+        (initialize_InspectorTest.InspectorTest.reloadPage):
+        (initialize_InspectorTest.InspectorTest.pageReloaded):
+        (initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
+        (initialize_InspectorTest.InspectorTest.enableResourceTracking):
+        (initialize_InspectorTest.InspectorTest.disableResourceTracking):
+        (initialize_InspectorTest.InspectorTest._addSniffer):
+        (runTest.runTestInFrontend):
+        (runTest):
+        (didEvaluateForTestInFrontend):
+        * inspector/debugger-breakpoints-not-activated-on-reload.html:
+        * inspector/debugger-cyclic-ref-expected.txt:
+        * inspector/debugger-cyclic-ref.html:
+        * inspector/debugger-eval-while-paused-expected.txt:
+        * inspector/debugger-eval-while-paused.html:
+        * inspector/debugger-no-nested-pause-expected.txt:
+        * inspector/debugger-no-nested-pause.html:
+        * inspector/debugger-pause-in-eval-script-expected.txt:
+        * inspector/debugger-pause-in-eval-script.html:
+        * inspector/debugger-pause-on-debugger-statement-expected.txt:
+        * inspector/debugger-pause-on-debugger-statement.html:
+        * inspector/debugger-proto-property-expected.txt:
+        * inspector/debugger-proto-property.html:
+        * inspector/debugger-step-in-expected.txt:
+        * inspector/debugger-step-in.html:
+        * inspector/debugger-step-out-expected.txt:
+        * inspector/debugger-step-out.html:
+        * inspector/debugger-step-over-expected.txt:
+        * inspector/debugger-step-over.html:
+        * inspector/dom-breakpoints-expected.txt:
+        * inspector/dom-breakpoints.html:
+        * inspector/extensions-api-expected.txt:
+        * inspector/extensions-audits-api-expected.txt:
+        * inspector/extensions-audits-expected.txt:
+        * inspector/extensions-expected.txt:
+        * inspector/report-protocol-errors.html:
+        * platform/chromium/inspector/debugger-step-in-expected.txt:
+
 2010-09-01  Anton Muhin <antonm at chromium.org>
 
         Unreviewed, updating expected results for Chromium.
diff --git a/LayoutTests/http/tests/inspector/debugger-test.js b/LayoutTests/http/tests/inspector/debugger-test.js
deleted file mode 100644
index 0f87013..0000000
--- a/LayoutTests/http/tests/inspector/debugger-test.js
+++ /dev/null
@@ -1,113 +0,0 @@
-
-function frontend_ensureDebuggerEnabled(callback)
-{
-    if (WebInspector.panels.scripts._debuggerEnabled) {
-        callback();
-        return;
-    }
-
-    frontend_addSniffer(WebInspector, "debuggerWasEnabled", callback);
-    WebInspector.panels.scripts._toggleDebugging(false);
-}
-
-function frontend_ensureDebuggerDisabled(callback)
-{
-    if (!WebInspector.panels.scripts._debuggerEnabled) {
-        callback();
-        return;
-    }
-
-    frontend_addSniffer(WebInspector, "debuggerWasDisabled", callback);
-    WebInspector.panels.scripts._toggleDebugging(false);
-}
-
-function frontend_completeDebuggerTest(testController)
-{
-    if (WebInspector.panels.scripts.paused) {
-        WebInspector.panels.scripts._togglePause();
-        testController.results.push("Resumed script execution.");
-    }
-    frontend_ensureDebuggerDisabled(function()
-    {
-        testController.results.push("Disabled debugger.");
-        testController.notifyDone();
-    });
-}
-
-function frontend_scriptsAreParsed(scripts)
-{
-    var scriptSelect = document.getElementById("scripts-files");
-    var options = scriptSelect.options;
-
-    // Check that all the expected scripts are present.
-    for (var i = 0; i < scripts.length; i++) {
-        var found = false;
-        for (var j = 0; j < options.length; j++) {
-            if (options[j].text.search(scripts[i]) !== -1) {
-                found = true;
-                break;
-            }
-        }
-        if (!found)
-            return false;
-    }
-    return true;
-};
-
-function frontend_waitUntilScriptsAreParsed(scripts, callback)
-{
-    function waitForAllScripts()
-    {
-        if (frontend_scriptsAreParsed(scripts))
-            callback();
-        else
-            frontend_addSniffer(WebInspector, "parsedScriptSource", waitForAllScripts);
-    }
-    waitForAllScripts();
-};
-
-function frontend_ensureSourceFrameLoaded(sourceFrame, callback)
-{
-    if (!sourceFrame._loaded)
-        frontend_addSniffer(sourceFrame, "setContent", callback);
-    else
-        callback();
-}
-
-function frontend_showScriptSource(scriptName, callback)
-{
-    var scriptSelect = document.getElementById("scripts-files");
-    var options = scriptSelect.options;
-    var scriptsPanel = WebInspector.panels.scripts;
-
-    // Select page's script if it's not current option.
-    var scriptResource;
-    if (options[scriptSelect.selectedIndex].text === scriptName)
-        scriptResource = options[scriptSelect.selectedIndex].representedObject;
-    else {
-        var pageScriptIndex = -1;
-        for (var i = 0; i < options.length; i++) {
-            if (options[i].text === scriptName) {
-                pageScriptIndex = i;
-                break;
-            }
-        }
-        scriptResource = options[pageScriptIndex].representedObject;
-        scriptsPanel._showScriptOrResource(scriptResource);
-    }
-
-    var view = scriptsPanel.visibleView;
-    frontend_ensureSourceFrameLoaded(view.sourceFrame, callback.bind(null, view));
-};
-
-function frontend_captureStackTrace(callFrames, testController)
-{
-    testController.results.push("Call stack:");
-    for (var i = 0; i < callFrames.length; i++) {
-        var frame = callFrames[i];
-        var scriptOrResource = WebInspector.panels.scripts._sourceIDMap[frame.sourceID];
-        var url = scriptOrResource && WebInspector.displayNameForURL(scriptOrResource.sourceURL || scriptOrResource.url);
-        var s = "    " + i + ") " + frame.functionName + " (" + url + ":" + frame.line + ")";
-        testController.results.push(s);
-    }
-}
diff --git a/LayoutTests/http/tests/inspector/debugger-test2.js b/LayoutTests/http/tests/inspector/debugger-test2.js
index 528ee8f..80b98a6 100644
--- a/LayoutTests/http/tests/inspector/debugger-test2.js
+++ b/LayoutTests/http/tests/inspector/debugger-test2.js
@@ -2,6 +2,8 @@ var initialize_DebuggerTest = function() {
 
 InspectorTest.startDebuggerTest = function(callback)
 {
+    WebInspector.showPanel("scripts");
+
     if (WebInspector.panels.scripts._debuggerEnabled)
         startTest();
     else {
@@ -12,9 +14,11 @@ InspectorTest.startDebuggerTest = function(callback)
     function startTest()
     {
         InspectorTest.addResult("Debugger was enabled.");
+        InspectorTest._addSniffer(WebInspector, "pausedScript", InspectorTest._pausedScript, true);
+        InspectorTest._addSniffer(WebInspector, "resumedScript", InspectorTest._resumedScript, true);
         callback();
     }
-}
+};
 
 InspectorTest.completeDebuggerTest = function()
 {
@@ -23,13 +27,16 @@ InspectorTest.completeDebuggerTest = function()
     if (!scriptsPanel.breakpointsActivated)
         scriptsPanel.toggleBreakpointsButton.element.click();
 
-    InspectorTest.resumeExecution();
+    InspectorTest.resumeExecution(disableDebugger);
 
-    if (!scriptsPanel._debuggerEnabled)
-        completeTest();
-    else {
-        InspectorTest._addSniffer(WebInspector, "debuggerWasDisabled", completeTest);
-        scriptsPanel._toggleDebugging(false);
+    function disableDebugger()
+    {
+        if (!scriptsPanel._debuggerEnabled)
+            completeTest();
+        else {
+            InspectorTest._addSniffer(WebInspector, "debuggerWasDisabled", completeTest);
+            scriptsPanel._toggleDebugging(false);
+        }
     }
 
     function completeTest()
@@ -39,21 +46,69 @@ InspectorTest.completeDebuggerTest = function()
     }
 };
 
+InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback)
+{
+    InspectorTest.evaluateInConsole("setTimeout(testFunction, 0)");
+    InspectorTest.addResult("Set timer for test function.");
+    InspectorTest.waitUntilPaused(callback);
+};
+
 InspectorTest.waitUntilPaused = function(callback)
 {
-    InspectorTest._addSniffer(WebInspector, "pausedScript", pausedScript);
+    if (InspectorTest._callFrames)
+        callback(InspectorTest._callFrames);
+    else
+        InspectorTest._waitUntilPausedCallback = callback;
+};
 
-    function pausedScript(callFrames)
-    {
-        InspectorTest.addResult("Paused at line " + callFrames[0].line + " in " + callFrames[0].functionName);
-        callback(callFrames);
-    }
+InspectorTest.waitUntilResumed = function(callback)
+{
+    if (!InspectorTest._callFrames)
+        callback();
+    else
+        InspectorTest._waitUntilResumedCallback = callback;
 };
 
-InspectorTest.resumeExecution = function()
+InspectorTest.resumeExecution = function(callback)
 {
     if (WebInspector.panels.scripts.paused)
         WebInspector.panels.scripts._togglePause();
+    if (callback)
+        InspectorTest.waitUntilResumed(callback);
+};
+
+InspectorTest.captureStackTrace = function(callFrames)
+{
+    InspectorTest.addResult("Call stack:");
+    for (var i = 0; i < callFrames.length; i++) {
+        var frame = callFrames[i];
+        var scriptOrResource = WebInspector.panels.scripts._sourceIDMap[frame.sourceID];
+        var url = scriptOrResource && WebInspector.displayNameForURL(scriptOrResource.sourceURL || scriptOrResource.url);
+        var s = "    " + i + ") " + frame.functionName + " (" + url + ":" + frame.line + ")";
+        InspectorTest.addResult(s);
+    }
+};
+
+InspectorTest._pausedScript = function(callFrames)
+{
+    InspectorTest.addResult("Script execution paused.");
+    InspectorTest._callFrames = callFrames;
+    if (InspectorTest._waitUntilPausedCallback) {
+        var callback = InspectorTest._waitUntilPausedCallback;
+        delete InspectorTest._waitUntilPausedCallback;
+        callback(InspectorTest._callFrames);
+    }
+}
+
+InspectorTest._resumedScript = function()
+{
+    InspectorTest.addResult("Script execution resumed.");
+    delete InspectorTest._callFrames;
+    if (InspectorTest._waitUntilResumedCallback) {
+        var callback = InspectorTest._waitUntilResumedCallback;
+        delete InspectorTest._waitUntilResumedCallback;
+        callback();
+    }
 };
 
 InspectorTest.showScriptSource = function(scriptName, callback)
@@ -64,6 +119,15 @@ InspectorTest.showScriptSource = function(scriptName, callback)
         InspectorTest._addSniffer(WebInspector, "parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
 };
 
+InspectorTest.waitUntilCurrentSourceFrameIsLoaded = function(callback)
+{
+    var sourceFrame = WebInspector.currentPanel.visibleView.sourceFrame;
+    if (sourceFrame._loaded)
+        callback(sourceFrame);
+    else
+        InspectorTest._addSniffer(sourceFrame, "setContent", callback.bind(null, sourceFrame));
+};
+
 InspectorTest._scriptsAreParsed = function(scripts)
 {
     var scriptSelect = document.getElementById("scripts-files");
@@ -106,12 +170,52 @@ InspectorTest._showScriptSource = function(scriptName, callback)
         scriptsPanel._showScriptOrResource(scriptResource);
     }
 
-    var view = scriptsPanel.visibleView;
-    callback = callback.bind(null, view);
-    if (!view.sourceFrame._loaded)
-        InspectorTest._addSniffer(view.sourceFrame, "setContent", callback);
-    else
+    InspectorTest.waitUntilCurrentSourceFrameIsLoaded(callback);
+};
+
+InspectorTest.expandProperties = function(properties, callback)
+{
+    var index = 0;
+    function expandNextPath()
+    {
+        if (index === properties.length) {
+            callback();
+            return;
+        }
+        var parentTreeElement = properties[index++];
+        var path = properties[index++];
+        InspectorTest._expandProperty(parentTreeElement, path, 0, expandNextPath);
+    }
+    InspectorTest.runAfterPendingDispatches(expandNextPath);
+};
+
+InspectorTest._expandProperty = function(parentTreeElement, path, pathIndex, callback)
+{
+    if (pathIndex === path.length) {
+        InspectorTest.addResult("Expanded property: " + path.join("."));
         callback();
+        return;
+    }
+    var name = path[pathIndex++];
+    var propertyTreeElement = InspectorTest._findChildPropertyTreeElement(parentTreeElement, name);
+    if (!propertyTreeElement) {
+       InspectorTest.addResult("Failed to expand property: " + path.slice(0, pathIndex).join("."));
+       InspectorTest.completeDebuggerTest();
+       return;
+    }
+    propertyTreeElement.expand();
+    InspectorTest.runAfterPendingDispatches(InspectorTest._expandProperty.bind(InspectorTest, propertyTreeElement, path, pathIndex, callback));
 };
 
-}
+InspectorTest._findChildPropertyTreeElement = function(parent, childName)
+{
+    var children = parent.children;
+    for (var i = 0; i < children.length; i++) {
+        var treeElement = children[i];
+        var property = treeElement.property;
+        if (property.name === childName)
+            return treeElement;
+    }
+};
+
+};
diff --git a/LayoutTests/http/tests/inspector/inspector-test2.js b/LayoutTests/http/tests/inspector/inspector-test2.js
index 4cb3141..ea2c2c0 100644
--- a/LayoutTests/http/tests/inspector/inspector-test2.js
+++ b/LayoutTests/http/tests/inspector/inspector-test2.js
@@ -1,10 +1,11 @@
-var initialize_InspectorTest = (function() {
+var initialize_InspectorTest = function() {
 
 var results = [];
+var resultsSynchronized = false;
 
 InspectorTest.completeTest = function()
 {
-    InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, JSON.stringify(results));
+    InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, "");
 };
 
 InspectorTest.evaluateInConsole = function(code, callback)
@@ -21,15 +22,70 @@ InspectorTest.evaluateInConsole = function(code, callback)
         });
 };
 
+InspectorTest.evaluateInPage = function(code, callback)
+{
+    InjectedScriptAccess.getDefault().evaluate(code, "console", callback || function() {});
+};
+
 InspectorTest.addResult = function(text)
 {
     results.push(text);
+    if (resultsSynchronized)
+        addResultToPage(text);
+    else {
+        for (var i = 0; i < results.length; ++i)
+            addResultToPage(results[i]);
+        resultsSynchronized = true;
+    }
+
+    function addResultToPage(text)
+    {
+        InspectorTest.evaluateInPage("output(unescape('" + escape(text) + "'))");
+    }
+};
+
+InspectorTest.addObject = function(object, nondeterministicProps, prefix, firstLinePrefix)
+{
+    prefix = prefix || "";
+    firstLinePrefix = firstLinePrefix || prefix;
+    InspectorTest.addResult(firstLinePrefix + "{");
+    for (var prop in object) {
+        if (!object.hasOwnProperty(prop))
+            continue;
+        var prefixWithName = prefix + "    " + prop + " : ";
+        var propValue = object[prop];
+        if (nondeterministicProps && prop in nondeterministicProps)
+            InspectorTest.addResult(prefixWithName + "<" + typeof propValue + ">");
+        else if (typeof propValue === "object")
+            InspectorTest.addObject(propValue, nondeterministicProps, prefix + "    ", prefixWithName);
+        else if (typeof propValue === "string")
+            InspectorTest.addResult(prefixWithName + "\"" + propValue + "\"");
+        else
+            InspectorTest.addResult(prefixWithName + propValue);
+    }
+    InspectorTest.addResult(prefix + "}");
 };
 
 InspectorTest.reloadPage = function(callback)
 {
+    InspectorTest._reloadPageCallback = callback;
     InspectorBackend.reloadPage();
-    InspectorTest._addSniffer(WebInspector, "reset", callback);
+};
+
+InspectorTest.pageReloaded = function()
+{
+    resultsSynchronized = false;
+    InspectorTest.addResult("Page reloaded.");
+    if (InspectorTest._reloadPageCallback) {
+        var callback = InspectorTest._reloadPageCallback;
+        delete InspectorTest._reloadPageCallback;
+        callback();
+    }
+};
+
+InspectorTest.runAfterPendingDispatches = function(callback)
+{
+    WebInspector.TestController.prototype.runAfterPendingDispatches(callback);
 };
 
 InspectorTest.enableResourceTracking = function(callback)
@@ -37,15 +93,15 @@ InspectorTest.enableResourceTracking = function(callback)
     if (WebInspector.panels.resources.resourceTrackingEnabled)
         callback();
     else {
-        InspectorTest._addSniffer(WebInspector, "reset", callback);
+        InspectorTest._reloadPageCallback = callback;
         InspectorBackend.enableResourceTracking(false);
     }
-}
+};
 
 InspectorTest.disableResourceTracking = function()
 {
     InspectorBackend.disableResourceTracking(false);
-}
+};
 
 InspectorTest.findDOMNode = function(root, filter, callback)
 {
@@ -110,9 +166,9 @@ InspectorTest._addSniffer = function(receiver, methodName, override, opt_sticky)
         }
         return result;
     };
-}
+};
 
-});
+};
 
 var runTestCallId = 0;
 var completeTestCallId = 1;
@@ -127,8 +183,10 @@ function runTest()
 
     function runTestInFrontend(initializationFunctions, testFunction, completeTestCallId)
     {
-        if (window.InspectorTest)
+        if (window.InspectorTest) {
+            InspectorTest.pageReloaded();
             return;
+        }
 
         InspectorTest = {};
         InspectorTest.completeTestCallId = completeTestCallId;
@@ -155,65 +213,16 @@ function runTest()
     layoutTestController.evaluateInWebInspector(runTestCallId, toEvaluate);
 }
 
-function didEvaluateForTestInFrontend(callId, result)
+function didEvaluateForTestInFrontend(callId)
 {
     if (callId !== completeTestCallId)
         return;
-    dumpArray(JSON.parse(result));
     layoutTestController.closeWebInspector();
     setTimeout(function() {
         layoutTestController.notifyDone();
     }, 0);
 }
 
-function dump(data)
-{
-    if (typeof data === "string") {
-        output(data);
-        return;
-    }
-
-    if (typeof data === "object") {
-        dumpObject(data);
-        return;
-    }
-
-    if (typeof data === "array") {
-        for (var i = 0; i < result.length; ++i)
-            dump(result[i]);
-        return;
-    }
-}
-
-function dumpArray(result)
-{
-    if (result instanceof Array) {
-        for (var i = 0; i < result.length; ++i)
-            dump(result[i]);
-    } else
-        output(result);
-}
-
-function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix)
-{
-    prefix = prefix || "";
-    firstLinePrefix = firstLinePrefix || prefix;
-    output(firstLinePrefix + "{");
-    for (var prop in object) {
-        var prefixWithName = prefix + "    " + prop + " : ";
-        var propValue = object[prop];
-        if (nondeterministicProps && prop in nondeterministicProps)
-            output(prefixWithName + "<" + typeof propValue + ">");
-        else if (typeof propValue === "object")
-            dumpObject(propValue, nondeterministicProps, prefix + "    ", prefixWithName);
-        else if (typeof propValue === "string")
-            output(prefixWithName + "\"" + propValue + "\"");
-        else
-            output(prefixWithName + propValue);
-    }
-    output(prefix + "}");
-}
-
 function output(text)
 {
     var outputElement = document.createElement("div");
diff --git a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
index 1c8b0fb..c06664d 100644
--- a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
+++ b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
@@ -14,29 +14,27 @@ var test = function()
     var testName = WebInspector.mainResource.url;
     testName = testName.substring(testName.lastIndexOf('/') + 1);
 
-    WebInspector.showPanel("scripts");
-    InspectorTest.startDebuggerTest(startDebuggerTestCallback);
+    InspectorTest.startDebuggerTest(step1);
 
-    function startDebuggerTestCallback()
+    function step1()
     {
-        InspectorTest.showScriptSource(testName, showScriptSourceCallback);
+        InspectorTest.showScriptSource(testName, step2);
     }
 
-    function showScriptSourceCallback(view)
+    function step2()
     {
         InspectorTest.addResult("Main resource was shown.");
-        view._addBreakpoint(8);
+        WebInspector.panels.scripts.visibleView._addBreakpoint(8);
         WebInspector.panels.scripts.toggleBreakpointsButton.element.click();
-        InspectorTest.reloadPage(reloadPageCallback);
+        InspectorTest.reloadPage(step3);
     }
 
-    function reloadPageCallback()
+    function step3()
     {
-        InspectorTest.addResult("Page reloaded.");
-        InspectorTest.showScriptSource(testName, showScriptSourceAfterReloadCallback);
+        InspectorTest.showScriptSource(testName, step4);
     }
 
-    function showScriptSourceAfterReloadCallback(view)
+    function step4()
     {
         InspectorTest.addResult("Main resource was shown.");
         if (!WebInspector.panels.scripts.breakpointsActivated)
diff --git a/LayoutTests/inspector/debugger-cyclic-ref-expected.txt b/LayoutTests/inspector/debugger-cyclic-ref-expected.txt
index 53fcf9a..7354e1a 100644
--- a/LayoutTests/inspector/debugger-cyclic-ref-expected.txt
+++ b/LayoutTests/inspector/debugger-cyclic-ref-expected.txt
@@ -3,6 +3,6 @@ Tests that debugging a page where Object prototype has a cyclic reference won't
 Debugger was enabled.
 Set timer for test function.
 Script execution paused.
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-cyclic-ref.html b/LayoutTests/inspector/debugger-cyclic-ref.html
index 8d51bc4..17fe639 100755
--- a/LayoutTests/inspector/debugger-cyclic-ref.html
+++ b/LayoutTests/inspector/debugger-cyclic-ref.html
@@ -1,7 +1,7 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
 Object.prototype.cyclicRef = Object.prototype;
@@ -10,41 +10,27 @@ function testFunction()
 {
     var o = new Object();
     debugger;
-    notifyDone();
 }
 
-function doit()
+var test = function()
 {
-    evaluateInWebInspector("frontend_testDebugObjectWithCyclicRef", dumpArray);
-}
-
-function frontend_testDebugObjectWithCyclicRef(testController)
-{
-    testController.waitUntilDone();
+    InspectorTest.startDebuggerTest(step1);
 
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2()
     {
-        testController.results.push("Script execution paused.");
-        frontend_completeDebuggerTest(testController);
-    });
+        InspectorTest.completeDebuggerTest();
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that debugging a page where Object prototype has a cyclic reference won't
 crash the browser.<a href="https://bugs.webkit.org/show_bug.cgi?id=43558">Bug 43558</a>
diff --git a/LayoutTests/inspector/debugger-eval-while-paused-expected.txt b/LayoutTests/inspector/debugger-eval-while-paused-expected.txt
index 2d8371c..8f4dd30 100644
--- a/LayoutTests/inspector/debugger-eval-while-paused-expected.txt
+++ b/LayoutTests/inspector/debugger-eval-while-paused-expected.txt
@@ -5,6 +5,6 @@ Set timer for test function.
 Script execution paused.
 Evaluated script on the top frame: 4021
 Evaluated script on the calling frame: 301
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-eval-while-paused.html b/LayoutTests/inspector/debugger-eval-while-paused.html
index 15b20a8..d832aa2 100644
--- a/LayoutTests/inspector/debugger-eval-while-paused.html
+++ b/LayoutTests/inspector/debugger-eval-while-paused.html
@@ -1,68 +1,60 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
 var globalVar = { b: 1 };
 
-function slave(x) {
+function slave(x)
+{
     var y = 20;
     debugger;
-    notifyDone();
 }
 
-function testFunction() {
-    var localObject = {a: 300};
+function testFunction()
+{
+    var localObject = { a: 300 };
     slave(4000);
 }
 
-function doit()
+var test = function()
 {
-    evaluateInWebInspector("frontend_testPauseOnDebuggerStatement", dumpArray);
-}
+    InspectorTest.startDebuggerTest(step1);
 
-function frontend_testPauseOnDebuggerStatement(testController)
-{
-    testController.waitUntilDone();
+    function step1()
+    {
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
+    }
 
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
+    function step2(callFrames)
+    {
+        InspectorTest.evaluateInConsole("x + y + globalVar.b", step3.bind(null, callFrames));
+    }
 
-    function debuggerWasEnabledCallback()
+    function step3(callFrames, result)
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.addResult("Evaluated script on the top frame: " + result);
+        WebInspector.panels.scripts.sidebarPanes.callstack.selectedCallFrame = callFrames[1];
+        InspectorTest.runAfterPendingDispatches(step4);
     }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step4()
     {
-        testController.results.push("Script execution paused.");
-        frontend_evaluateInConsole("x + y + globalVar.b", function(result)
-        {
-            testController.results.push("Evaluated script on the top frame: " + result);
-            WebInspector.panels.scripts.sidebarPanes.callstack.selectedCallFrame = callFrames[1];
-            testController.runAfterPendingDispatches(testEvalInCallingFrame);
-        });
+        InspectorTest.evaluateInConsole("localObject.a + globalVar.b", step5);
+    }
 
-        function testEvalInCallingFrame()
-        {
-            frontend_evaluateInConsole("localObject.a + globalVar.b", function(result)
-            {
-                testController.results.push("Evaluated script on the calling frame: " + result);
-                frontend_completeDebuggerTest(testController);
-            });
-        }
-    });
+    function step5(result)
+    {
+        InspectorTest.addResult("Evaluated script on the calling frame: " + result);
+        InspectorTest.completeDebuggerTest();
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that evaluation in console works fine when script is paused. It also checks that
 stack and global variables are accessible from the console.
diff --git a/LayoutTests/inspector/debugger-no-nested-pause-expected.txt b/LayoutTests/inspector/debugger-no-nested-pause-expected.txt
index 0a62fa0..23b48f7 100644
--- a/LayoutTests/inspector/debugger-no-nested-pause-expected.txt
+++ b/LayoutTests/inspector/debugger-no-nested-pause-expected.txt
@@ -5,6 +5,6 @@ Set timer for test function.
 Script execution paused.
 Set timer for test function.
 testFunction.invocationCount = 2
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-no-nested-pause.html b/LayoutTests/inspector/debugger-no-nested-pause.html
index df8c5e6..8a6cfb7 100644
--- a/LayoutTests/inspector/debugger-no-nested-pause.html
+++ b/LayoutTests/inspector/debugger-no-nested-pause.html
@@ -1,64 +1,43 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
 function testFunction()
 {
     testFunction.invocationCount++;
     debugger;
-    if (testFunction.didExitFromNestedCall)
-        notifyDone();
-    testFunction.didExitFromNestedCall = true;
 }
-testFunction.invocationCount = 0;
 
-function doit()
-{
-    evaluateInWebInspector("frontend_testNoNestedPause", dumpArray);
-}
+testFunction.invocationCount = 0;
 
-function frontend_testNoNestedPause(testController)
+var test = function()
 {
-    testController.waitUntilDone();
+    InspectorTest.startDebuggerTest(step1);
 
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
-    var paused = false;
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2()
     {
-        if (paused) {
-            testController.results.push("Script execution paused second time.");
-            testController.notifyDone();
-            return;
-        }
-        paused = true;
-        testController.results.push("Script execution paused.");
+        InspectorTest.evaluateInConsole("testFunction(); testFunction.invocationCount", step3);
+        InspectorTest.addResult("Set timer for test function.");
+    }
 
-        testController.results.push("Set timer for test function.");
-        frontend_evaluateInConsole("testFunction(); testFunction.invocationCount", function(result)
-        {
-            testController.results.push("testFunction.invocationCount = " + result);
-            frontend_completeDebuggerTest(testController);
-        });
-    });
+    function step3(result)
+    {
+        InspectorTest.addResult("testFunction.invocationCount = " + result);
+        InspectorTest.completeDebuggerTest();
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that debugger will skip breakpoint hit when script execution is already paused. <a href="https://bugs.webkit.org/show_bug.cgi?id=41768">See bug</a>
 </p>
diff --git a/LayoutTests/inspector/debugger-pause-in-eval-script-expected.txt b/LayoutTests/inspector/debugger-pause-in-eval-script-expected.txt
index 58530fc..f6dd479 100644
--- a/LayoutTests/inspector/debugger-pause-in-eval-script-expected.txt
+++ b/LayoutTests/inspector/debugger-pause-in-eval-script-expected.txt
@@ -5,6 +5,6 @@ Evaluated script in console.
 Script execution paused.
 Execution line number: 3
 Execution line text:     debugger;
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-pause-in-eval-script.html b/LayoutTests/inspector/debugger-pause-in-eval-script.html
index c655ab6..be4e7ea 100644
--- a/LayoutTests/inspector/debugger-pause-in-eval-script.html
+++ b/LayoutTests/inspector/debugger-pause-in-eval-script.html
@@ -1,63 +1,42 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function doit()
-{
-    evaluateInWebInspector("frontend_testPauseOnDebuggerStatement", dumpArray);
-}
 
-function frontend_testPauseOnDebuggerStatement(testController)
+var test = function()
 {
-    testController.waitUntilDone();
-
-    WebInspector.showPanel("scripts");
-
     var scriptToEvaluate = "function testFunction() {\n" +
                            "    debugger;\n" +
-                           "    notifyDone();\n" +
                            "}\n" +
                            "setTimeout(testFunction, 0);\n";
-    function debuggerWasEnabledCallback()
-    {
-        testController.results.push("Debugger was enabled.");
 
-        frontend_evaluateInConsole(scriptToEvaluate,
-        function(result)
-        {
-            testController.results.push("Evaluated script in console.");
-        });
-    }
+    InspectorTest.startDebuggerTest(step1);
 
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
+    function step1()
+    {
+        InspectorTest.evaluateInConsole(scriptToEvaluate, InspectorTest.addResult.bind(InspectorTest, "Evaluated script in console."));
+        InspectorTest.waitUntilPaused(step2);
+    }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2()
     {
-        testController.results.push("Script execution paused.");
-        frontend_checkExecutionLineWhenSourceFrameIsLoaded(testController, frontend_completeDebuggerTest.bind(null, testController));
-    });
-}
+        InspectorTest.waitUntilCurrentSourceFrameIsLoaded(step3);
+    }
 
-function frontend_checkExecutionLineWhenSourceFrameIsLoaded(testController, callback)
-{
-    var sourceFrame = WebInspector.currentPanel.visibleView.sourceFrame;
-    if (sourceFrame._loaded) {
-        testController.results.push("Execution line number: " + sourceFrame.executionLine);
-        testController.results.push("Execution line text: " + sourceFrame._textModel.line(sourceFrame.executionLine - 1));
-        callback();
-    } else {
-        frontend_addSniffer(sourceFrame, "setContent", function() {
-            frontend_checkExecutionLineWhenSourceFrameIsLoaded(testController, callback);
-        });
+    function step3(sourceFrame)
+    {
+        InspectorTest.addResult("Execution line number: " + sourceFrame.executionLine);
+        InspectorTest.addResult("Execution line text: " + sourceFrame._textModel.line(sourceFrame.executionLine - 1));
+        InspectorTest.completeDebuggerTest();
     }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that debugger will stop on "debugger" statement in a function that was added
 to the inspected page via evaluation in Web Inspector console.<a href="https://bugs.webkit.org/show_bug.cgi?id=41058">Bug 41058</a>
diff --git a/LayoutTests/inspector/debugger-pause-on-debugger-statement-expected.txt b/LayoutTests/inspector/debugger-pause-on-debugger-statement-expected.txt
index 39eaf0c..d78ee7b 100644
--- a/LayoutTests/inspector/debugger-pause-on-debugger-statement-expected.txt
+++ b/LayoutTests/inspector/debugger-pause-on-debugger-statement-expected.txt
@@ -3,6 +3,6 @@ Tests that debugger will stop on "debugger" statement.
 Debugger was enabled.
 Set timer for test function.
 Script execution paused.
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-pause-on-debugger-statement.html b/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
index 74196ca..cbb047c 100644
--- a/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
+++ b/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
@@ -1,46 +1,33 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function testFunction() {
-    debugger;
-    notifyDone();
-}
-
-function doit()
+function testFunction()
 {
-    evaluateInWebInspector("frontend_testPauseOnDebuggerStatement", dumpArray);
+    debugger;
 }
 
-function frontend_testPauseOnDebuggerStatement(testController)
+var test = function()
 {
-    testController.waitUntilDone();
-
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
+    InspectorTest.startDebuggerTest(step1);
 
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2()
     {
-        testController.results.push("Script execution paused.");
-        frontend_completeDebuggerTest(testController);
-    });
+        InspectorTest.completeDebuggerTest();
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that debugger will stop on "debugger" statement.
 </p>
diff --git a/LayoutTests/inspector/debugger-proto-property-expected.txt b/LayoutTests/inspector/debugger-proto-property-expected.txt
index cf2ecaa..00196c8 100644
--- a/LayoutTests/inspector/debugger-proto-property-expected.txt
+++ b/LayoutTests/inspector/debugger-proto-property-expected.txt
@@ -5,6 +5,6 @@ Set timer for test function.
 Script execution paused.
 Expanded property: o.__proto__.__proto__
 Expanded property: d.__proto__.__proto__.__proto__.__proto__.__proto__
-Resumed script execution.
-Disabled debugger.
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-proto-property.html b/LayoutTests/inspector/debugger-proto-property.html
index 51a7466..28ef10a 100644
--- a/LayoutTests/inspector/debugger-proto-property.html
+++ b/LayoutTests/inspector/debugger-proto-property.html
@@ -1,108 +1,54 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function C() {
+function C()
+{
 }
+
 C.prototype = {
     m: function() { }
 }
 
-function testFunction() {
+function testFunction()
+{
     var o = new C();
     var d = document.documentElement;
     debugger;
-    notifyDone();
 }
 
-function doit()
+var test = function()
 {
-    evaluateInWebInspector("frontend_testProtoPropertyOnPause", dumpArray);
-}
+    InspectorTest.startDebuggerTest(step1);
 
-function frontend_testProtoPropertyOnPause(testController)
-{
-    testController.waitUntilDone();
-
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2(callFrames)
     {
-        testController.results.push("Script execution paused.");
         var sections = WebInspector.currentPanel.sidebarPanes.scopechain.sections;
         var localScope = sections[0].propertiesTreeOutline;
         var properties = [
             localScope, ["o", "__proto__", "__proto__"],
             localScope, ["d", "__proto__", "__proto__", "__proto__", "__proto__", "__proto__"]
         ];
-        frontend_expandProperties(testController, properties, frontend_completeDebuggerTest.bind(null, testController));
-    });
-}
-
-function frontend_expandProperties(testController, properties, callback)
-{
-    var index = 0;
-    function expandNextPath()
-    {
-        if (index === properties.length) {
-            callback();
-            return;
-        }
-        var parentTreeElement = properties[index++];
-        var path = properties[index++];
-        frontend_expandProperty(testController, parentTreeElement, path, 0, expandNextPath);
+        InspectorTest.expandProperties(properties, step3);
     }
-    testController.runAfterPendingDispatches(expandNextPath);
-}
 
-function frontend_expandProperty(testController, parentTreeElement, path, pathIndex, callback)
-{
-    if (pathIndex === path.length) {
-        testController.results.push("Expanded property: " + path.join("."));
-        callback();
-        return;
-    }
-    var name = path[pathIndex++];
-    var propertyTreeElement = frontend_findChildPropertyTreeElement(parentTreeElement, name);
-    if (!propertyTreeElement) {
-       testController.results.push("Failed to expand property: " + path.slice(0, pathIndex).join("."));
-       testController.notifyDone();
-       return;
-    }
-    propertyTreeElement.expand();
-    testController.runAfterPendingDispatches(function()
+    function step3()
     {
-        frontend_expandProperty(testController, propertyTreeElement, path, pathIndex, callback);
-    });
-}
-
-function frontend_findChildPropertyTreeElement(parent, childName)
-{
-    var children = parent.children;
-    for (var i = 0; i < children.length; i++) {
-        var treeElement = children[i];
-        var property = treeElement.property;
-        if (property.name === childName)
-            return treeElement;
+        InspectorTest.completeDebuggerTest();
     }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests that object's __proto__ property is present in object properties section when
 script is paused on a breakpoint.<a href="https://bugs.webkit.org/show_bug.cgi?id=41214">Bug 41214</a>
diff --git a/LayoutTests/inspector/debugger-step-in-expected.txt b/LayoutTests/inspector/debugger-step-in-expected.txt
index 78771ae..639e208 100644
--- a/LayoutTests/inspector/debugger-step-in-expected.txt
+++ b/LayoutTests/inspector/debugger-step-in-expected.txt
@@ -4,16 +4,18 @@ Debugger was enabled.
 Set timer for test function.
 Script execution paused.
 Call stack:
-    0) testFunction (debugger-step-in.html:12)
+    0) testFunction (debugger-step-in.html:14)
 Stepping into...
+Script execution resumed.
 Script execution paused.
 Call stack:
-    0) testFunction (debugger-step-in.html:13)
+    0) testFunction (debugger-step-in.html:15)
 Stepping into...
+Script execution resumed.
 Script execution paused.
 Call stack:
-    0) d (debugger-step-in.html:7)
-    1) testFunction (debugger-step-in.html:13)
-Resumed script execution.
-Disabled debugger.
+    0) d (debugger-step-in.html:8)
+    1) testFunction (debugger-step-in.html:15)
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-step-in.html b/LayoutTests/inspector/debugger-step-in.html
index 336a6e6..2593c90 100644
--- a/LayoutTests/inspector/debugger-step-in.html
+++ b/LayoutTests/inspector/debugger-step-in.html
@@ -1,59 +1,47 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function d() {
+function d()
+{
     var i = 10;
 }
 
-function testFunction() {
+function testFunction()
+{
     debugger;
     d();
-    notifyDone();
 }
 
-function doit()
+var test = function()
 {
-    evaluateInWebInspector("frontend_testStepIn", dumpArray);
-}
+    InspectorTest.startDebuggerTest(step1);
 
-function frontend_testStepIn(testController)
-{
-    testController.waitUntilDone();
-
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
     var stepCount = 0;
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2(callFrames)
     {
-        testController.results.push("Script execution paused.");
-        frontend_captureStackTrace(callFrames, testController);
-        if (stepCount == 2)
-            frontend_completeDebuggerTest(testController);
-        else {
-            testController.results.push("Stepping into...");
+        InspectorTest.captureStackTrace(callFrames);
+        if (stepCount < 2) {
+            InspectorTest.addResult("Stepping into...");
             document.getElementById("scripts-step-into").click();
-        }
+            InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, step2));
+        } else
+            InspectorTest.completeDebuggerTest();
         stepCount++;
-    }, true);
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests "step in" functionality in debugger.
 </p>
diff --git a/LayoutTests/inspector/debugger-step-out-expected.txt b/LayoutTests/inspector/debugger-step-out-expected.txt
index 1d89894..da2d0c4 100644
--- a/LayoutTests/inspector/debugger-step-out-expected.txt
+++ b/LayoutTests/inspector/debugger-step-out-expected.txt
@@ -4,12 +4,13 @@ Debugger was enabled.
 Set timer for test function.
 Script execution paused.
 Call stack:
-    0) d (debugger-step-out.html:8)
-    1) testFunction (debugger-step-out.html:12)
+    0) d (debugger-step-out.html:9)
+    1) testFunction (debugger-step-out.html:14)
 Stepping out...
+Script execution resumed.
 Script execution paused.
 Call stack:
-    0) testFunction (debugger-step-out.html:13)
-Resumed script execution.
-Disabled debugger.
+    0) testFunction (debugger-step-out.html:15)
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-step-out.html b/LayoutTests/inspector/debugger-step-out.html
index 02fec1a..8f00b14 100644
--- a/LayoutTests/inspector/debugger-step-out.html
+++ b/LayoutTests/inspector/debugger-step-out.html
@@ -1,62 +1,47 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function d() {
+function d()
+{
     debugger;
 }
 
-function testFunction() {
-    d();
-    notifyDone();
-}
-
-function doit()
+function testFunction()
 {
-    evaluateInWebInspector("frontend_testStepOut", dumpArray);
+    d();
 }
 
-function frontend_testStepOut(testController)
+var test = function()
 {
-    testController.waitUntilDone();
+    InspectorTest.startDebuggerTest(step1);
 
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2(callFrames)
     {
-        testController.results.push("Script execution paused.");
-        frontend_captureStackTrace(callFrames, testController);
-        testStepOut();
-    });
-
-    function testStepOut() {
-        frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
-        {
-            testController.results.push("Script execution paused.");
-            frontend_captureStackTrace(callFrames, testController);
-            frontend_completeDebuggerTest(testController);
-        });
-        testController.results.push("Stepping out...");
+        InspectorTest.captureStackTrace(callFrames);
+        InspectorTest.addResult("Stepping out...");
+        InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, step3));
         document.getElementById("scripts-step-out").click();
     }
+
+    function step3(callFrames)
+    {
+        InspectorTest.captureStackTrace(callFrames);
+        InspectorTest.completeDebuggerTest();
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests "step out" functionality in debugger.
 </p>
diff --git a/LayoutTests/inspector/debugger-step-over-expected.txt b/LayoutTests/inspector/debugger-step-over-expected.txt
index 8b70488..86943a9 100644
--- a/LayoutTests/inspector/debugger-step-over-expected.txt
+++ b/LayoutTests/inspector/debugger-step-over-expected.txt
@@ -4,18 +4,20 @@ Debugger was enabled.
 Set timer for test function.
 Script execution paused.
 Call stack:
-    0) d (debugger-step-over.html:12)
-    1) testFunction (debugger-step-over.html:17)
+    0) d (debugger-step-over.html:14)
+    1) testFunction (debugger-step-over.html:20)
 Stepping over...
+Script execution resumed.
 Script execution paused.
 Call stack:
-    0) d (debugger-step-over.html:13)
-    1) testFunction (debugger-step-over.html:17)
+    0) d (debugger-step-over.html:15)
+    1) testFunction (debugger-step-over.html:20)
 Stepping over...
+Script execution resumed.
 Script execution paused.
 Call stack:
-    0) d (debugger-step-over.html:14)
-    1) testFunction (debugger-step-over.html:17)
-Resumed script execution.
-Disabled debugger.
+    0) d (debugger-step-over.html:16)
+    1) testFunction (debugger-step-over.html:20)
+Script execution resumed.
+Debugger was disabled.
 
diff --git a/LayoutTests/inspector/debugger-step-over.html b/LayoutTests/inspector/debugger-step-over.html
index 8db4a9f..b23de05 100644
--- a/LayoutTests/inspector/debugger-step-over.html
+++ b/LayoutTests/inspector/debugger-step-over.html
@@ -1,63 +1,52 @@
 <html>
 <head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/debugger-test.js"></script>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
-function f() {
+function f()
+{
     var i = 10;
 }
 
-function d() {
+function d()
+{
     debugger;
     f();
 }
 
-function testFunction() {
-    d();
-    notifyDone();
-}
-
-function doit()
+function testFunction()
 {
-    evaluateInWebInspector("frontend_testStepIn", dumpArray);
+    d();
 }
 
-function frontend_testStepIn(testController)
+var test = function()
 {
-    testController.waitUntilDone();
+    InspectorTest.startDebuggerTest(step1);
 
-    WebInspector.showPanel("scripts");
-    frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
-
-    function debuggerWasEnabledCallback()
+    function step1()
     {
-        testController.results.push("Debugger was enabled.");
-        frontend_evaluateInConsole("setTimeout(testFunction, 0)", function(result)
-        {
-            testController.results.push("Set timer for test function.");
-        });
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
     }
 
     var stepCount = 0;
-    frontend_addSniffer(WebInspector, "pausedScript", function(callFrames)
+    function step2(callFrames)
     {
-        testController.results.push("Script execution paused.");
-        frontend_captureStackTrace(callFrames, testController);
-        if (stepCount == 2)
-            frontend_completeDebuggerTest(testController);
-        else {
-            testController.results.push("Stepping over...");
+        InspectorTest.captureStackTrace(callFrames);
+        if (stepCount < 2) {
+            InspectorTest.addResult("Stepping over...");
             document.getElementById("scripts-step-over").click();
-        }
+            InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, step2));
+        } else
+            InspectorTest.completeDebuggerTest();
         stepCount++;
-    }, true);
+    }
 }
 
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 Tests "step over" functionality in debugger.
 </p>
diff --git a/LayoutTests/inspector/dom-breakpoints-expected.txt b/LayoutTests/inspector/dom-breakpoints-expected.txt
index 93f1e9f..c85b71e 100644
--- a/LayoutTests/inspector/dom-breakpoints-expected.txt
+++ b/LayoutTests/inspector/dom-breakpoints-expected.txt
@@ -3,12 +3,18 @@ Tests DOM breakpoints. Bug 42886
 Debugger was enabled.
 Found dom node d0.
 Set subtree modified DOM breakpoint on d0.
-Paused at line 11 in appendElement
+Script execution paused.
+line: 11, function: appendElement
+Script execution resumed.
 Found dom node d1.
 Set attribute modified DOM breakpoint on d1.
-Paused at line 17 in modifyAttribute
+Script execution paused.
+line: 17, function: modifyAttribute
+Script execution resumed.
 Found dom node d1.
 Set node removed DOM breakpoint on d1.
-Paused at line 23 in removeElement
+Script execution paused.
+line: 23, function: removeElement
+Script execution resumed.
 Debugger was disabled.
 
diff --git a/LayoutTests/inspector/dom-breakpoints.html b/LayoutTests/inspector/dom-breakpoints.html
index fbb6532..1ae30d7 100644
--- a/LayoutTests/inspector/dom-breakpoints.html
+++ b/LayoutTests/inspector/dom-breakpoints.html
@@ -41,11 +41,11 @@ var test = function()
         InspectorTest.waitUntilPaused(step3.bind(null, node));
     }
 
-    function step3(node)
+    function step3(node, callFrames)
     {
+        InspectorTest.addResult("line: " + callFrames[0].line + ", function: " + callFrames[0].functionName);
         WebInspector.domBreakpointManager.removeBreakpointsForNode(node);
-        InspectorTest.resumeExecution();
-        findDOMNodeById("d1", step4);
+        InspectorTest.resumeExecution(findDOMNodeById.bind(null, "d1", step4));
     }
 
     function step4(node)
@@ -57,11 +57,11 @@ var test = function()
         InspectorTest.waitUntilPaused(step5.bind(null, node));
     }
 
-    function step5(node)
+    function step5(node, callFrames)
     {
+        InspectorTest.addResult("line: " + callFrames[0].line + ", function: " + callFrames[0].functionName);
         WebInspector.domBreakpointManager.removeBreakpointsForNode(node);
-        InspectorTest.resumeExecution();
-        findDOMNodeById("d1", step6);
+        InspectorTest.resumeExecution(findDOMNodeById.bind(null, "d1", step6));
     }
 
     function step6(node)
@@ -73,8 +73,9 @@ var test = function()
         InspectorTest.waitUntilPaused(step7.bind(null, node));
     }
 
-    function step7(node)
+    function step7(node, callFrames)
     {
+        InspectorTest.addResult("line: " + callFrames[0].line + ", function: " + callFrames[0].functionName);
         WebInspector.domBreakpointManager.removeBreakpointsForNode(node);
         InspectorTest.completeDebuggerTest();
     }
diff --git a/LayoutTests/inspector/extensions-api-expected.txt b/LayoutTests/inspector/extensions-api-expected.txt
index c07471b..a9fd2e6 100644
--- a/LayoutTests/inspector/extensions-api-expected.txt
+++ b/LayoutTests/inspector/extensions-api-expected.txt
@@ -1,5 +1,6 @@
 Tests public interface of WebInspector Extensions API
 
+Page reloaded.
 Started extension.
 Running tests...
 RUNNING TEST: extension_testAPI
diff --git a/LayoutTests/inspector/extensions-audits-api-expected.txt b/LayoutTests/inspector/extensions-audits-api-expected.txt
index 1072aa5..920b3c3 100644
--- a/LayoutTests/inspector/extensions-audits-api-expected.txt
+++ b/LayoutTests/inspector/extensions-audits-api-expected.txt
@@ -1,5 +1,6 @@
 Tests audits support in WebInspector Extensions API
 
+Page reloaded.
 Started extension.
 Running tests...
 RUNNING TEST: extension_testAuditsAPI
@@ -33,6 +34,6 @@ category.onAuditStarted fired, results dump follows:
     expanded : false
     addChild : <function>
 }
-All tests done.
   Extension audits
+All tests done.
 
diff --git a/LayoutTests/inspector/extensions-audits-expected.txt b/LayoutTests/inspector/extensions-audits-expected.txt
index a1eee73..e25f32c 100644
--- a/LayoutTests/inspector/extensions-audits-expected.txt
+++ b/LayoutTests/inspector/extensions-audits-expected.txt
@@ -1,12 +1,12 @@
 Tests audits support in WebInspector Extensions API
 
+Page reloaded.
 Started extension.
 Running tests...
 RUNNING TEST: extension_testAudits
 Added audit category.
 category.onAuditStarted fired
 failedCategory.onAuditStarted fired, throwing exception
-All tests done.
   Extension audits
     Failed rule (42)
      this rule always fails
@@ -25,4 +25,5 @@ All tests done.
     Passed rule
      this rule always passes ok
   Extension audits that fail
+All tests done.
 
diff --git a/LayoutTests/inspector/extensions-expected.txt b/LayoutTests/inspector/extensions-expected.txt
index 8319434..be5706c 100644
--- a/LayoutTests/inspector/extensions-expected.txt
+++ b/LayoutTests/inspector/extensions-expected.txt
@@ -1,5 +1,6 @@
 Tests WebInspector extension API
 
+Page reloaded.
 Started extension.
 Running tests...
 RUNNING TEST: extension_testCreatePanel
diff --git a/LayoutTests/inspector/report-protocol-errors.html b/LayoutTests/inspector/report-protocol-errors.html
index d0364b6..a5e7874 100644
--- a/LayoutTests/inspector/report-protocol-errors.html
+++ b/LayoutTests/inspector/report-protocol-errors.html
@@ -24,7 +24,8 @@ function test()
 
     function callback(message)
     {
-        InspectorTest.addResult(message);
+        if (numberOfReports < messages.length)
+            InspectorTest.addObject(message);
 
         if (++numberOfReports === messages.length)
             InspectorTest.completeTest();
diff --git a/LayoutTests/platform/chromium/inspector/debugger-step-in-expected.txt b/LayoutTests/platform/chromium/inspector/debugger-step-in-expected.txt
old mode 100755
new mode 100644
index 72af6e8..d752652
--- a/LayoutTests/platform/chromium/inspector/debugger-step-in-expected.txt
+++ b/LayoutTests/platform/chromium/inspector/debugger-step-in-expected.txt
@@ -1,18 +1,21 @@
-Tests "step in" functionality in debugger.
-
-Debugger was enabled.
-Set timer for test function.
-Script execution paused.
-Call stack:
-    0) testFunction (debugger-step-in.html:12)
-Stepping into...
-Script execution paused.
-Call stack:
-    0) testFunction (debugger-step-in.html:13)
-Stepping into...
-Script execution paused.
-Call stack:
-    0) d (debugger-step-in.html:8)
-    1) testFunction (debugger-step-in.html:13)
-Resumed script execution.
-Disabled debugger.
+Tests "step in" functionality in debugger.
+
+Debugger was enabled.
+Set timer for test function.
+Script execution paused.
+Call stack:
+    0) testFunction (debugger-step-in.html:14)
+Stepping into...
+Script execution resumed.
+Script execution paused.
+Call stack:
+    0) testFunction (debugger-step-in.html:15)
+Stepping into...
+Script execution resumed.
+Script execution paused.
+Call stack:
+    0) d (debugger-step-in.html:9)
+    1) testFunction (debugger-step-in.html:15)
+Script execution resumed.
+Debugger was disabled.
+

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list