2011-02-21 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 11:12:51 +0000 (11:12 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 11:12:51 +0000 (11:12 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: [Chromium] inspector/debugger/dom-breakpoints.html TIMEOUTs
        https://bugs.webkit.org/show_bug.cgi?id=54638

        * http/tests/inspector/change-iframe-src.html:
        * http/tests/inspector/debugger-test.js:
        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
        (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite.runner):
        (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite):
        (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
        (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack.step1):
        (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack):
        (initialize_DebuggerTest.InspectorTest.waitUntilResumed):
        (initialize_DebuggerTest.InspectorTest.resumeExecution):
        (initialize_DebuggerTest.InspectorTest.showScriptSource):
        (initialize_DebuggerTest.InspectorTest._showScriptSource):
        (initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
        (initialize_DebuggerTest.InspectorTest.expandProperties):
        * http/tests/inspector/elements-test.js:
        (initialize_ElementTest.InspectorTest.nodeWithId.processChildren):
        (initialize_ElementTest.InspectorTest.nodeWithId):
        (initialize_ElementTest.InspectorTest.selectNodeWithId.mycallback):
        (initialize_ElementTest.InspectorTest.selectNodeWithId):
        (initialize_ElementTest.InspectorTest.expandElementsTree.mycallback):
        (initialize_ElementTest.InspectorTest.expandElementsTree):
        (initialize_ElementTest):
        * http/tests/inspector/inspector-test.js:
        (initialize_InspectorTest.InspectorTest.evaluateInConsole):
        (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump.mycallback):
        (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump):
        (initialize_InspectorTest.InspectorTest.evaluateInPage.mycallback):
        (initialize_InspectorTest.InspectorTest.evaluateInPage):
        (initialize_InspectorTest.InspectorTest.evaluateInPageWithTimeout):
        (initialize_InspectorTest.InspectorTest.reloadPage):
        (initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
        (initialize_InspectorTest.InspectorTest.runTestSuite.runner):
        (initialize_InspectorTest.InspectorTest.runTestSuite):
        (initialize_InspectorTest.InspectorTest.safeWrap):
        * http/tests/inspector/resource-parameters.html:
        * inspector/console/console-assert.html:
        * inspector/console/console-trace-in-eval.html:
        * inspector/console/console-trace.html:
        * inspector/debugger/dom-breakpoints-expected.txt:
        * inspector/debugger/dom-breakpoints.html:
        * inspector/extensions/extensions-audits-tests.js:
        (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
        (initialize_ExtensionsAuditsTest):
        * inspector/styles/styles-iframe.html:
        * inspector/styles/styles-update-from-js.html:
        * inspector/timeline/timeline-network-resource.html:
        * inspector/timeline/timeline-script-tag-1.html:
        * inspector/timeline/timeline-script-tag-2.html:
        * platform/chromium/test_expectations.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/change-iframe-src.html
LayoutTests/http/tests/inspector/debugger-test.js
LayoutTests/http/tests/inspector/elements-test.js
LayoutTests/http/tests/inspector/inspector-test.js
LayoutTests/http/tests/inspector/resource-parameters.html
LayoutTests/inspector/console/console-assert.html
LayoutTests/inspector/console/console-trace-in-eval.html
LayoutTests/inspector/console/console-trace.html
LayoutTests/inspector/debugger/dom-breakpoints-expected.txt
LayoutTests/inspector/debugger/dom-breakpoints.html
LayoutTests/inspector/extensions/extensions-audits-tests.js
LayoutTests/inspector/styles/styles-iframe.html
LayoutTests/inspector/styles/styles-update-from-js.html
LayoutTests/inspector/timeline/timeline-network-resource.html
LayoutTests/inspector/timeline/timeline-script-tag-1.html
LayoutTests/inspector/timeline/timeline-script-tag-2.html
LayoutTests/platform/chromium/test_expectations.txt

index 15f0a89c1724cb650f8980a0b54a1f7c64286845..c0a5e8c049d85c6b4af8d28b4072c7a18a16dbd6 100644 (file)
@@ -1,3 +1,62 @@
+2011-02-21  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [Chromium] inspector/debugger/dom-breakpoints.html TIMEOUTs
+        https://bugs.webkit.org/show_bug.cgi?id=54638
+
+        * http/tests/inspector/change-iframe-src.html:
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
+        (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite.runner):
+        (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite):
+        (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
+        (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack.step1):
+        (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack):
+        (initialize_DebuggerTest.InspectorTest.waitUntilResumed):
+        (initialize_DebuggerTest.InspectorTest.resumeExecution):
+        (initialize_DebuggerTest.InspectorTest.showScriptSource):
+        (initialize_DebuggerTest.InspectorTest._showScriptSource):
+        (initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
+        (initialize_DebuggerTest.InspectorTest.expandProperties):
+        * http/tests/inspector/elements-test.js:
+        (initialize_ElementTest.InspectorTest.nodeWithId.processChildren):
+        (initialize_ElementTest.InspectorTest.nodeWithId):
+        (initialize_ElementTest.InspectorTest.selectNodeWithId.mycallback):
+        (initialize_ElementTest.InspectorTest.selectNodeWithId):
+        (initialize_ElementTest.InspectorTest.expandElementsTree.mycallback):
+        (initialize_ElementTest.InspectorTest.expandElementsTree):
+        (initialize_ElementTest):
+        * http/tests/inspector/inspector-test.js:
+        (initialize_InspectorTest.InspectorTest.evaluateInConsole):
+        (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump.mycallback):
+        (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump):
+        (initialize_InspectorTest.InspectorTest.evaluateInPage.mycallback):
+        (initialize_InspectorTest.InspectorTest.evaluateInPage):
+        (initialize_InspectorTest.InspectorTest.evaluateInPageWithTimeout):
+        (initialize_InspectorTest.InspectorTest.reloadPage):
+        (initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
+        (initialize_InspectorTest.InspectorTest.runTestSuite.runner):
+        (initialize_InspectorTest.InspectorTest.runTestSuite):
+        (initialize_InspectorTest.InspectorTest.safeWrap):
+        * http/tests/inspector/resource-parameters.html:
+        * inspector/console/console-assert.html:
+        * inspector/console/console-trace-in-eval.html:
+        * inspector/console/console-trace.html:
+        * inspector/debugger/dom-breakpoints-expected.txt:
+        * inspector/debugger/dom-breakpoints.html:
+        * inspector/extensions/extensions-audits-tests.js:
+        (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
+        (initialize_ExtensionsAuditsTest):
+        * inspector/styles/styles-iframe.html:
+        * inspector/styles/styles-update-from-js.html:
+        * inspector/timeline/timeline-network-resource.html:
+        * inspector/timeline/timeline-script-tag-1.html:
+        * inspector/timeline/timeline-script-tag-2.html:
+        * platform/chromium/test_expectations.txt:
+
 2011-02-21  Alejandro G. Castro  <alex@igalia.com>
 
         Fixed typo in gtk Skipped list.
index 4fb8766169172d74ac7d901a0260e943e5ed85d2..b2ee8ee02629f8210ea8099965b05578f31f59dc 100644 (file)
@@ -21,7 +21,7 @@ function test()
     function step1(node)
     {
         node.setAttribute("src", "http://localhost:8000/inspector/resources/iframe-from-different-domain-data.html");
-        InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
     }
 
     function step2()
index 600484037a37b032028ef786d3947d38bf81aef2..caf448c754beee1e735697299d75db6a818bedd5 100644 (file)
@@ -8,16 +8,16 @@ InspectorTest.startDebuggerTest = function(callback, quiet)
     if (WebInspector.panels.scripts._debuggerEnabled)
         startTest();
     else {
-        InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasEnabled", startTest);
+        InspectorTest.addSniffer(WebInspector.panels.scripts, "debuggerWasEnabled", startTest);
         WebInspector.panels.scripts._toggleDebugging(false);
     }
 
     function startTest()
     {
         InspectorTest.addResult("Debugger was enabled.");
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "_pausedScript", InspectorTest._pausedScript, true);
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "_resumedScript", InspectorTest._resumedScript, true);
-        callback();
+        InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", InspectorTest._pausedScript, true);
+        InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", InspectorTest._resumedScript, true);
+        InspectorTest.safeWrap(callback)();
     }
 };
 
@@ -35,7 +35,7 @@ InspectorTest.completeDebuggerTest = function()
         if (!scriptsPanel._debuggerEnabled)
             completeTest();
         else {
-            InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasDisabled", completeTest);
+            InspectorTest.addSniffer(WebInspector.panels.scripts, "debuggerWasDisabled", completeTest);
             scriptsPanel._toggleDebugging(false);
         }
     }
@@ -47,6 +47,23 @@ InspectorTest.completeDebuggerTest = function()
     }
 };
 
+InspectorTest.runDebuggerTestSuite = function(testSuite)
+{
+    var testSuiteTests = testSuite.slice();
+
+    function runner()
+    {
+        if (!testSuiteTests.length) {
+            InspectorTest.completeDebuggerTest();
+            return;
+        }
+
+        InspectorTest.safeWrap(testSuiteTests.shift())(runner, runner);
+    }
+
+    InspectorTest.startDebuggerTest(runner);
+}
+
 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback)
 {
     InspectorTest.evaluateInConsole("setTimeout(testFunction, 0)");
@@ -56,14 +73,30 @@ InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback)
 
 InspectorTest.waitUntilPaused = function(callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     if (InspectorTest._callFrames)
         callback(InspectorTest._callFrames);
     else
         InspectorTest._waitUntilPausedCallback = callback;
 };
 
+InspectorTest.waitUntilPausedAndDumpStack = function(callback)
+{
+    InspectorTest.waitUntilPaused(step1);
+
+    function step1(callFrames)
+    {
+        InspectorTest.captureStackTrace(callFrames);
+        InspectorTest.addResult(WebInspector.panels.scripts.sidebarPanes.callstack.bodyElement.lastChild.innerText);
+        InspectorTest.resumeExecution(InspectorTest.safeWrap(callback));
+    }
+};
+
 InspectorTest.waitUntilResumed = function(callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     if (!InspectorTest._callFrames)
         callback();
     else
@@ -74,8 +107,7 @@ InspectorTest.resumeExecution = function(callback)
 {
     if (WebInspector.panels.scripts.paused)
         WebInspector.panels.scripts._togglePause();
-    if (callback)
-        InspectorTest.waitUntilResumed(callback);
+    InspectorTest.waitUntilResumed(callback);
 };
 
 InspectorTest.captureStackTrace = function(callFrames)
@@ -118,9 +150,9 @@ InspectorTest._resumedScript = function()
 InspectorTest.showScriptSource = function(scriptName, callback)
 {
     if (InspectorTest._scriptsAreParsed([scriptName]))
-        InspectorTest._showScriptSource(scriptName, callback);
+        InspectorTest._showScriptSource(scriptName, InspectorTest.safeWrap(callback));
      else
-        InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
+        InspectorTest.addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
 };
 
 InspectorTest._scriptsAreParsed = function(scripts)
@@ -169,7 +201,7 @@ InspectorTest._showScriptSource = function(scriptName, callback)
     if (sourceFrame._content)
         callback(sourceFrame);
     else
-        InspectorTest._addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
+        InspectorTest.addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
 };
 
 InspectorTest.expandProperties = function(properties, callback)
@@ -178,7 +210,7 @@ InspectorTest.expandProperties = function(properties, callback)
     function expandNextPath()
     {
         if (index === properties.length) {
-            callback();
+            InspectorTest.safeWrap(callback)();
             return;
         }
         var parentTreeElement = properties[index++];
index 3e7f7c38e7ef973c8b8eaf23d2930f4e0ce8f3ce..2cfc69aace6e23ce2116348b0cb235138dc4d124 100755 (executable)
@@ -3,6 +3,7 @@ var initialize_ElementTest = function() {
 
 InspectorTest.nodeWithId = function(idValue, callback)
 {
+    callback = InspectorTest.safeWrap(callback);
     var result = null;
     var topLevelChildrenRequested = false;
     var pendingRequests = 0;
@@ -16,8 +17,7 @@ InspectorTest.nodeWithId = function(idValue, callback)
             var childNode = children[i];
             if (childNode.getAttribute("id") === idValue) {
                 result = childNode;
-                if (callback)
-                    callback(result);
+                callback(result);
                 return;
             }
             pendingRequests++;
@@ -27,7 +27,7 @@ InspectorTest.nodeWithId = function(idValue, callback)
         if (topLevel)
             topLevelChildrenRequested = true;
         if (topLevelChildrenRequested && !result && !pendingRequests)
-            callback(null);    
+            callback(null);
     }
     pendingRequests++;
     WebInspector.domAgent.getChildNodesAsync(WebInspector.domAgent.document, processChildren.bind(this, true));
@@ -46,12 +46,12 @@ InspectorTest.expandedNodeWithId = function(idValue)
 
 InspectorTest.selectNodeWithId = function(idValue, callback)
 {
+    callback = InspectorTest.safeWrap(callback);
     function mycallback(node)
     {
         if (node)
             WebInspector.updateFocusedNode(node.id);
-        if (callback)
-            InspectorTest.runAfterPendingDispatches(callback.bind(null, node));
+        InspectorTest.runAfterPendingDispatches(callback.bind(null, node));
     }
     InspectorTest.nodeWithId(idValue, mycallback);
 };
@@ -172,6 +172,8 @@ InspectorTest.dumpElementsTree = function(rootNode)
 
 InspectorTest.expandElementsTree = function(callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     function expand(treeItem)
     {
         var children = treeItem.children;
@@ -185,8 +187,7 @@ InspectorTest.expandElementsTree = function(callback)
     {
         WebInspector.panels.elements.updateModifiedNodes();
         expand(WebInspector.panels.elements.treeOutline);
-        if (callback)
-            callback();
+        callback();
     }
     InspectorTest.nodeWithId(/nonstring/, mycallback);
 };
@@ -203,4 +204,4 @@ InspectorTest.dumpDOMAgentTree = function()
     dump(WebInspector.domAgent.document, "", WebInspector.domAgent.document.id - 1);
 };
 
-};
\ No newline at end of file
+};
index a925b118e8cada1b234f2b993250206fabe1a659..91af805927505da218ce325c2e0e88e8cba85a25 100644 (file)
@@ -10,42 +10,45 @@ InspectorTest.completeTest = function()
 
 InspectorTest.evaluateInConsole = function(code, callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     WebInspector.console.visible = true;
     WebInspector.console.prompt.text = code;
     var event = document.createEvent("KeyboardEvent");
     event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
     WebInspector.console.promptElement.dispatchEvent(event);
-    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
         function(commandResult) {
-            if (callback)
-                callback(commandResult.toMessageElement().textContent);
+            callback(commandResult.toMessageElement().textContent);
         });
 }
 
 InspectorTest.evaluateInConsoleAndDump = function(code, callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     function mycallback(text)
     {
         InspectorTest.addResult(code + " = " + text);
-        if (callback)
-            callback(text);
+        callback(text);
     }
     InspectorTest.evaluateInConsole(code, mycallback);
 }
 
 InspectorTest.evaluateInPage = function(code, callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     function mycallback(result)
     {
-        if (callback)
-            callback(WebInspector.RemoteObject.fromPayload(result));
+        callback(WebInspector.RemoteObject.fromPayload(result));
     }
     RuntimeAgent.evaluate(code, "console", false, mycallback);
 }
 
-InspectorTest.evaluateInPageWithTimeout = function(code, callback)
+InspectorTest.evaluateInPageWithTimeout = function(code)
 {
-    InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'))", callback);
+    InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'))");
 }
 
 InspectorTest.addResult = function(text)
@@ -105,7 +108,7 @@ InspectorTest.addObject = function(object, nondeterministicProps, prefix, firstL
 
 InspectorTest.reloadPage = function(callback)
 {
-    InspectorTest._reloadPageCallback = callback;
+    InspectorTest._reloadPageCallback = InspectorTest.safeWrap(callback);
 
     if (WebInspector.panels.network)
         WebInspector.panels.network._reset();
@@ -125,6 +128,8 @@ InspectorTest.pageReloaded = function()
 
 InspectorTest.runAfterPendingDispatches = function(callback)
 {
+    callback = InspectorTest.safeWrap(callback);
+
     WebInspector.TestController.prototype.runAfterPendingDispatches(callback);
 }
 
@@ -145,15 +150,35 @@ InspectorTest.runTestSuite = function(testSuite)
             InspectorTest.completeTest();
             return;
         }
-        var nextTestFunction = testSuiteTests.shift();
-        nextTestFunction(runner);
+        InspectorTest.safeWrap(testSuiteTests.shift())(runner, runner);
     }
-
     runner();
 }
 
-InspectorTest._addSniffer = function(receiver, methodName, override, opt_sticky)
+InspectorTest.safeWrap = function(func, onexception)
+{
+    function result()
+    {
+        if (!func)
+            return;
+        var wrapThis = this;
+        try {
+            return func.apply(wrapThis, arguments);
+        } catch(e) {
+            InspectorTest.addResult("Exception while running: " + func + "\n" + e);
+            if (onexception)
+                InspectorTest.safeWrap(onexception)();
+            else
+                InspectorTest.completeTest();
+        }
+    }
+    return result;
+}
+
+InspectorTest.addSniffer = function(receiver, methodName, override, opt_sticky)
 {
+    override = InspectorTest.safeWrap(override);
+
     var original = receiver[methodName];
     if (typeof original !== "function")
         throw ("Cannot find method to override: " + methodName);
index ccd2e24cf834b75d3a5f03da60bfc342dea085a8..9a6e0e634ae288b34b35a061a2871501c9a12d18 100644 (file)
@@ -12,7 +12,7 @@ function submit()
 function test()
 {
     InspectorTest.evaluateInPage("submit()");
-    InspectorTest._addSniffer(WebInspector.NetworkDispatcher.prototype, "didFinishLoading", dumpHAR);
+    InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "didFinishLoading", dumpHAR);
 
     function dumpHAR()
     {
index f33fd049c541e1f6a020d946b1de8a57da307ab2..dcb9957ac7ae53189c8ac421fea8524435fe9d7b 100755 (executable)
@@ -27,7 +27,7 @@ function test()
         }
     }
     InspectorTest.evaluateInPage("setTimeout(a, 0)");
-    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback, true);
+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback, true);
 }
 
 </script>
index 5467e4b2f247a6c38c399b3b3341523f916c9a5d..003f243dd4f01eeaa61a35e8f4ff8a94cad1574d 100755 (executable)
@@ -35,7 +35,7 @@ function test()
         InspectorTest.completeTest();
     }
     InspectorTest.evaluateInPage("doEvalSource()");
-    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
 }
 
 </script>
index 02a957f065d7f74a4fd0ff3f2f59a889303c2114..be2c2f1ebb86146b3630170688437c8a0004e2b9 100755 (executable)
@@ -22,7 +22,7 @@ function test()
         InspectorTest.completeTest();
     }
     InspectorTest.evaluateInPage("setTimeout(a, 0)");
-    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
 }
 
 </script>
index 636e0ed86456abdcd94d76dd776f44d9dfb95a08..b7474656b75a7f1f1b20e70010e400fca466ca49 100644 (file)
@@ -6,7 +6,7 @@ Set 'Subtree Modified' DOM breakpoint on rootElement.
 Append childElement to rootElement.
 Script execution paused.
 Call stack:
-    0) appendElement (dom-breakpoints.html:11)
+    0) appendElement (dom-breakpoints.html:12)
     1)  (:1)
 Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to that node.
 Script execution resumed.
@@ -14,7 +14,7 @@ Test that 'Subtree Modified' breakpoint is hit when appending a grandchild.
 Append grandchildElement to childElement.
 Script execution paused.
 Call stack:
-    0) appendElement (dom-breakpoints.html:11)
+    0) appendElement (dom-breakpoints.html:12)
     1)  (:1)
 Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to its descendant div#childElement.
 Script execution resumed.
@@ -22,7 +22,7 @@ Test that 'Subtree Modified' breakpoint is hit when removing a child.
 Remove grandchildElement.
 Script execution paused.
 Call stack:
-    0) removeElement (dom-breakpoints.html:23)
+    0) removeElement (dom-breakpoints.html:24)
     1)  (:1)
 Paused on a "Subtree Modified" breakpoint set on div#rootElement, because its descendant div#grandchildElement was removed.
 Script execution resumed.
@@ -31,17 +31,16 @@ Set 'Attribute Modified' DOM breakpoint on rootElement.
 Modify rootElement className.
 Script execution paused.
 Call stack:
-    0) modifyAttribute (dom-breakpoints.html:17)
+    0) modifyAttribute (dom-breakpoints.html:18)
     1)  (:1)
 Paused on a "Attribute Modified" breakpoint set on div#rootElement.
 Script execution resumed.
 Test that 'Node Removed' breakpoint is hit when removing a node.
-Append elementToRemove to rootElement.
 Set 'Node Removed' DOM breakpoint on elementToRemove.
 Remove elementToRemove.
 Script execution paused.
 Call stack:
-    0) removeElement (dom-breakpoints.html:23)
+    0) removeElement (dom-breakpoints.html:24)
     1)  (:1)
 Paused on a "Node Removed" breakpoint set on div#elementToRemove.
 Script execution resumed.
@@ -51,7 +50,7 @@ Page reloaded.
 Append childElement to rootElement.
 Script execution paused.
 Call stack:
-    0) appendElement (dom-breakpoints.html:11)
+    0) appendElement (dom-breakpoints.html:12)
     1)  (:1)
 Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to that node.
 Script execution resumed.
index dd7b40b996da0a6604285c2e5ec76193054339c0..b6426f785eb8e83fcd68c19e7e893ac17ce75d7e 100644 (file)
@@ -1,6 +1,7 @@
 <html>
 <head>
 <script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/elements-test.js"></script>
 <script src="../../http/tests/inspector/debugger-test.js"></script>
 <script>
 
@@ -23,134 +24,100 @@ function removeElement(elementId)
     element.parentNode.removeChild(element);
 }
 
-var test = function()
+function test()
 {
     var rootElement;
-    testInsertChild = {};
-    testInsertChild.step1 = function()
-    {
-        InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a child.");
-        InspectorTest.nodeWithId("rootElement", testInsertChild.step2);
-    };
-    testInsertChild.step2 = function(node)
-    {
-        rootElement = node;
-        WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
-        InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
-        InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
-        InspectorTest.addResult("Append childElement to rootElement.");
-        InspectorTest.waitUntilPaused(testInsertChild.step3);
-    };
-    testInsertChild.step3 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        InspectorTest.resumeExecution(testInsertGrandchild.step1);
-    };
-
-    var testInsertGrandchild = {};
-    testInsertGrandchild.step1 = function()
-    {
-        InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a grandchild.");
-        InspectorTest.evaluateInPageWithTimeout("appendElement('childElement', 'grandchildElement')");
-        InspectorTest.addResult("Append grandchildElement to childElement.");
-        InspectorTest.waitUntilPaused(testInsertGrandchild.step2);
-    }
-    testInsertGrandchild.step2 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        InspectorTest.resumeExecution(testRemoveChild.step1);
-    }
-
-    var testRemoveChild = {};
-    testRemoveChild.step1 = function()
-    {
-        InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when removing a child.");
-        InspectorTest.evaluateInPageWithTimeout("removeElement('grandchildElement')");
-        InspectorTest.addResult("Remove grandchildElement.");
-        InspectorTest.waitUntilPaused(testRemoveChild.step2);
-
-    }
-    testRemoveChild.step2 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();
-        InspectorTest.resumeExecution(testModifyAttribute.step1);
-    }
-
-    var testModifyAttribute = {};
-    testModifyAttribute.step1 = function()
-    {
-        InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute.");
-        WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);
-        InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement.");
-        InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')");
-        InspectorTest.addResult("Modify rootElement className.");
-        InspectorTest.waitUntilPaused(testModifyAttribute.step2.bind(null));
-    }
-    testModifyAttribute.step2 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();
-        InspectorTest.resumeExecution(testRemoveNode.step1);
-    }
-
-    var testRemoveNode = {};
-    testRemoveNode.step1 = function()
-    {
-        InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit when removing a node.");
-        InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'elementToRemove')", testRemoveNode.step2);
-    }
-    testRemoveNode.step2 = function()
-    {
-        InspectorTest.addResult("Append elementToRemove to rootElement.");
-        InspectorTest.nodeWithId("elementToRemove", testRemoveNode.step3);
-    }
-    testRemoveNode.step3 = function(node)
-    {
-        WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);
-        InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
-        InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
-        InspectorTest.addResult("Remove elementToRemove.");
-        InspectorTest.waitUntilPaused(testRemoveNode.step4);
-    }
-    testRemoveNode.step4 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        InspectorTest.resumeExecution(testReload.step1);
-    }
-
-    var testReload= {};
-    testReload.step1 = function()
-    {
-        InspectorTest.addResult("Test that DOM breakpoints are persisted between page reloads.");
-        InspectorTest.nodeWithId("rootElement", testReload.step2);
-    }
-    testReload.step2 = function(node)
-    {
-        WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
-        InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
-        InspectorTest.reloadPage(testReload.step3);
-    }
-    testReload.step3 = function()
-    {
-        InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
-        InspectorTest.addResult("Append childElement to rootElement.");
-        InspectorTest.waitUntilPaused(testReload.step4);
-    }
-    testReload.step4 = function(callFrames)
-    {
-        dumpStatus(callFrames);
-        InspectorTest.completeDebuggerTest();
-    }
-
-    function dumpStatus(callFrames)
-    {
-        InspectorTest.captureStackTrace(callFrames);
-        InspectorTest.addResult(WebInspector.panels.scripts.sidebarPanes.callstack.bodyElement.lastChild.innerText);
-    }
-
-    InspectorTest.startDebuggerTest(testInsertChild.step1);
-};
+    InspectorTest.runDebuggerTestSuite([
+        function testInsertChild(next)
+        {
+            InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a child.");
+            InspectorTest.nodeWithId("rootElement", step2);
+
+            function step2(node)
+            {
+                rootElement = node;
+                WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
+                InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
+                InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
+                InspectorTest.addResult("Append childElement to rootElement.");
+                InspectorTest.waitUntilPausedAndDumpStack(next);
+            }
+        },
+
+        function testInsertGrandchild(next)
+        {
+            InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a grandchild.");
+            InspectorTest.evaluateInPageWithTimeout("appendElement('childElement', 'grandchildElement')");
+            InspectorTest.addResult("Append grandchildElement to childElement.");
+            InspectorTest.waitUntilPausedAndDumpStack(next);
+        },
+
+        function testRemoveChild(next)
+        {
+            InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when removing a child.");
+            InspectorTest.evaluateInPageWithTimeout("removeElement('grandchildElement')");
+            InspectorTest.addResult("Remove grandchildElement.");
+            InspectorTest.waitUntilPausedAndDumpStack(step2);
+
+            function step2()
+            {
+                rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();
+                next();
+            }
+        },
+
+        function testModifyAttribute(next)
+        {
+            InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute.");
+            WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);
+            InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement.");
+            InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')");
+            InspectorTest.addResult("Modify rootElement className.");
+            InspectorTest.waitUntilPausedAndDumpStack(step2);
+    
+            function step2(callFrames)
+            {
+                rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();
+                next();
+            }
+        },
+
+        function testRemoveNode(next)
+        {
+            InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit when removing a node.");
+            InspectorTest.nodeWithId("elementToRemove", step2);
+
+            function step2(node)
+            {
+                WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);
+                InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
+                InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
+                InspectorTest.addResult("Remove elementToRemove.");
+                InspectorTest.waitUntilPausedAndDumpStack(next);
+            }
+        },
+
+        function testReload(next)
+        {
+            InspectorTest.addResult("Test that DOM breakpoints are persisted between page reloads.");
+            InspectorTest.nodeWithId("rootElement", step2);
+
+            function step2(node)
+            {
+                WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
+                InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
+                InspectorTest.reloadPage(step3);
+            }
+
+            function step3()
+            {
+                InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
+                InspectorTest.addResult("Append childElement to rootElement.");
+                InspectorTest.waitUntilPausedAndDumpStack(next);
+            }
+        }
+    ]);
+}
 
 </script>
 </head>
@@ -159,7 +126,10 @@ var test = function()
 <p>
 Tests DOM breakpoints. <a href="https://bugs.webkit.org/show_bug.cgi?id=42886">Bug 42886</a>
 </p>
-<div id="rootElement"></div>
+
+<div id="rootElement">
+<div id="elementToRemove"></div>
+</div>
+
 </body>
 </html>
-
index b2064fc7372e0eb9db368e5145024ff0dd8ff829..92d3d4373622be8b14ea0a7a6adf5fe4f1144699 100644 (file)
@@ -23,7 +23,7 @@ var initialize_ExtensionsAuditsTest = function()
             InspectorTest.collectAuditResults();
             port.postMessage("");
         }
-        InspectorTest._addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
+        InspectorTest.addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
 
         launcherView._launchButtonClicked();
     }
index 5a023cae867e6c190470e00f78f71a3165152c75..157aa18f8ccb9c5cf6bc95f64ab01402a0cdad7b 100755 (executable)
@@ -19,7 +19,7 @@ function loadIframe()
 function test()
 {
     InspectorTest.evaluateInPage("loadIframe()");
-    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step0);
+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step0);
 
     function step0()
     {
index 8f5a27e32614687b6ed73d930d8ef19f486b6e56..f885ab9e7a3e7d526f1f470777eab7e33b641fc0 100755 (executable)
@@ -28,7 +28,7 @@ function test()
     function step0()
     {
         InspectorTest.evaluateInPage("modifyStyleAttribute()");
-        InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     }
 
     // Set style via cssText.
@@ -40,7 +40,7 @@ function test()
         // Inhibit the second Styles pane update from step0().
         function callback()
         {
-            InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
+            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
         }
 
         InspectorTest.evaluateInPage("modifyCssText()", callback);
@@ -53,7 +53,7 @@ function test()
         dumpAttributeAndStyles();
 
         InspectorTest.evaluateInPage("modifyParsedAttributes()");
-        InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     }
 
     // Finish the test.
index 2634074856093b18e8f11ec3bea6389ee8f71feb..1054b70ca6751bd89fe8cb36cc935ed7e40bb5f6 100644 (file)
@@ -23,7 +23,7 @@ function test()
     function step1()
     {
         InspectorTest.evaluateInPage("performActions()");
-        InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
     }
 
     function step2()
index 88260440123f0c7205e7b2ef146d4cea68bee4c2..824a5c02fd2bd0a28ab7d2d3fd1ddffddc215635 100644 (file)
@@ -17,7 +17,7 @@ function test()
     function step1()
     {
         InspectorTest.evaluateInPage("performActions()");
-        InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
     }
 
     function step2()
index 6f896337c00b22e3ef2822a6c348225af6fec858..4cdd7d4eba0ac85ed05fcf311c95be49aef9f72d 100644 (file)
@@ -16,7 +16,7 @@ function test()
     InspectorAgent.startTimelineProfiler(step1);
     function step1()
     {
-        InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
         InspectorTest.evaluateInPage("performActions()");
     }
 
index 523d01c3985218250df8532a6b4a6622acdbb002..7e920a19141043e663c8c27332c26681e4780505 100755 (executable)
@@ -3430,8 +3430,6 @@ BUGWK54499 LINUX : svg/transforms/text-with-pattern-with-svg-transform.svg = IMA
 
 BUGWK54472 : media/audio-delete-while-slider-thumb-clicked.html = TIMEOUT
 
-BUGWK54638 SKIP : inspector/debugger/dom-breakpoints.html = TIMEOUT
-
 BUGWK54387 : fast/js/kde/math.html = TEXT
 
 // Flaky