Title: [98079] trunk
Revision
98079
Author
ca...@chromium.org
Date
2011-10-21 00:51:42 -0700 (Fri, 21 Oct 2011)

Log Message

Web Inspector: make extension tests pass on chromium
https://bugs.webkit.org/show_bug.cgi?id=70334

Reviewed by Pavel Feldman.

LayoutTests:

* http/tests/inspector/extensions-headers.html:
* http/tests/inspector/resources/extension-main.js:
():
* inspector/extensions/extensions-audits.html:
* inspector/extensions/extensions-console.html:
* inspector/extensions/extensions-resources.html:
* platform/chromium/inspector/extensions/extensions-api-expected.txt: Added.
* platform/chromium/inspector/extensions/extensions-eval-expected.txt: Added.
* platform/chromium/test_expectations.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98078 => 98079)


--- trunk/LayoutTests/ChangeLog	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/ChangeLog	2011-10-21 07:51:42 UTC (rev 98079)
@@ -1,3 +1,20 @@
+2011-10-20  Andrey Kosyakov  <ca...@chromium.org>
+
+        Web Inspector: make extension tests pass on chromium
+        https://bugs.webkit.org/show_bug.cgi?id=70334
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/extensions-headers.html:
+        * http/tests/inspector/resources/extension-main.js:
+        ():
+        * inspector/extensions/extensions-audits.html:
+        * inspector/extensions/extensions-console.html:
+        * inspector/extensions/extensions-resources.html:
+        * platform/chromium/inspector/extensions/extensions-api-expected.txt: Added.
+        * platform/chromium/inspector/extensions/extensions-eval-expected.txt: Added.
+        * platform/chromium/test_expectations.txt:
+
 2011-10-21  Yuzo Fujishima  <y...@google.com>
 
         [chromium] Test expectation change: fast/canvas/webgl/WebGLContextEvent.html now passes.

Modified: trunk/LayoutTests/http/tests/inspector/extensions-headers.html (98078 => 98079)


--- trunk/LayoutTests/http/tests/inspector/extensions-headers.html	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/http/tests/inspector/extensions-headers.html	2011-10-21 07:51:42 UTC (rev 98079)
@@ -6,13 +6,13 @@
 
 function extension_testAddHeaders(nextTest)
 {
-    webInspector.resources.addRequestHeaders({
+    webInspector.network.addRequestHeaders({
         "x-webinspector-extension": "test",
         "user-agent": "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)"
     });
     function cleanUpHeaders()
     {
-        webInspector.resources.addRequestHeaders({
+        webInspector.network.addRequestHeaders({
             "x-webinspector-extension": null,
             "user-agent": null
         });

Modified: trunk/LayoutTests/http/tests/inspector/resources/extension-main.js (98078 => 98079)


--- trunk/LayoutTests/http/tests/inspector/resources/extension-main.js	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-main.js	2011-10-21 07:51:42 UTC (rev 98079)
@@ -50,7 +50,9 @@
     channel.port1.start();
     if (callback)
         channel.port1.addEventListener("message", callbackWrapper, false);
-    top.postMessage({ _expression_: _expression_ }, [ channel.port2 ], "*");
+    webInspector.inspectedWindow.eval("", function() {
+        top.postMessage({ _expression_: _expression_ }, [ channel.port2 ], "*");
+    });
 }
 
 function output(message)

Modified: trunk/LayoutTests/inspector/extensions/extensions-audits.html (98078 => 98079)


--- trunk/LayoutTests/inspector/extensions/extensions-audits.html	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/inspector/extensions/extensions-audits.html	2011-10-21 07:51:42 UTC (rev 98079)
@@ -20,7 +20,7 @@
         var nestedNode = node.addChild("... and a snippet");
         nestedNode.expanded = true;
         nestedNode.addChild(results.createSnippet("function rand()\n{\n    return 4;\n}"));
-        nestedNode.addChild(results.createResourceLink('file:///path/to/error.html', 10));
+        nestedNode.addChild(results.createResourceLink("file:///path/to/error.html", 10));
 
         results.addResult("Rule with details subtree (1)", "This rule has a lot of details", results.Severity.Warning, node);
         // Audit normally terminates when number of added rule results is equal to
@@ -35,7 +35,7 @@
     }
     function onStartAuditDisabledCategory(results)
     {
-        output("FAIL: failedCategory.onAuditStarted fired");
+        output("FAIL: disabledCategory.onAuditStarted fired");
         results.done();
     }
 
@@ -49,7 +49,9 @@
     var disabledCategory = webInspector.audits.addCategory("Disabled extension audits", 2);
     disabledCategory.onAuditStarted.addListener(onStartAuditDisabledCategory);
 
-    extension_runAudits(nextTest);
+    webInspector.inspectedWindow.eval("", function() {
+        extension_runAudits(nextTest);
+    });
 }
 
 </script>

Modified: trunk/LayoutTests/inspector/extensions/extensions-console.html (98078 => 98079)


--- trunk/LayoutTests/inspector/extensions/extensions-console.html	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/inspector/extensions/extensions-console.html	2011-10-21 07:51:42 UTC (rev 98079)
@@ -5,7 +5,6 @@
 <script src=""
 
 <script type="text/_javascript_">
-
 function extension_testGetConsoleMessages(nextTest)
 {
     function callback(messages)
@@ -13,7 +12,6 @@
         dumpObject(messages, { url: "url" });
     }
     webInspector.console.getMessages(callbackAndNextTest(callback, nextTest));
-
 }
 
 function extension_testAddConsoleMessages(nextTest)
@@ -22,7 +20,9 @@
     webInspector.console.addMessage(webInspector.console.Severity.Log, "log message from extension", "test-url.html", 42);
     webInspector.console.addMessage(webInspector.console.Severity.Warning, "warning message from extension");
     webInspector.console.addMessage(webInspector.console.Severity.Error, "error message from extension", null, 42);
-    evaluateOnFrontend("InspectorTest.dumpConsoleMessagesWithClasses(); reply();", nextTest)
+    webInspector.inspectedWindow.eval("", function() {
+        evaluateOnFrontend("InspectorTest.dumpConsoleMessagesWithClasses(); reply();", nextTest);
+    });
 }
 
 function extension_testOnConsoleMessageAdded(nextTest)

Modified: trunk/LayoutTests/inspector/extensions/extensions-resources.html (98078 => 98079)


--- trunk/LayoutTests/inspector/extensions/extensions-resources.html	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/inspector/extensions/extensions-resources.html	2011-10-21 07:51:42 UTC (rev 98079)
@@ -95,8 +95,8 @@
     });
     // The next step is going to produce a console message that will be logged, so synchronize the output now.
     evaluateOnFrontend("InspectorTest.runAfterPendingDispatches(reply)", function() {
-        extension_runWithResource(/test-script\.js$/, function(resource) {
-            resource.setContent("function function1(){}", true);
+        extension_runWithResource(/abe\.png$/, function(resource) {
+            resource.setContent("", true);
         });
         extension_runWithResource(/audits-style1\.css$/, function(resource) {
             resource.setContent(expected_content, true);
@@ -137,7 +137,7 @@
 function addResource()
 {
     var script = document.createElement("script");
-    script.src = "" test_func(){}";
+    script.src = "" + escape("function test_func(){};");
     document.head.appendChild(script);
 }
 

Added: trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt (0 => 98079)


--- trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt	2011-10-21 07:51:42 UTC (rev 98079)
@@ -0,0 +1,103 @@
+Tests public interface of WebInspector Extensions API
+
+Started extension.
+Running tests...
+RUNNING TEST: extension_testAPI
+{
+    audits : {
+        addCategory : <function>
+    }
+    inspectedWindow : {
+        onResourceAdded : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        onResourceContentCommitted : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        reload : <function>
+        eval : <function>
+        getResources : <function>
+        tabId : undefined
+    }
+    panels : {
+        elements : {
+            onShown : {
+                addListener : <function>
+                removeListener : <function>
+            }
+            onHidden : {
+                addListener : <function>
+                removeListener : <function>
+            }
+            createSidebarPane : <function>
+            onSelectionChanged : {
+                addListener : <function>
+                removeListener : <function>
+            }
+        }
+        create : <function>
+        setOpenResourceHandler : <function>
+    }
+    network : {
+        onRequestFinished : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        onFinished : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        onNavigated : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        getHAR : <function>
+        addRequestHeaders : <function>
+    }
+    resources : {
+        onRequestFinished : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        onFinished : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        onNavigated : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        getHAR : <function>
+        addRequestHeaders : <function>
+    }
+    timeline : {
+        onEventRecorded : {
+            addListener : <function>
+            removeListener : <function>
+        }
+    }
+    console : {
+        onMessageAdded : {
+            addListener : <function>
+            removeListener : <function>
+        }
+        getMessages : <function>
+        addMessage : <function>
+        Severity : {
+            Tip : "tip"
+            Debug : "debug"
+            Log : "log"
+            Warning : "warning"
+            Error : "error"
+        }
+    }
+    onReset : {
+        addListener : <function>
+        removeListener : <function>
+    }
+    log : <function>
+}
+All tests done.
+
Property changes on: trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt (0 => 98079)


--- trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt	2011-10-21 07:51:42 UTC (rev 98079)
@@ -0,0 +1,18 @@
+Tests WebInspector extension API
+
+Started extension.
+Running tests...
+RUNNING TEST: extension_testEvalConsoleAPI
+Evaluate: "function" (exception: undefined)
+RUNNING TEST: extension_testEvalDefinesGlobalSymbols
+Evaluate: {"func":"function","variable":42} (exception: undefined)
+RUNNING TEST: extension_testEvalFailed
+Evaluate: "TypeError: Converting circular structure to JSON" (exception: true)
+RUNNING TEST: extension_testEvalOk
+Evaluate: {"str":"foo","num":42} (exception: undefined)
+RUNNING TEST: extension_testEvalStatement
+Evaluate: 0 (exception: undefined)
+RUNNING TEST: extension_testEvalUndefined
+Evaluate: undefined (exception: undefined)
+All tests done.
+
Property changes on: trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (98078 => 98079)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-10-21 07:51:42 UTC (rev 98079)
@@ -584,12 +584,6 @@
 // Inspector tests
 // -----------------------------------------------------------------
 
-// There is no message port harness to test extensions
-WONTFIX SKIP : inspector/extensions = FAIL
-WONTFIX SKIP : http/tests/inspector/extensions-headers.html = FAIL
-WONTFIX SKIP : http/tests/inspector/extensions-network-redirect.html = FAIL
-WONTFIX SKIP : http/tests/inspector/extensions-useragent.html = FAIL
-
 // There is no enough plugins support in DRT
 WONTFIX SKIP : http/tests/inspector/network/network-embed.html = FAIL
 WONTFIX SKIP : http/tests/inspector/network/network-content-replacement-embed.html = FAIL

Modified: trunk/Source/WebCore/ChangeLog (98078 => 98079)


--- trunk/Source/WebCore/ChangeLog	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/Source/WebCore/ChangeLog	2011-10-21 07:51:42 UTC (rev 98079)
@@ -1,3 +1,13 @@
+2011-10-20  Andrey Kosyakov  <ca...@chromium.org>
+
+        Web Inspector: make extension tests pass on chromium
+        https://bugs.webkit.org/show_bug.cgi?id=70334
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ExtensionAPI.js:
+        (buildExtensionAPIInjectedScript):
+
 2011-10-20  Peter Rybin  <peter.ry...@gmail.com>
 
         Web Inspector: reimplement protocol backend/frontend source generator

Modified: trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js (98078 => 98079)


--- trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js	2011-10-21 07:19:31 UTC (rev 98078)
+++ trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js	2011-10-21 07:51:42 UTC (rev 98079)
@@ -715,5 +715,6 @@
         injectedExtensionAPI.toString() + ";" +
         "injectedExtensionAPI(injectedScriptId);" +
         (platformAPI || "") +
+        "return {};" +
         "})";
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to