2011-03-05 Andrey Kosyakov <caseq@chromium.org>
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 11:07:40 +0000 (11:07 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 11:07:40 +0000 (11:07 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: install onerror handler in inspector tests
        https://bugs.webkit.org/show_bug.cgi?id=55690

        * http/tests/inspector/inspector-test.js:
        (initialize_InspectorTest.onError):
        * http/tests/inspector/resources/extension-main.js:
        (onError):

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

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/inspector-test.js
LayoutTests/http/tests/inspector/resources/extension-main.js

index 15e73b6..29510eb 100644 (file)
@@ -1,3 +1,15 @@
+2011-03-05  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: install onerror handler in inspector tests
+        https://bugs.webkit.org/show_bug.cgi?id=55690
+
+        * http/tests/inspector/inspector-test.js:
+        (initialize_InspectorTest.onError):
+        * http/tests/inspector/resources/extension-main.js:
+        (onError):
+
 2011-03-04  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 53e4f35..9e366e1 100644 (file)
@@ -91,6 +91,15 @@ InspectorTest.addResults = function(textArray)
         InspectorTest.addResult(textArray[i]);
 }
 
+function onError(event)
+{
+    window.removeEventListener("error", onError);
+    InspectorTest.addResult("Uncaught exception in inspector front-end: " + event.message + " [" + event.filename + ":" + event.lineno + "]");
+    InspectorTest.completeTest();
+}
+
+window.addEventListener("error", onError);
+
 InspectorTest.addObject = function(object, nondeterministicProps, prefix, firstLinePrefix)
 {
     prefix = prefix || "";
index e94bd23..cbc8738 100644 (file)
@@ -1,3 +1,12 @@
+function onError(event)
+{
+    window.removeEventListener("error", onError);
+    output("Uncaught exception in extension context: " + event.message + " [" + event.filename + ":" + event.lineno + "]");
+    top.postMessage({ command: "extension-tests-done" }, "*");
+}
+
+window.addEventListener("error", onError);
+
 function fetchTests()
 {
     function callback(result)