|
| 1 | +2018-03-07 Carlos Garcia Campos < [email protected]> |
| 2 | + |
| 3 | + [GTK][WPE] Leak checker is not working in WebKitGLib web process tests |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=183404 |
| 5 | + |
| 6 | + Reviewed by Michael Catanzaro. |
| 7 | + |
| 8 | + This might have regressed when we started to use the JSC garbage collector timers. The thing is that we expect |
| 9 | + that the WebProcessTester object that we expose to JavaScript is released when the web frame is destroyed, but |
| 10 | + that's no longer the case. On window object cleared a GC is scheduled, but JSC timers do the actual garbage |
| 11 | + collection later. In the case of tests that never happens because the web process finishes quickly after the |
| 12 | + test. We need to force a garbage collection at some point when the web page is destroyed. We can't use the |
| 13 | + WebKitWebPage destroy signal, since we are also checking that WebKitWebPage isn't leaked. The |
| 14 | + API::InjectedBundle::Client::willDestroyPage() always happen when the page is closed, even if WebKitWebPage is |
| 15 | + still alive, so we can force the GC at that point. The only problem is that the frame is detached right after |
| 16 | + that point, so we can't check WebKitFrame leaks. The only frame in the tests is the main one, so we can assume |
| 17 | + that if WebKitWebPage is released, the frame is too. |
| 18 | + |
| 19 | + * TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp: |
| 20 | + (WebKitFrameTest::testMainFrame): Stop checking we don't leak WebKitFrame. |
| 21 | + (WebKitFrameTest::testURI): Ditto. |
| 22 | + (WebKitFrameTest::testJavaScriptContext): Ditto. |
| 23 | + * TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp: |
| 24 | + (testWebKitFrameMainFrame): Use new WebViewTest::runWebProcessTest() API. |
| 25 | + (testWebKitFrameURI): Ditto. |
| 26 | + (testWebKitFrameJavaScriptContext): Ditto. |
| 27 | + (webkitFrameTestRun): Deleted. |
| 28 | + * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp: |
| 29 | + (runTest): We no longer need the special case for dom-cache test. |
| 30 | + (windowObjectClearedCallback): Only expose test runner object to JavaScript when loading tests. |
| 31 | + (webkit_web_extension_initialize): Call webkitWebExtensionSetGarbageCollectOnPageDestroy() to ensure a garbage |
| 32 | + collection is performed when the page is closing. |
| 33 | + * TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp: |
| 34 | + (WebKitDOMClientRectTest::testDivClientRectsPositionAndLength): Fix memory leak, |
| 35 | + webkit_dom_client_rect_list_item() returns a full reference. |
| 36 | + * TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp: |
| 37 | + (testWebProcessAutocleanups):Use new WebViewTest::runWebProcessTest() API. |
| 38 | + * TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp: |
| 39 | + (testWebKitDOMClientRectDivBoundingClientRectPosition): Use new WebViewTest::runWebProcessTest() API. |
| 40 | + (testWebKitDOMClientRectDivClientRectsPositionAndLength): Use new WebViewTest::runWebProcessTest() API. |
| 41 | + (prepareDOMForClientRectPositionTests): Deleted. |
| 42 | + * TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp: |
| 43 | + (testWebKitDOMNodeHierarchyNavigation): Use new WebViewTest::runWebProcessTest() API. |
| 44 | + (testWebKitDOMNodeInsertion): Ditto. |
| 45 | + (testWebKitDOMNodeTagNamesNodeList): Ditto. |
| 46 | + (testWebKitDOMNodeTagNamesHTMLCollection): Ditto. |
| 47 | + (testWebKitDOMObjectCache): We no longer need to run the test several times, since runWebProcessTest() loads |
| 48 | + about blank after every test. |
| 49 | + (prepareDOMForTagNamesTests): Deleted. |
| 50 | + * TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp: |
| 51 | + (testWebKitDOMNodeFilterTreeWalker): Use new WebViewTest::runWebProcessTest() API. |
| 52 | + (testWebKitDOMNodeFilterNodeIterator): Ditto. |
| 53 | + (runTest): Deleted. |
| 54 | + * TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp: |
| 55 | + (testWebKitDOMXPathNSResolverNative): Use new WebViewTest::runWebProcessTest() API. |
| 56 | + (testWebKitDOMXPathNSResolverCustom): Ditto. |
| 57 | + * TestWebKitAPI/Tests/WebKitGtk/TestEditor.cpp: |
| 58 | + (testWebKitWebEditorSelectionChanged): Use new WebViewTest::runWebProcessTest() API. |
| 59 | + * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp: |
| 60 | + (WebViewTest::runWebProcessTest): It now receives the contents, so it automatically loads the view using |
| 61 | + "webprocess://test" as base URI, used to detect tests in the web process. It also loads about:blank after every |
| 62 | + test to ensure that window object is cleared. |
| 63 | + * TestWebKitAPI/glib/WebKitGLib/WebViewTest.h: |
| 64 | + |
1 | 65 | 2018-03-07 Youenn Fablet < [email protected]> |
2 | 66 |
|
3 | 67 | Match unsupported plugins based on domains and not origin |
|
0 commit comments