[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:44:29 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 96e0851f6cd74415a7ae12d449679d518e4c3339
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 14 16:39:23 2009 +0000

    2009-10-14  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: add initial layout tests for web inspector.
    
            https://bugs.webkit.org/show_bug.cgi?id=30014
    
            * inspector/console-tests-expected.txt: Added.
            * inspector/console-tests.html: Added.
            * inspector/elements-panel-structure-expected.txt: Added.
            * inspector/elements-panel-structure.html: Added.
            * inspector/evaluate-in-frontend-expected.txt: Added.
            * inspector/evaluate-in-frontend.html: Added.
            * inspector/evaluate-in-frontend.js: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3cc15c2..4fa3b41 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2009-10-14  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: add initial layout tests for web inspector.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30014
+
+        * inspector/console-tests-expected.txt: Added.
+        * inspector/console-tests.html: Added.
+        * inspector/elements-panel-structure-expected.txt: Added.
+        * inspector/elements-panel-structure.html: Added.
+        * inspector/evaluate-in-frontend-expected.txt: Added.
+        * inspector/evaluate-in-frontend.html: Added.
+        * inspector/evaluate-in-frontend.js: Added.
+
 2009-10-14  Victor Wang  <victorw at chromium.org>
 
         Reviewed by David Hyatt.
diff --git a/LayoutTests/inspector/console-tests-expected.txt b/LayoutTests/inspector/console-tests-expected.txt
new file mode 100755
index 0000000..d88da99
--- /dev/null
+++ b/LayoutTests/inspector/console-tests-expected.txt
@@ -0,0 +1,36 @@
+CONSOLE MESSAGE: line 8: log
+CONSOLE MESSAGE: line 9: debug
+CONSOLE MESSAGE: line 10: info
+CONSOLE MESSAGE: line 11: warn
+CONSOLE MESSAGE: line 12: error
+CONSOLE MESSAGE: line 13: Message format number %i, %d and %f
+CONSOLE MESSAGE: line 14: Message %s for %s
+CONSOLE MESSAGE: line 15: Object %o
+CONSOLE MESSAGE: line 17: repeated
+CONSOLE MESSAGE: line 17: repeated
+CONSOLE MESSAGE: line 17: repeated
+CONSOLE MESSAGE: line 17: repeated
+CONSOLE MESSAGE: line 17: repeated
+CONSOLE MESSAGE: line 24: 1
+CONSOLE MESSAGE: line 25: [object HTMLDocument]
+CONSOLE MESSAGE: line 26: [object HTMLHtmlElement]
+Tests that console logging dumps proper messages.
+
+console-tests.html:8log console-message console-js-source console-log-level
+console-tests.html:9debug console-message console-js-source console-log-level
+console-tests.html:10info console-message console-js-source console-log-level
+console-tests.html:11warn console-message console-js-source console-warning-level
+console-tests.html:12error console-message console-js-source console-error-level
+console-tests.html:13Message format number 1, 2 and 3.5 console-message console-js-source console-log-level
+console-tests.html:14Message format for string console-message console-js-source console-log-level
+console-tests.html:15Object Object console-message console-js-source console-log-level
+5console-tests.html:17repeated console-message console-js-source console-log-level repeated-message
+console-tests.html:19count: 1 console-message console-js-source console-log-level
+console-tests.html:19count: 2 console-message console-js-source console-log-level
+console-tests.html:20group console-message console-js-source console-log-level console-group-title
+console-message console-js-source console-log-level
+console-tests.html:23timer: 0ms console-message console-js-source console-log-level
+console-tests.html:241 2 3 console-message console-js-source console-log-level
+console-tests.html:25HTMLDocument console-message console-js-source console-log-level
+console-tests.html:26 console-message console-js-source console-log-level
+
diff --git a/LayoutTests/inspector/console-tests.html b/LayoutTests/inspector/console-tests.html
new file mode 100755
index 0000000..76ff82a
--- /dev/null
+++ b/LayoutTests/inspector/console-tests.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    console.log('log');
+    console.debug('debug');
+    console.info('info');
+    console.warn('warn');
+    console.error('error');
+    console.log('Message format number %i, %d and %f', 1, 2, 3.5);
+    console.log('Message %s for %s', 'format', 'string');
+    console.log('Object %o', {'foo' : 'bar' });
+    for (var i = 0; i < 5; ++i)
+        console.log('repeated');
+    for (var i = 0; i < 2; ++i)
+        console.count('count');
+    console.group('group');
+    console.groupEnd();
+    console.time('timer');
+    console.timeEnd('timer');
+    console.log('1', '2', '3');
+    console.dir(document);
+    console.dirxml(document.documentElement);
+
+    function callback(result)
+    {
+        for (var i = 0; i < result.length; ++i) {
+            output(result[i].text + " " + result[i].clazz);
+        }
+        notifyDone();
+    }
+    evaluateInWebInspector("dumpMessages()", callback);
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Tests that console logging dumps proper messages.
+</p>
+
+<div id="frontend-script" style="display:none">
+function dumpMessages()
+{
+    var result = [];
+    var messages = WebInspector.console.messages;
+    for (var i = 0; i &lt; messages.length; ++i) {
+        var element = messages[i].toMessageElement();
+        result.push({ text: element.textContent.replace(/\u200b/g, ""), clazz: element.getAttribute("class")});
+    }
+    return result;
+}
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/elements-panel-structure-expected.txt b/LayoutTests/inspector/elements-panel-structure-expected.txt
new file mode 100755
index 0000000..b206f12
--- /dev/null
+++ b/LayoutTests/inspector/elements-panel-structure-expected.txt
@@ -0,0 +1,7 @@
+Tests that elements panel shows dom tree structure.
+
+
+<html>
+<head>
+<body onload="onload()">
+</html>
diff --git a/LayoutTests/inspector/elements-panel-structure.html b/LayoutTests/inspector/elements-panel-structure.html
new file mode 100755
index 0000000..a54b5fc
--- /dev/null
+++ b/LayoutTests/inspector/elements-panel-structure.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    function callback(result)
+    {
+        var output = document.getElementById("output");
+        output.textContent = result.replace(/\u200b/g, "").replace(/</g, "\n<");
+        notifyDone();
+    }
+    evaluateInWebInspector("WebInspector.panels.elements.treeOutline.element.textContent", callback);
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Tests that elements panel shows dom tree structure.
+</p>
+
+<div id="frontend-script" style="display:none">
+</div>
+
+<pre id="output">
+</pre>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/evaluate-in-frontend-expected.txt b/LayoutTests/inspector/evaluate-in-frontend-expected.txt
new file mode 100755
index 0000000..a8752df
--- /dev/null
+++ b/LayoutTests/inspector/evaluate-in-frontend-expected.txt
@@ -0,0 +1,4 @@
+This tests that layout test can evaluate scripts in the web inspector context.
+
+2 + 2 = 4
+
diff --git a/LayoutTests/inspector/evaluate-in-frontend.html b/LayoutTests/inspector/evaluate-in-frontend.html
new file mode 100755
index 0000000..451a957
--- /dev/null
+++ b/LayoutTests/inspector/evaluate-in-frontend.html
@@ -0,0 +1,35 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    function callback(result)
+    {
+        output("2 + 2 = " + result);
+        notifyDone();
+    }
+    evaluateInWebInspector("sum(2, 2)", callback);
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+This tests that layout test can evaluate scripts in the web inspector context.
+</p>
+
+<div id="frontend-script" style="display:none">
+function sum(a, b)
+{
+    return a + b;
+}
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/evaluate-in-frontend.js b/LayoutTests/inspector/evaluate-in-frontend.js
new file mode 100755
index 0000000..9c6397e
--- /dev/null
+++ b/LayoutTests/inspector/evaluate-in-frontend.js
@@ -0,0 +1,71 @@
+var lastCallId = 0;
+var callbacks = {};
+
+function evaluateInWebInspector(script, callback)
+{
+    callbacks[lastCallId] = callback;
+    setTimeout(function() {
+        if (window.layoutTestController) {
+            layoutTestController.evaluateInWebInspector(lastCallId++, script);
+        }
+    }, 0);
+
+}
+
+function showWebInspector()
+{
+    setTimeout(function() {
+        if (window.layoutTestController) {
+            layoutTestController.showWebInspector();
+        }
+    }, 0);
+}
+
+function closeWebInspector()
+{
+    setTimeout(function() {
+        if (window.layoutTestController) {
+            layoutTestController.closeWebInspector();
+        }
+    }, 0);
+}
+
+function onload()
+{
+    setTimeout(function() {
+        if (window.layoutTestController) {
+            layoutTestController.showWebInspector();
+            layoutTestController.evaluateInWebInspector(lastCallId++, document.getElementById("frontend-script").textContent);
+        }
+        doit();
+    }, 0);
+}
+
+function notifyDone()
+{
+    setTimeout(function() {
+        if (window.layoutTestController) {
+            layoutTestController.closeWebInspector();
+            layoutTestController.notifyDone();
+        }
+    }, 0);
+}
+
+function output(text)
+{
+    var output = document.getElementById("output");
+    output.innerHTML += text + "<BR>";
+}
+
+window.didEvaluateForTestInFrontend = function(callId, jsonResult)
+{
+    if (callbacks[callId]) {
+        callbacks[callId].call(this, JSON.parse(jsonResult));
+        delete callbacks[callId];
+    }
+};
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list