2009-10-18 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Oct 2009 00:20:43 +0000 (00:20 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Oct 2009 00:20:43 +0000 (00:20 +0000)
        Reviewed by Timothy Hatcher.

        Web Inspector: make console tests more granular.

        https://bugs.webkit.org/show_bug.cgi?id=30496

        * inspector/console-dir-expected.txt: Added.
        * inspector/console-dir.html: Added.
        * inspector/console-dirxml-expected.txt: Added.
        * inspector/console-dirxml.html: Added.
        * inspector/console-format-expected.txt: Added.
        * inspector/console-format.html: Added.
        * inspector/console-tests-expected.txt:
        * inspector/console-tests.html:
        * platform/gtk/Skipped:
        * platform/qt/Skipped:

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/console-dir-expected.txt [new file with mode: 0644]
LayoutTests/inspector/console-dir.html [new file with mode: 0755]
LayoutTests/inspector/console-dirxml-expected.txt [new file with mode: 0644]
LayoutTests/inspector/console-dirxml.html [new file with mode: 0755]
LayoutTests/inspector/console-format-expected.txt [new file with mode: 0644]
LayoutTests/inspector/console-format.html [new file with mode: 0755]
LayoutTests/inspector/console-tests-expected.txt
LayoutTests/inspector/console-tests.html
LayoutTests/inspector/evaluate-in-frontend.js
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/qt/Skipped

index 4fce1ce..42fa7d2 100644 (file)
@@ -1,3 +1,22 @@
+2009-10-18  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: make console tests more granular.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30496
+
+        * inspector/console-dir-expected.txt: Added.
+        * inspector/console-dir.html: Added.
+        * inspector/console-dirxml-expected.txt: Added.
+        * inspector/console-dirxml.html: Added.
+        * inspector/console-format-expected.txt: Added.
+        * inspector/console-format.html: Added.
+        * inspector/console-tests-expected.txt:
+        * inspector/console-tests.html:
+        * platform/gtk/Skipped:
+        * platform/qt/Skipped:
+
 2009-10-18  Dirk Schulze  <krit@webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/LayoutTests/inspector/console-dir-expected.txt b/LayoutTests/inspector/console-dir-expected.txt
new file mode 100644 (file)
index 0000000..9d76a04
--- /dev/null
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: line 8: [object HTMLDocument]
+CONSOLE MESSAGE: line 9: test1,test2
+CONSOLE MESSAGE: line 10: [object NodeList]
+Tests that console logging dumps proper messages.
+
+console-dir.html:8HTMLDocument
+console-dir.html:9Array
+console-dir.html:10NodeList
+
diff --git a/LayoutTests/inspector/console-dir.html b/LayoutTests/inspector/console-dir.html
new file mode 100755 (executable)
index 0000000..d8abf6d
--- /dev/null
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    console.dir(document);
+    console.dir(["test1", "test2"]);
+    console.dir(document.childNodes);
+
+    function callback(result)
+    {
+        for (var i = 0; i < result.length; ++i)
+            output(result[i]);
+        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)
+        result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
+    return result;
+}
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/console-dirxml-expected.txt b/LayoutTests/inspector/console-dirxml-expected.txt
new file mode 100644 (file)
index 0000000..a6cb83d
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 8: [object HTMLDocument]
+Tests that console logging dumps proper messages.
+
+console-dirxml.html:8Document
+
diff --git a/LayoutTests/inspector/console-dirxml.html b/LayoutTests/inspector/console-dirxml.html
new file mode 100755 (executable)
index 0000000..271a504
--- /dev/null
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    console.dirxml(document);
+
+    function callback(result)
+    {
+        for (var i = 0; i < result.length; ++i)
+            output(result[i]);
+        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)
+        result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
+    return result;
+}
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/console-format-expected.txt b/LayoutTests/inspector/console-format-expected.txt
new file mode 100644 (file)
index 0000000..b5da540
--- /dev/null
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: line 8: Message format number %i, %d and %f
+CONSOLE MESSAGE: line 9: Message %s for %s
+CONSOLE MESSAGE: line 10: Object %o
+Tests that console logging dumps proper messages.
+
+console-format.html:8Message format number 1, 2 and 3.5
+console-format.html:9Message format for string
+console-format.html:10Object Object
+
diff --git a/LayoutTests/inspector/console-format.html b/LayoutTests/inspector/console-format.html
new file mode 100755 (executable)
index 0000000..b83cf6a
--- /dev/null
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+    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' });
+
+    function callback(result)
+    {
+        for (var i = 0; i < result.length; ++i)
+            output(result[i]);
+        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)
+        result.push(messages[i].toMessageElement().textContent.replace(/\u200b/g, ""));
+    return result;
+}
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
index 8e971b3..39ea6da 100644 (file)
@@ -3,18 +3,12 @@ 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 22: 1
-CONSOLE MESSAGE: line 23: [object HTMLDocument]
-CONSOLE MESSAGE: line 24: test1,test2
-CONSOLE MESSAGE: line 25: [object NodeList]
+CONSOLE MESSAGE: line 14: repeated
+CONSOLE MESSAGE: line 14: repeated
+CONSOLE MESSAGE: line 14: repeated
+CONSOLE MESSAGE: line 14: repeated
+CONSOLE MESSAGE: line 14: repeated
+CONSOLE MESSAGE: line 19: 1
 Tests that console logging dumps proper messages.
 
 console-tests.html:8log console-message console-js-source console-log-level
@@ -22,16 +16,10 @@ 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-tests.html:14repeated console-message console-js-source console-log-level
+console-tests.html:16count: 1 console-message console-js-source console-log-level
+console-tests.html:16count: 2 console-message console-js-source console-log-level
+console-tests.html:17group console-message console-js-source console-log-level console-group-title
 console-message console-js-source console-log-level
-console-tests.html:221 2 3 console-message console-js-source console-log-level
-console-tests.html:23HTMLDocument console-message console-js-source console-log-level
-console-tests.html:24Array console-message console-js-source console-log-level
-console-tests.html:25NodeList console-message console-js-source console-log-level
+console-tests.html:191 2 3 console-message console-js-source console-log-level
 
index 2a63d0a..d0e7a98 100755 (executable)
@@ -10,9 +10,6 @@ function doit()
     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)
@@ -20,9 +17,6 @@ function doit()
     console.group('group');
     console.groupEnd();
     console.log('1', '2', '3');
-    console.dir(document);
-    console.dir(["test1", "test2"]);
-    console.dir(document.childNodes);
 
     function callback(result)
     {
index ae17d82..1a4e7ab 100755 (executable)
@@ -11,7 +11,8 @@ if (window.layoutTestController) {
 var ignoreLoad = window.location.href.indexOf("?reload") === -1;
 if (ignoreLoad) {
     setTimeout(function() {
-        layoutTestController.showWebInspector();
+        if (window.layoutTestController)
+            layoutTestController.showWebInspector();
         window.location.href += "?reload";
     }, 0);
 }
@@ -42,9 +43,8 @@ function evaluateInWebInspector(script, callback)
     var callId = lastCallId++;
     callbacks[callId] = callback;
     setTimeout(function() {
-        if (window.layoutTestController) {
+        if (window.layoutTestController)
             layoutTestController.evaluateInWebInspector(callId, script);
-        }
     }, 0);
 
 }
index 55862b9..6e823f2 100644 (file)
@@ -3510,6 +3510,9 @@ http/tests/webarchive/test-preload-resources.html
 
 # Tests in inspector/ directory
 #   Tests failing
+inspector/console-dir.html
+inspector/console-dirxml.html
+inspector/console-format.html
 inspector/console-tests.html
 inspector/elements-panel-structure.html
 inspector/evaluate-in-frontend.html
index af84b88..67c603d 100644 (file)
@@ -4866,6 +4866,9 @@ fast/dom/Window/slow_unload_handler.html
 http/tests/globalhistory
 
 # Skip inspector tests
+inspector/console-dir.html
+inspector/console-dirxml.html
+inspector/console-format.html
 inspector/console-tests.html
 inspector/elements-panel-structure.html
 inspector/evaluate-in-frontend.html