[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:25:25 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 92c9cfa22ac9c87ba72f21b85afb66e5f301cf7b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 23 09:49:29 2010 +0000

    2010-08-23  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: add DOM breakpoints test
            https://bugs.webkit.org/show_bug.cgi?id=44251
    
            * http/tests/inspector/debugger-test2.js: Added.
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
            (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
            (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.completeTest):
            (initialize_DebuggerTest.InspectorTest.completeDebuggerTest):
            (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
            (initialize_DebuggerTest.InspectorTest.resumeExecution):
            (initialize_DebuggerTest.InspectorTest.showScriptSource):
            (initialize_DebuggerTest.InspectorTest._scriptsAreParsed):
            (initialize_DebuggerTest.InspectorTest._showScriptSource):
            (initialize_DebuggerTest):
            * http/tests/inspector/inspector-test2.js:
            (initialize_InspectorTest):
            (initialize_InspectorTest.):
            (runTest.runTestInFrontend):
            (runTest):
            * inspector/debugger-breakpoints-not-activated-on-reload.html:
            * inspector/dom-breakpoints-expected.txt: Added.
            * inspector/dom-breakpoints.html: Added.
            * platform/gtk/Skipped:
            * platform/mac/Skipped:
            * platform/qt/Skipped:
            * platform/win/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65799 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ea15d66..c9969f8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,34 @@
+2010-08-23  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: add DOM breakpoints test
+        https://bugs.webkit.org/show_bug.cgi?id=44251
+
+        * http/tests/inspector/debugger-test2.js: Added.
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.completeTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
+        (initialize_DebuggerTest.InspectorTest.resumeExecution):
+        (initialize_DebuggerTest.InspectorTest.showScriptSource):
+        (initialize_DebuggerTest.InspectorTest._scriptsAreParsed):
+        (initialize_DebuggerTest.InspectorTest._showScriptSource):
+        (initialize_DebuggerTest):
+        * http/tests/inspector/inspector-test2.js:
+        (initialize_InspectorTest):
+        (initialize_InspectorTest.):
+        (runTest.runTestInFrontend):
+        (runTest):
+        * inspector/debugger-breakpoints-not-activated-on-reload.html:
+        * inspector/dom-breakpoints-expected.txt: Added.
+        * inspector/dom-breakpoints.html: Added.
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2010-08-23  Philippe Normand  <pnormand at igalia.com>
 
         Unreviewed, skipping more media tests
diff --git a/LayoutTests/http/tests/inspector/debugger-test2.js b/LayoutTests/http/tests/inspector/debugger-test2.js
new file mode 100644
index 0000000..55f5036
--- /dev/null
+++ b/LayoutTests/http/tests/inspector/debugger-test2.js
@@ -0,0 +1,111 @@
+var initialize_DebuggerTest = function() {
+
+InspectorTest.startDebuggerTest = function(callback)
+{
+    if (WebInspector.panels.scripts._debuggerEnabled)
+        startTest();
+    else {
+        InspectorTest._addSniffer(WebInspector, "debuggerWasEnabled", startTest);
+        WebInspector.panels.scripts._toggleDebugging(false);
+    }
+
+    function startTest()
+    {
+        InspectorTest.addResult("Debugger was enabled.");
+        callback();
+    }
+}
+
+InspectorTest.completeDebuggerTest = function()
+{
+    var scriptsPanel = WebInspector.panels.scripts;
+
+    if (!scriptsPanel.breakpointsActivated)
+        scriptsPanel.toggleBreakpointsButton.element.click();
+
+    InspectorTest.resumeExecution();
+
+    if (!scriptsPanel._debuggerEnabled)
+        completeTest();
+    else {
+        InspectorTest._addSniffer(WebInspector, "debuggerWasDisabled", completeTest);
+        scriptsPanel._toggleDebugging(false);
+    }
+
+    function completeTest()
+    {
+        InspectorTest.addResult("Debugger was disabled.");
+        InspectorTest.completeTest();
+    }
+};
+
+InspectorTest.waitUntilPaused = function(callback)
+{
+    InspectorTest._addSniffer(WebInspector, "pausedScript", callback);
+};
+
+InspectorTest.resumeExecution = function()
+{
+    if (WebInspector.panels.scripts.paused)
+        WebInspector.panels.scripts._togglePause();
+};
+
+InspectorTest.showScriptSource = function(scriptName, callback)
+{
+    if (InspectorTest._scriptsAreParsed([scriptName]))
+        InspectorTest._showScriptSource(scriptName, callback);
+    else
+        InspectorTest._addSniffer(WebInspector, "parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
+};
+
+InspectorTest._scriptsAreParsed = function(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 === scripts[i]) {
+                found = true;
+                break;
+            }
+        }
+        if (!found)
+            return false;
+    }
+    return true;
+};
+
+InspectorTest._showScriptSource = function(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;
+    callback = callback.bind(null, view);
+    if (!view.sourceFrame._loaded)
+        InspectorTest._addSniffer(view.sourceFrame, "setContent", callback);
+    else
+        callback();
+};
+
+}
diff --git a/LayoutTests/http/tests/inspector/inspector-test2.js b/LayoutTests/http/tests/inspector/inspector-test2.js
index d4580ae..7f5ffd1 100644
--- a/LayoutTests/http/tests/inspector/inspector-test2.js
+++ b/LayoutTests/http/tests/inspector/inspector-test2.js
@@ -1,19 +1,20 @@
-var initializeInspectorTest = (function(completeTestCallId) {
+var initialize_InspectorTest = (function() {
 
 var results = [];
 
 InspectorTest.completeTest = function()
 {
-    InspectorBackend.didEvaluateForTestInFrontend(completeTestCallId, JSON.stringify(results));
+    InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, JSON.stringify(results));
 };
 
 InspectorTest.evaluateInConsole = function(code, callback)
 {
     WebInspector.console.visible = true;
     WebInspector.console.prompt.text = code;
-    WebInspector.console.promptElement.dispatchEvent(createKeyEvent("Enter"));
-
-    addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
+    var event = document.createEvent("KeyboardEvent");
+    event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
+    WebInspector.console.promptElement.dispatchEvent(event);
+    InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
         function(commandResult) {
             if (callback)
                 callback(commandResult.toMessageElement().textContent);
@@ -28,49 +29,46 @@ InspectorTest.addResult = function(text)
 InspectorTest.reloadPage = function(callback)
 {
     InspectorBackend.reloadPage();
-    addSniffer(WebInspector, "reset", callback);
+    InspectorTest._addSniffer(WebInspector, "reset", callback);
 };
 
-InspectorTest.ensureDebuggerEnabled = function(callback)
+InspectorTest.findDOMNode = function(root, filter, callback)
 {
-    if (WebInspector.panels.scripts._debuggerEnabled)
-        callback();
-    else {
-        addSniffer(WebInspector, "debuggerWasEnabled", callback);
-        WebInspector.panels.scripts._toggleDebugging(false);
-    }
-};
+    var found = false;
 
-InspectorTest.ensureDebuggerDisabled = function(callback)
-{
-    if (!WebInspector.panels.scripts._debuggerEnabled)
-        callback();
-    else {
-        addSniffer(WebInspector, "debuggerWasDisabled", callback);
-        WebInspector.panels.scripts._toggleDebugging(false);
-    }
-};
+    if (root)
+        findDOMNode(root);
+    else
+        waitForDocument();
 
-InspectorTest.showScriptSource = function(scriptName, callback)
-{
-    function waitForAllScripts()
+    function waitForDocument()
     {
-        if (scriptsAreParsed([scriptName]))
-            showScriptSource(scriptName, callback);
+        root = WebInspector.domAgent.document;
+        if (root)
+            findDOMNode(root);
         else
-            addSniffer(WebInspector, "parsedScriptSource", waitForAllScripts);
+            InspectorTest._addSniffer(WebInspector, setDocument, waitForDocument);
     }
-    waitForAllScripts();
-};
 
-function createKeyEvent(keyIdentifier)
-{
-    var evt = document.createEvent("KeyboardEvent");
-    evt.initKeyboardEvent("keydown", true, true, null, keyIdentifier, "");
-    return evt;
-}
+    function findDOMNode(node)
+    {
+        if (filter(node)) {
+            callback(node);
+            found = true;
+        } else
+            WebInspector.domAgent.getChildNodesAsync(node, processChildren);
+
+        function processChildren(children)
+        {
+            for (var i = 0; !found && children && i < children.length; ++i)
+                findDOMNode(children[i]);
+            if (!found && node === root)
+                callback(null);
+        }
+    }
+};
 
-function addSniffer(receiver, methodName, override, opt_sticky)
+InspectorTest._addSniffer = function(receiver, methodName, override, opt_sticky)
 {
     var original = receiver[methodName];
     if (typeof original !== "function")
@@ -92,56 +90,6 @@ function addSniffer(receiver, methodName, override, opt_sticky)
     };
 }
 
-function 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 === scripts[i]) {
-                found = true;
-                break;
-            }
-        }
-        if (!found)
-            return false;
-    }
-    return true;
-};
-
-function 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;
-    callback = callback.bind(null, view);
-    if (!view.sourceFrame._loaded)
-        addSniffer(view.sourceFrame, "setContent", callback);
-    else
-        callback();
-};
-
 });
 
 var runTestCallId = 0;
@@ -155,13 +103,28 @@ function runTest()
     layoutTestController.dumpAsText();
     layoutTestController.waitUntilDone();
 
-    var toEvaluate =
-        "if (!window.InspectorTest) {" +
-        "    var InspectorTest = {};" +
-        "    (" + initializeInspectorTest + ")(" + completeTestCallId + ");" +
-        "    WebInspector.showPanel('elements');" +
-        "    (" + test + ")();" +
-        "}";
+    function runTestInFrontend(initializationFunctions, testFunction, completeTestCallId)
+    {
+        if (window.InspectorTest)
+            return;
+
+        InspectorTest = {};
+        InspectorTest.completeTestCallId = completeTestCallId;
+
+        for (var i = 0; i < initializationFunctions.length; ++i)
+            initializationFunctions[i]();
+
+        WebInspector.showPanel("elements");
+        testFunction();
+    }
+
+    var initializationFunctions = [];
+    for (var name in window) {
+        if (name.indexOf("initialize_") === 0 && typeof window[name] === "function")
+            initializationFunctions.push(window[name].toString());
+    }
+    var parameters = ["[" + initializationFunctions + "]", test, completeTestCallId];
+    var toEvaluate = "(" + runTestInFrontend + ")(" + parameters.join(", ") + ");";
     layoutTestController.evaluateInWebInspector(runTestCallId, toEvaluate);
 }
 
diff --git a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
index 0f602b7..1c8b0fb 100644
--- a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
+++ b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
@@ -1,6 +1,7 @@
 <html>
 <head>
 <script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
 <script>
 
 function testFunction()
@@ -14,11 +15,10 @@ var test = function()
     testName = testName.substring(testName.lastIndexOf('/') + 1);
 
     WebInspector.showPanel("scripts");
-    InspectorTest.ensureDebuggerEnabled(ensureDebuggerEnabledCallback);
+    InspectorTest.startDebuggerTest(startDebuggerTestCallback);
 
-    function ensureDebuggerEnabledCallback()
+    function startDebuggerTestCallback()
     {
-        InspectorTest.addResult("Debugger was enabled.");
         InspectorTest.showScriptSource(testName, showScriptSourceCallback);
     }
 
@@ -43,13 +43,7 @@ var test = function()
             InspectorTest.addResult("Breakpoints are deactivated.");
         else
             InspectorTest.addResult("Error: breakpoints are activated.");
-        InspectorTest.ensureDebuggerDisabled(ensureDebuggerDisabledCallback);
-    }
-
-    function ensureDebuggerDisabledCallback()
-    {
-        InspectorTest.addResult("Debugger was disabled.");
-        InspectorTest.completeTest();
+        InspectorTest.completeDebuggerTest();
     }
 };
 
diff --git a/LayoutTests/inspector/dom-breakpoints-expected.txt b/LayoutTests/inspector/dom-breakpoints-expected.txt
new file mode 100644
index 0000000..06d533f
--- /dev/null
+++ b/LayoutTests/inspector/dom-breakpoints-expected.txt
@@ -0,0 +1,8 @@
+Tests DOM breakpoints. Bug 42886
+
+Debugger was enabled.
+Found div element.
+Set DOM breakpoint.
+Paused at line 10 in appendElement
+Debugger was disabled.
+
diff --git a/LayoutTests/inspector/dom-breakpoints.html b/LayoutTests/inspector/dom-breakpoints.html
new file mode 100644
index 0000000..02f3514
--- /dev/null
+++ b/LayoutTests/inspector/dom-breakpoints.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
+<script>
+
+function appendElement()
+{
+    var child = document.createElement("div");
+    document.getElementById("d0").appendChild(child);
+}
+
+var test = function()
+{
+    InspectorTest.startDebuggerTest(startDebuggerTestCallback);
+
+    function startDebuggerTestCallback()
+    {
+        InspectorTest.findDOMNode(null, function(node) {
+            return node.getAttribute("id") === "d0";
+        }, findDOMNodeCallback);
+    }
+
+    function findDOMNodeCallback(node)
+    {
+        InspectorTest.addResult("Found div element.");
+        InspectorBackend.setDOMBreakpoint(node.id, WebInspector.ElementsTreeElement.DOMBreakpointTypeSubtreeModified);
+        InspectorTest.addResult("Set DOM breakpoint.");
+        InspectorTest.evaluateInConsole("appendElement()");
+        InspectorTest.waitUntilPaused(waitUntilPausedCallback);
+    }
+
+    function waitUntilPausedCallback(callFrames)
+    {
+        InspectorTest.addResult("Paused at line " + callFrames[0].line + " in " + callFrames[0].functionName);
+        InspectorTest.completeDebuggerTest();
+    }
+};
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests DOM breakpoints. <a href="https://bugs.webkit.org/show_bug.cgi?id=42886">Bug 42886</a>
+</p>
+<div id="d0"></div>
+</body>
+</html>
+
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 87b4055..ad8affe 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5917,6 +5917,9 @@ fast/js/sputnik/Unicode/Unicode_510/S7.6_A5.3_T2.html
 # https://bugs.webkit.org/show_bug.cgi?id=44199
 perf/
 
+# https://bugs.webkit.org/show_bug.cgi?id=43332
+inspector/dom-breakpoints.html
+
 # [GTK] r65681 broke a couple GTK+ a11y tests
 # https://bugs.webkit.org/show_bug.cgi?id=44316
 platform/gtk/accessibility/object-attributes.html
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index ef83254..05261aa 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -289,3 +289,6 @@ perf/
 # Mac-Leopard after r63862.  Skipping for now.
 # https://bugs.webkit.org/show_bug.cgi?id=42821
 animations/play-state.html
+
+# https://bugs.webkit.org/show_bug.cgi?id=43332
+inspector/dom-breakpoints.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index ee20527..7d00eab 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -105,6 +105,9 @@ fast/loader/subframe-navigate-during-main-frame-load.html
 fast/text/hyphenate-character.html
 fast/text/hyphens.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=43332
+inspector/dom-breakpoints.html
+
 # =========================================================================== #
 #       Passing HTTP tests - require confirmation on bot.                     #
 # =========================================================================== #
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 9a53073..5e009c5 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -965,3 +965,6 @@ perf/
 # Application Cache Quotas
 # https://bugs.webkit.org/show_bug.cgi?id=43458
 http/tests/appcache/origin-quota.html
+
+# https://bugs.webkit.org/show_bug.cgi?id=43332
+inspector/dom-breakpoints.html

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list