Diff
Modified: trunk/LayoutTests/ChangeLog (98954 => 98955)
--- trunk/LayoutTests/ChangeLog 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/ChangeLog 2011-11-01 13:09:51 UTC (rev 98955)
@@ -1,3 +1,20 @@
+2011-10-18 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-11-01 Pavel Feldman <pfeld...@google.com>
Not reviewed: fix extensions tests.
Modified: trunk/LayoutTests/http/tests/inspector/extensions-headers.html (98954 => 98955)
--- trunk/LayoutTests/http/tests/inspector/extensions-headers.html 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/http/tests/inspector/extensions-headers.html 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 (98954 => 98955)
--- trunk/LayoutTests/http/tests/inspector/resources/extension-main.js 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-main.js 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 (98954 => 98955)
--- trunk/LayoutTests/inspector/extensions/extensions-audits.html 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/inspector/extensions/extensions-audits.html 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 (98954 => 98955)
--- trunk/LayoutTests/inspector/extensions/extensions-console.html 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/inspector/extensions/extensions-console.html 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 (98954 => 98955)
--- trunk/LayoutTests/inspector/extensions/extensions-resources.html 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/inspector/extensions/extensions-resources.html 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 => 98955)
--- trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-api-expected.txt 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 => 98955)
--- trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/extensions/extensions-eval-expected.txt 2011-11-01 13:09:51 UTC (rev 98955)
@@ -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 (98954 => 98955)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-11-01 12:59:11 UTC (rev 98954)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-11-01 13:09:51 UTC (rev 98955)
@@ -607,12 +607,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
@@ -3949,3 +3943,7 @@
BUGWK71277 WIN GPU : media/video-transformed.html = CRASH PASS
BUGWK71278 SLOW WIN RELEASE : fast/events/dispatch-message-string-data.html = PASS
+
+BUGWK71282 WIN DEBUG : http/tests/inspector/extensions-headers.html = PASS TIMEOUT
+BUGWK71282 WIN DEBUG : http/tests/inspector/extensions-network-redirect.html = PASS TIMEOUT
+BUGWK71282 WIN DEBUG : http/tests/inspector/extensions-useragent.html = PASS TIMEOUT