Web Inspector: load ProtocolTestStub from the WebInspectorUI bundle
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 20:33:48 +0000 (20:33 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 20:33:48 +0000 (20:33 +0000)
commit00e250636de97c8cefb26183ce78a395952e70e0
tree030ed7a3c53d81b1088cb175ae6155f0f399578b
parent36d2ae0bdf79506cb50e795ea08e61da09be0a49
Web Inspector: load ProtocolTestStub from the WebInspectorUI bundle
https://bugs.webkit.org/show_bug.cgi?id=147955

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Move ProtocolTestStub.{html,js} into the actual WebInspectorUI project.

* UserInterface/Base/TestStub.js: Renamed from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js.
* UserInterface/TestStub.html: Renamed from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.html.

Tools:

To enable sharing of common test code between protocol and model tests,
start loading the protocol TestStub.js through the WebInspectorUI bundle.

This patch adds the read-only getter TestRunner.inspectorTestStubURL, which
protocol-test.js uses to load the inspector frontend stub into its iframe
from an arbitrary local file URL.

* DumpRenderTree/TestRunner.cpp:
(getInspectorTestStubURLCallback):
(TestRunner::staticValues):
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(SOFT_LINK_STAGED_FRAMEWORK):
(TestRunner::inspectorTestStubURL):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::inspectorTestStubURL):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp:
(WTR::TestRunner::inspectorTestStubURL):
* WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
(WTR::TestRunner::inspectorTestStubURL):
* WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
(WTR::TestRunner::inspectorTestStubURL):

LayoutTests:

Since the inspector stub cannot open files that live in the LayoutTests
directory, adopt the test helper marshalling approach used by inspector.js.
Each helper must register its code for marshalling and explicitly put globals
on the window object.

Use script tags rather than importScript to include helpers in a test.

* TestExpectations: For now, skip inspector http tests. These should be rewritten
to use inspector-test.js, which does not run into cross-origin problems.

Rebaseline some test results to account for shifted line numbers (yuck).

* http/tests/inspector/dom/resources/InspectorDOMListener.js:
* http/tests/inspector/resources/console-test.js:
* http/tests/inspector/resources/probe-test.js:
* http/tests/inspector/resources/protocol-test.js:
(ProtocolTestProxy.registerInitializer):
(log):
(runTest.runInitializationMethodsInFrontend):
(runTest.runTestMethodInFrontend):
(runTest):
* inspector/console/console-message.html:
* inspector/console/css-source-locations-expected.txt:
* inspector/console/css-source-locations.html:
* inspector/console/js-source-locations-expected.txt:
* inspector/console/js-source-locations.html:
* inspector/console/x-frame-options-message-expected.txt:
* inspector/console/x-frame-options-message.html:
* inspector/debugger/didSampleProbe-multiple-probes.html:
* inspector/debugger/setBreakpoint-actions.html:
* inspector/debugger/setBreakpoint-options-exception.html:
* inspector/dom/dom-search-expected.txt:
* inspector/dom/dom-search-with-context.html:
* inspector/dom/dom-search.html:
* inspector/dom/resources/dom-search-queries.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js
LayoutTests/http/tests/inspector/resources/console-test.js
LayoutTests/http/tests/inspector/resources/probe-test.js
LayoutTests/http/tests/inspector/resources/protocol-test.js
LayoutTests/inspector/console/console-message.html
LayoutTests/inspector/console/css-source-locations-expected.txt
LayoutTests/inspector/console/css-source-locations.html
LayoutTests/inspector/console/js-source-locations-expected.txt
LayoutTests/inspector/console/js-source-locations.html
LayoutTests/inspector/console/x-frame-options-message-expected.txt
LayoutTests/inspector/console/x-frame-options-message.html
LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html
LayoutTests/inspector/debugger/setBreakpoint-actions.html
LayoutTests/inspector/debugger/setBreakpoint-options-exception.html
LayoutTests/inspector/dom/dom-search-expected.txt
LayoutTests/inspector/dom/dom-search-with-context.html
LayoutTests/inspector/dom/dom-search.html
LayoutTests/inspector/dom/resources/dom-search-queries.js
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/TestStub.js [moved from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js with 96% similarity]
Source/WebInspectorUI/UserInterface/TestStub.html [moved from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.html with 90% similarity]
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp
Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm