Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GTK][WPE] Leak checker is not working in WebKitGLib web process tests
https://bugs.webkit.org/show_bug.cgi?id=183404 Reviewed by Michael Catanzaro. Source/WebKit: Add private helper for testing to do a garbage collection when the page is closing. * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: (webkitWebExtensionSetGarbageCollectOnPageDestroy): * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of webkit_dom_client_rect_list_item(), it should be transfer full. Tools: This might have regressed when we started to use the JSC garbage collector timers. The thing is that we expect that the WebProcessTester object that we expose to JavaScript is released when the web frame is destroyed, but that's no longer the case. On window object cleared a GC is scheduled, but JSC timers do the actual garbage collection later. In the case of tests that never happens because the web process finishes quickly after the test. We need to force a garbage collection at some point when the web page is destroyed. We can't use the WebKitWebPage destroy signal, since we are also checking that WebKitWebPage isn't leaked. The API::InjectedBundle::Client::willDestroyPage() always happen when the page is closed, even if WebKitWebPage is still alive, so we can force the GC at that point. The only problem is that the frame is detached right after that point, so we can't check WebKitFrame leaks. The only frame in the tests is the main one, so we can assume that if WebKitWebPage is released, the frame is too. * TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp: (WebKitFrameTest::testMainFrame): Stop checking we don't leak WebKitFrame. (WebKitFrameTest::testURI): Ditto. (WebKitFrameTest::testJavaScriptContext): Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp: (testWebKitFrameMainFrame): Use new WebViewTest::runWebProcessTest() API. (testWebKitFrameURI): Ditto. (testWebKitFrameJavaScriptContext): Ditto. (webkitFrameTestRun): Deleted. * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp: (runTest): We no longer need the special case for dom-cache test. (windowObjectClearedCallback): Only expose test runner object to JavaScript when loading tests. (webkit_web_extension_initialize): Call webkitWebExtensionSetGarbageCollectOnPageDestroy() to ensure a garbage collection is performed when the page is closing. * TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp: (WebKitDOMClientRectTest::testDivClientRectsPositionAndLength): Fix memory leak, webkit_dom_client_rect_list_item() returns a full reference. * TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp: (testWebProcessAutocleanups):Use new WebViewTest::runWebProcessTest() API. * TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp: (testWebKitDOMClientRectDivBoundingClientRectPosition): Use new WebViewTest::runWebProcessTest() API. (testWebKitDOMClientRectDivClientRectsPositionAndLength): Use new WebViewTest::runWebProcessTest() API. (prepareDOMForClientRectPositionTests): Deleted. * TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp: (testWebKitDOMNodeHierarchyNavigation): Use new WebViewTest::runWebProcessTest() API. (testWebKitDOMNodeInsertion): Ditto. (testWebKitDOMNodeTagNamesNodeList): Ditto. (testWebKitDOMNodeTagNamesHTMLCollection): Ditto. (testWebKitDOMObjectCache): We no longer need to run the test several times, since runWebProcessTest() loads about blank after every test. (prepareDOMForTagNamesTests): Deleted. * TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp: (testWebKitDOMNodeFilterTreeWalker): Use new WebViewTest::runWebProcessTest() API. (testWebKitDOMNodeFilterNodeIterator): Ditto. (runTest): Deleted. * TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp: (testWebKitDOMXPathNSResolverNative): Use new WebViewTest::runWebProcessTest() API. (testWebKitDOMXPathNSResolverCustom): Ditto. * TestWebKitAPI/Tests/WebKitGtk/TestEditor.cpp: (testWebKitWebEditorSelectionChanged): Use new WebViewTest::runWebProcessTest() API. * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp: (WebViewTest::runWebProcessTest): It now receives the contents, so it automatically loads the view using "webprocess://test" as base URI, used to detect tests in the web process. It also loads about:blank after every test to ensure that window object is cleared. * TestWebKitAPI/glib/WebKitGLib/WebViewTest.h: Canonical link: https://commits.webkit.org/199102@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
152 additions
and 112 deletions.
- +15 −0 Source/WebKit/ChangeLog
- +15 −0 Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp
- +2 −4 Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h
- +1 −1 Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h
- +64 −0 Tools/ChangeLog
- +0 −3 Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp
- +3 −12 Tools/TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp
- +6 −8 Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp
- +6 −5 Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp
- +0 −4 Tools/TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp
- +7 −14 Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp
- +14 −36 Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp
- +2 −10 Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp
- +2 −8 Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp
- +1 −4 Tools/TestWebKitAPI/Tests/WebKitGtk/TestEditor.cpp
- +13 −2 Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp
- +1 −1 Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.