[WPE] Use JSC API to send script messages from web extension in tests
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 12:03:10 +0000 (12:03 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 12:03:10 +0000 (12:03 +0000)
commitbcfba101f373f76eaf74f69d12b9f0f44bc4ac63
treecbd357581d9b3a20a23a6cf07b90a876d55a0793
parent593f12586d4b836fc0023c1f5a286326c0f69073
[WPE] Use JSC API to send script messages from web extension in tests
https://bugs.webkit.org/show_bug.cgi?id=173757

Reviewed by Žan Doberšek.

The GTK+ uses DOM bindings to send the messages. We can just build the message string and use JSEvaluateScript
to run postMessage().

Fixes: /wpe/WebKitSecurityManager/file-xhr
       /wpe/WebKitConsoleMessage/console-api
       /wpe/WebKitConsoleMessage/js-exception
       /wpe/WebKitConsoleMessage/network-error
       /wpe/WebKitConsoleMessage/security-error

* TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp:
(testWebKitConsoleMessageSecurityError): Remove ifdefs.
(beforeAll): Ditto.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp:
(testWebContextSecurityFileXHR): Ditto.
(beforeAll): Ditto.
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(consoleMessageSentCallback): Use JSEvaluateScript in WPE. We need to escape the '"' in the message string.
(pageCreatedCallback): Remove ifdefs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp