2010-12-07 Yury Semikhatsky <yurys@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 14:24:51 +0000 (14:24 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 14:24:51 +0000 (14:24 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: switch http/tests/inspector/console-resource-errors.html to inspector-tests2
        https://bugs.webkit.org/show_bug.cgi?id=50551

        We need to be sure that front-end has already opened by the time the messages are
        recorded in console because the data we collect for errors may differ depending
        on whether the front-end is open.

        * http/tests/inspector/console-resource-errors-expected.txt:
        * http/tests/inspector/console-resource-errors.html:
        * http/tests/inspector/console-tests2.js:
        (initialize_ConsoleTest.InspectorTest.dumpConsoleMessagesWithClasses):

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

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/console-resource-errors-expected.txt
LayoutTests/http/tests/inspector/console-resource-errors.html
LayoutTests/http/tests/inspector/console-tests2.js

index ed9334c..fe65cad 100644 (file)
@@ -1,3 +1,19 @@
+2010-12-07  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: switch http/tests/inspector/console-resource-errors.html to inspector-tests2
+        https://bugs.webkit.org/show_bug.cgi?id=50551
+
+        We need to be sure that front-end has already opened by the time the messages are
+        recorded in console because the data we collect for errors may differ depending
+        on whether the front-end is open.
+
+        * http/tests/inspector/console-resource-errors-expected.txt:
+        * http/tests/inspector/console-resource-errors.html:
+        * http/tests/inspector/console-tests2.js:
+        (initialize_ConsoleTest.InspectorTest.dumpConsoleMessagesWithClasses):
+
 2010-12-07  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed.
index 580adea..81b8093 100644 (file)
@@ -1,5 +1,6 @@
  Tests that errors to load a resource cause error messages to be logged to console.
 
+Page reloaded.
 missing.cssFailed to load resource: the server responded with a status of 404 (Not Found) console-message console-other-source console-error-level
 non-existent-iframe.htmlFailed to load resource: the server responded with a status of 404 (Not Found) console-message console-other-source console-error-level
 non-existent-script.jsFailed to load resource: the server responded with a status of 404 (Not Found) console-message console-other-source console-error-level
index 538135e..5ad6ece 100644 (file)
@@ -1,24 +1,30 @@
 <html>
 <head>
-<script src="console-tests.js"></script>
-<script src="inspector-test.js"></script>
+<script src="console-tests2.js"></script>
+<script src="inspector-test2.js"></script>
 
 <link rel="stylesheet" type="text/css" href="missing.css">
 
 <script>
-function doit()
-{
-    var xhr = new XMLHttpRequest();
-    xhr.open("GET","non-existent-xhr", false);
-    xhr.send(null);
+var xhr = new XMLHttpRequest();
+xhr.open("GET","non-existent-xhr", false);
+xhr.send(null);
 
-    dumpConsoleMessagesWithClasses(true);
+function test()
+{
+    InspectorTest.reloadPage(function() {
+        InspectorTest.expandConsoleMessages();
+        InspectorTest.dumpConsoleMessagesWithClasses(true);
+        InspectorTest.completeTest();
+    });
 }
 
+
+
 </script>
 </head>
 
-<body onload="onload()">
+<body onload="runTest()">
 <p>
 <script src="non-existent-script.js"></script>
 <iframe src="non-existent-iframe.html"></iframe>
index 3afd9c9..7d316fe 100755 (executable)
@@ -11,6 +11,19 @@ InspectorTest.dumpConsoleMessages = function()
     return result;
 }
 
+InspectorTest.dumpConsoleMessagesWithClasses = function(sortMessages) {
+    var result = [];
+    var messages = WebInspector.console.messages;
+    for (var i = 0; i < messages.length; ++i) {
+        var element = messages[i].toMessageElement();
+        result.push(element.textContent.replace(/\u200b/g, "") + " " + element.getAttribute("class"));
+    }
+    if (sortMessages)
+        result.sort();
+    for (var i = 0; i < messages.length; ++i)
+        InspectorTest.addResult(result[i]);
+}
+
 InspectorTest.expandConsoleMessages = function()
 {
     var messages = WebInspector.console.messages;