Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2019 19:23:28 +0000 (19:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2019 19:23:28 +0000 (19:23 +0000)
commit33647a4a87fe786c6a3bc4d72c75efd5805955b2
treef9a3b041bcbc2162d18cf6b69e924dfb255a7774
parenta705907de84dba93ac5c5f8e4e886c6e61855db9
Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
https://bugs.webkit.org/show_bug.cgi?id=194819

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2019-02-20
Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html

* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::hasCreatedHandshake):
* inspector/agents/page/PageNetworkAgent.cpp:
Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.

LayoutTests:

* TestExpectations: Skip the test by default, like http/tests/contentextensions
* http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt: Added.
* http/tests/inspector/network/contentextensions/blocked-websocket-crash.html: Added.
* http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json: Added.
* platform/gtk/TestExpectations: Unskip the test
* platform/mac-wk2/TestExpectations: Ditto
* platform/wpe/TestExpectations: Ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketChannel.h
Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp