Bug 229838 - WebKitTestRunner does not correctly close all auxiliary WebViews between tests
Summary: WebKitTestRunner does not correctly close all auxiliary WebViews between tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 229766 229873
  Show dependency treegraph
 
Reported: 2021-09-02 16:05 PDT by Chris Dumez
Modified: 2021-09-07 19:42 PDT (History)
7 users (show)

See Also:


Attachments
WIP patch (7.31 KB, patch)
2021-09-02 16:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP patch (14.92 KB, patch)
2021-09-02 16:18 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch (16.09 KB, patch)
2021-09-02 16:25 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch (15.53 KB, patch)
2021-09-02 16:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP patch (16.95 KB, patch)
2021-09-02 16:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.68 KB, patch)
2021-09-02 18:30 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.98 KB, patch)
2021-09-03 07:17 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-09-02 16:05:51 PDT
WebKitTestRunner does not close auxiliary WebViews between tests, letting them accumulate and wasting memory.
Comment 1 Chris Dumez 2021-09-02 16:09:33 PDT
Created attachment 437210 [details]
WIP patch
Comment 2 Chris Dumez 2021-09-02 16:18:39 PDT
Created attachment 437211 [details]
WIP patch
Comment 3 Chris Dumez 2021-09-02 16:25:42 PDT
Created attachment 437214 [details]
WIP patch
Comment 4 Chris Dumez 2021-09-02 16:32:16 PDT
Created attachment 437215 [details]
WIP patch
Comment 5 Chris Dumez 2021-09-02 16:36:11 PDT
Created attachment 437217 [details]
WIP patch
Comment 6 Chris Dumez 2021-09-02 18:30:01 PDT
Created attachment 437228 [details]
Patch
Comment 7 Alex Christensen 2021-09-02 20:43:01 PDT
Comment on attachment 437228 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437228&action=review

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:1992
> +        NSArray* array = [DumpRenderTreeWindow openWindows];
> +        unsigned count = [array count];
> +        for (unsigned i = 0; i < count; i++) {
> +            NSWindow *window = [array objectAtIndex:i];

for (NSWindow *window in DumpRenderTreeWindow.openWindows)
A lot of code below could also use dot syntax.

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:1333
>          Vector<HWND> windows = openWindows();
>          unsigned size = windows.size();
>          for (unsigned i = 0; i < size; i++) {

for (HWND window : openWindows())
Also, there's now an unnecessary scope.
Comment 8 Chris Dumez 2021-09-02 21:03:40 PDT
Comment on attachment 437228 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437228&action=review

>> Tools/DumpRenderTree/win/DumpRenderTree.cpp:1333
>>          for (unsigned i = 0; i < size; i++) {
> 
> for (HWND window : openWindows())
> Also, there's now an unnecessary scope.

The reason I kept the scope is that there is a goto above :(
Comment 9 Chris Dumez 2021-09-03 07:17:50 PDT
Created attachment 437268 [details]
Patch
Comment 10 Chris Dumez 2021-09-03 07:19:53 PDT
(In reply to Alex Christensen from comment #7)
> Comment on attachment 437228 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437228&action=review
> 
> > Tools/DumpRenderTree/mac/DumpRenderTree.mm:1992
> > +        NSArray* array = [DumpRenderTreeWindow openWindows];
> > +        unsigned count = [array count];
> > +        for (unsigned i = 0; i < count; i++) {
> > +            NSWindow *window = [array objectAtIndex:i];
> 
> for (NSWindow *window in DumpRenderTreeWindow.openWindows)
> A lot of code below could also use dot syntax.
> 
> > Tools/DumpRenderTree/win/DumpRenderTree.cpp:1333
> >          Vector<HWND> windows = openWindows();
> >          unsigned size = windows.size();
> >          for (unsigned i = 0; i < size; i++) {
> 
> for (HWND window : openWindows())
> Also, there's now an unnecessary scope.

The scope is indeed now necessary with your proposed change.
Comment 11 EWS 2021-09-03 07:47:03 PDT
Committed r281990 (241297@main): <https://commits.webkit.org/241297@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437268 [details].
Comment 12 Radar WebKit Bug Importer 2021-09-03 07:48:15 PDT
<rdar://problem/82722937>
Comment 13 Chris Dumez 2021-09-03 08:25:41 PDT
Follow-up iOS build fix in  <https://commits.webkit.org/r281994>.
Comment 14 Fujii Hironori 2021-09-07 19:42:15 PDT
Comment on attachment 437268 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437268&action=review

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:-1331
> -        Vector<HWND> windows = openWindows();

This change caused a bug.  
Filed: Bug 229932 – [Win][DumpRenderTree] ASSERTION FAILED: openWindows().size() == 1 in runTest