Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Issue 1363093004: Add BrowserSelectFileDialogTest.OpenCloseFileDialog (Closed)

Created:
5 years, 3 months ago by joone
Modified:
3 years, 11 months ago
CC:
chromium-reviews, tfarina, earthdok, eugenis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add BrowserSelectFileDialogTest.OpenCloseFileDialog. This test checks if file-picker opens and closes without any memory leaks. However, GtkFileChooserDialog has memory leaks. Therefore, we annotate this memory leaks so that LeakSanitizer can skip them. BUG=537468 TEST=BrowserSelectFileDialogTest.OpenCloseFileDialog

Patch Set 1 #

Patch Set 2 : try to deallocate memory #

Patch Set 3 : fix build errors #

Patch Set 4 : fix CrOS build error and disable the test case #

Patch Set 5 : enable the test and skip libglib-2.0 from LSan report #

Total comments: 10

Patch Set 6 : remove CloseImpl() method and skip interactive_ui_tests from LSan report #

Patch Set 7 : check if the focused window is the file-picker dialog #

Total comments: 8

Patch Set 8 : skip libgtk-x11-2.0 from LSan report #

Total comments: 4

Patch Set 9 : use ANNOTATE_LEAKING_OBJECT_PTR #

Patch Set 10 : use ANNOTATE_SCOPED_MEMORY_LEAK #

Total comments: 14

Patch Set 11 : initialize the variables with 0, fix coding style issues. #

Total comments: 1

Patch Set 12 : move the comment into the body of the function. #

Total comments: 2

Patch Set 13 : directly create the SelectFileDialog #

Total comments: 1

Patch Set 14 : call gtk_widget_destroy() to close the file-picker #

Total comments: 1

Patch Set 15 : close all file-pickers #

Patch Set 16 : expose the GtkWidget via a friend #

Patch Set 17 : fix gn and gyp files for chromeos #

Total comments: 30

Patch Set 18 : Remove the page loading #

Patch Set 19 : add comments #

Total comments: 6

Patch Set 20 : do not run the test-server #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+271 lines, -116 lines) Patch
M chrome/browser/ui/libgtk2ui/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/libgtk2ui.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +134 lines, -0 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -116 lines 0 comments Download
A chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +128 lines, -0 lines 2 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 73 (18 generated)
joone
msw@ I added a test case to see only if there are any memory leaks ...
5 years, 3 months ago (2015-09-24 23:01:53 UTC) #2
msw
On 2015/09/24 23:01:53, joone wrote: > msw@ I added a test case to see only ...
5 years, 3 months ago (2015-09-24 23:11:04 UTC) #3
joone
On 2015/09/24 23:11:04, msw wrote: > On 2015/09/24 23:01:53, joone wrote: > > msw@ I ...
5 years, 2 months ago (2015-09-25 20:16:41 UTC) #4
joone
Bug report: https://code.google.com/p/chromium/issues/detail?id=537468
5 years, 2 months ago (2015-09-30 01:26:27 UTC) #5
joone
On 2015/09/30 01:26:27, joone wrote: > Bug report: https://code.google.com/p/chromium/issues/detail?id=537468 msw@ according to the above bug ...
5 years, 2 months ago (2015-10-15 21:53:36 UTC) #6
msw
On 2015/10/15 21:53:36, joone wrote: > On 2015/09/30 01:26:27, joone wrote: > > Bug report: ...
5 years, 2 months ago (2015-10-15 22:20:58 UTC) #7
joone
On 2015/10/15 22:20:58, msw wrote: > On 2015/10/15 21:53:36, joone wrote: > > On 2015/09/30 ...
5 years, 2 months ago (2015-10-16 06:52:22 UTC) #8
msw
Do you want to land this separately from https://codereview.chromium.org/1233913009 ? If so, you should add ...
5 years, 2 months ago (2015-10-16 17:01:04 UTC) #9
joone
https://codereview.chromium.org/1363093004/diff/80001/build/sanitizers/lsan_suppressions.cc File build/sanitizers/lsan_suppressions.cc (right): https://codereview.chromium.org/1363093004/diff/80001/build/sanitizers/lsan_suppressions.cc#newcode58 build/sanitizers/lsan_suppressions.cc:58: "leak:libglib-2.0\n" On 2015/10/16 17:01:03, msw wrote: > I wonder ...
5 years, 2 months ago (2015-10-16 23:33:46 UTC) #10
joone
glider@ could you take a look at the change in lsan_suppressions.cc if it makes sense? ...
5 years, 2 months ago (2015-10-16 23:40:17 UTC) #12
joone
5 years, 2 months ago (2015-10-16 23:43:14 UTC) #14
msw
+CC more build/sanitizers/OWNERS for suppression advice. https://codereview.chromium.org/1363093004/diff/120001/build/sanitizers/lsan_suppressions.cc File build/sanitizers/lsan_suppressions.cc (right): https://codereview.chromium.org/1363093004/diff/120001/build/sanitizers/lsan_suppressions.cc#newcode58 build/sanitizers/lsan_suppressions.cc:58: "leak:interactive_ui_tests\n" This is ...
5 years, 2 months ago (2015-10-20 23:18:14 UTC) #15
joone
https://codereview.chromium.org/1363093004/diff/120001/build/sanitizers/lsan_suppressions.cc File build/sanitizers/lsan_suppressions.cc (right): https://codereview.chromium.org/1363093004/diff/120001/build/sanitizers/lsan_suppressions.cc#newcode58 build/sanitizers/lsan_suppressions.cc:58: "leak:interactive_ui_tests\n" On 2015/10/20 23:18:14, msw wrote: > This is ...
5 years, 2 months ago (2015-10-22 02:14:47 UTC) #16
msw
https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc File build/sanitizers/lsan_suppressions.cc (right): https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc#newcode58 build/sanitizers/lsan_suppressions.cc:58: "leak:libgtk-x11-2.0\n" Yeah, it should be 'glib2.0-2.32.4', according to the ...
5 years, 2 months ago (2015-10-22 22:23:05 UTC) #17
joone
https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc File build/sanitizers/lsan_suppressions.cc (right): https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc#newcode58 build/sanitizers/lsan_suppressions.cc:58: "leak:libgtk-x11-2.0\n" On 2015/10/22 22:23:05, msw wrote: > Yeah, it ...
5 years, 2 months ago (2015-10-23 10:51:42 UTC) #23
Alexander Potapenko
On 2015/10/23 10:51:42, joone wrote: > https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc > File build/sanitizers/lsan_suppressions.cc (right): > > https://codereview.chromium.org/1363093004/diff/140001/build/sanitizers/lsan_suppressions.cc#newcode58 > ...
5 years, 2 months ago (2015-10-23 13:09:37 UTC) #24
msw
Glad that worked; lgtm with nits. https://codereview.chromium.org/1363093004/diff/200001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc (right): https://codereview.chromium.org/1363093004/diff/200001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc#newcode61 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc:61: // Close the ...
5 years, 2 months ago (2015-10-23 19:01:20 UTC) #25
joone
Thanks for the reviews. https://codereview.chromium.org/1363093004/diff/200001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc (right): https://codereview.chromium.org/1363093004/diff/200001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc#newcode61 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc:61: // Close the file dialog. ...
5 years, 2 months ago (2015-10-23 22:20:47 UTC) #26
msw
lgtm with a minor comment nit https://codereview.chromium.org/1363093004/diff/220001/ui/shell_dialogs/select_file_dialog.h File ui/shell_dialogs/select_file_dialog.h (right): https://codereview.chromium.org/1363093004/diff/220001/ui/shell_dialogs/select_file_dialog.h#newcode174 ui/shell_dialogs/select_file_dialog.h:174: // Close the ...
5 years, 2 months ago (2015-10-23 22:33:26 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1363093004/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1363093004/240001
5 years, 2 months ago (2015-10-24 02:44:32 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/112464)
5 years, 2 months ago (2015-10-24 02:51:04 UTC) #32
joone
On 2015/10/24 02:51:04, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 2 months ago (2015-10-24 03:43:51 UTC) #33
joone
sky@ could you review this CL?
5 years, 1 month ago (2015-10-30 06:47:01 UTC) #35
sky
https://codereview.chromium.org/1363093004/diff/240001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/1363093004/diff/240001/chrome/browser/ui/browser.h#newcode400 chrome/browser/ui/browser.h:400: ui::SelectFileDialog* OpenFile(); Document ownership. That said, AFAICT all you ...
5 years, 1 month ago (2015-10-30 15:31:17 UTC) #36
joone
https://codereview.chromium.org/1363093004/diff/240001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/1363093004/diff/240001/chrome/browser/ui/browser.h#newcode400 chrome/browser/ui/browser.h:400: ui::SelectFileDialog* OpenFile(); On 2015/10/30 15:31:17, sky wrote: > Document ...
5 years, 1 month ago (2015-10-30 15:59:59 UTC) #37
sky
That motivates writing the test for all platforms, but why do you need to change ...
5 years, 1 month ago (2015-10-30 16:59:16 UTC) #38
joone
On 2015/10/30 16:59:16, sky wrote: > That motivates writing the test for all platforms, but ...
5 years, 1 month ago (2015-10-31 08:19:37 UTC) #40
sadrul
https://codereview.chromium.org/1363093004/diff/280001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc (right): https://codereview.chromium.org/1363093004/diff/280001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc#newcode319 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc:319: // Send an ESC key event to the focused ...
5 years, 1 month ago (2015-10-31 16:36:17 UTC) #41
joone
On 2015/10/31 16:36:17, sadrul wrote: > https://codereview.chromium.org/1363093004/diff/280001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc > File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc (right): > > https://codereview.chromium.org/1363093004/diff/280001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc#newcode319 > ...
5 years, 1 month ago (2015-11-01 06:11:43 UTC) #42
joone
sadrul@ could you take a look at the updated CL?
5 years, 1 month ago (2015-11-01 07:49:35 UTC) #43
sadrul
https://codereview.chromium.org/1363093004/diff/300001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc (right): https://codereview.chromium.org/1363093004/diff/300001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc#newcode311 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc:311: } This seems unnecessarily complex (e.g. there's no reason ...
5 years, 1 month ago (2015-11-02 01:31:38 UTC) #44
sky
Also, if this is only for a test there is no reason to put the ...
5 years, 1 month ago (2015-11-02 16:36:32 UTC) #45
joone
On 2015/11/02 16:36:32, sky wrote: > Also, if this is only for a test there ...
5 years, 1 month ago (2015-11-03 03:46:45 UTC) #46
sky
On 2015/11/03 03:46:45, joone wrote: > On 2015/11/02 16:36:32, sky wrote: > > Also, if ...
5 years, 1 month ago (2015-11-03 17:09:15 UTC) #47
joone
On 2015/11/03 17:09:15, sky wrote: > On 2015/11/03 03:46:45, joone wrote: > > On 2015/11/02 ...
5 years, 1 month ago (2015-11-03 21:31:47 UTC) #48
sky
Expose the GtkWidget via a friend. On Tue, Nov 3, 2015 at 1:31 PM, <joone.hur@intel.com> ...
5 years, 1 month ago (2015-11-03 23:35:10 UTC) #49
joone
On 2015/11/03 23:35:10, sky wrote: > Expose the GtkWidget via a friend. > sky@ There ...
5 years, 1 month ago (2015-11-06 01:25:17 UTC) #52
sky
https://codereview.chromium.org/1363093004/diff/380001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h (right): https://codereview.chromium.org/1363093004/diff/380001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h#newcode1 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
5 years, 1 month ago (2015-11-06 21:04:10 UTC) #53
joone
sky@ Thanks for the review. https://codereview.chromium.org/1363093004/diff/380001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h (right): https://codereview.chromium.org/1363093004/diff/380001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h#newcode1 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.h:1: // Copyright (c) 2012 ...
5 years, 1 month ago (2015-11-09 20:50:07 UTC) #54
joone
sky@ could you review the latest CL?
5 years, 1 month ago (2015-11-13 00:10:27 UTC) #55
sky
Sadrul explicitly said not lgtm earlier in the thread. You need to get him happy.
5 years, 1 month ago (2015-11-13 16:06:11 UTC) #56
joone
On 2015/11/13 16:06:11, sky wrote: > Sadrul explicitly said not lgtm earlier in the thread. ...
5 years, 1 month ago (2015-11-13 22:17:52 UTC) #57
sadrul
lgtm https://codereview.chromium.org/1363093004/diff/420001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc (right): https://codereview.chromium.org/1363093004/diff/420001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc#newcode5 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc:5: - extra new line https://codereview.chromium.org/1363093004/diff/420001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc#newcode79 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc:79: if (select_file_dialog_.get()) ...
5 years, 1 month ago (2015-11-17 02:10:15 UTC) #58
joone
sadrul@ thanks for the review! https://codereview.chromium.org/1363093004/diff/420001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc File chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc (right): https://codereview.chromium.org/1363093004/diff/420001/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc#newcode5 chrome/browser/ui/libgtk2ui/select_file_dialog_impl_test.cc:5: On 2015/11/17 02:10:15, sadrul ...
5 years, 1 month ago (2015-11-17 23:16:22 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1363093004/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1363093004/440001
5 years, 1 month ago (2015-11-18 00:53:34 UTC) #62
commit-bot: I haz the power
A disapproval has been posted by following reviewers: sky@chromium.org. Please make sure to get positive ...
5 years, 1 month ago (2015-11-18 00:53:36 UTC) #64
joone
On 2015/11/18 00:53:36, commit-bot: I haz the power wrote: > A disapproval has been posted ...
5 years, 1 month ago (2015-11-18 01:01:07 UTC) #65
sky
Can you elaborate on the point of this test? AFAICT it is to verify gtk ...
5 years, 1 month ago (2015-11-18 16:17:09 UTC) #66
joone
On 2015/11/18 16:17:09, sky wrote: > Can you elaborate on the point of this test? ...
5 years, 1 month ago (2015-11-18 17:41:18 UTC) #67
sky
Please clarify, is the leak in gtk or chrome? On Wed, Nov 18, 2015 at ...
5 years, 1 month ago (2015-11-18 20:43:19 UTC) #68
joone
On 2015/11/18 20:43:19, sky wrote: > Please clarify, is the leak in gtk or chrome? ...
5 years, 1 month ago (2015-11-18 23:17:00 UTC) #69
sky
Writing tests for gtk is outside the scope of the Chromium project. The bug you ...
5 years, 1 month ago (2015-11-19 00:40:44 UTC) #70
joone
On 2015/11/19 00:40:44, sky wrote: > Writing tests for gtk is outside the scope of ...
5 years, 1 month ago (2015-11-19 01:58:57 UTC) #71
sky
On Wed, Nov 18, 2015 at 5:58 PM, <joone.hur@intel.com> wrote: > On 2015/11/19 00:40:44, sky ...
5 years, 1 month ago (2015-11-19 17:27:01 UTC) #72
joone
5 years, 1 month ago (2015-11-19 19:28:27 UTC) #73
On 2015/11/19 17:27:01, sky wrote:
> On Wed, Nov 18, 2015 at 5:58 PM,  <mailto:joone.hur@intel.com> wrote:
> > On 2015/11/19 00:40:44, sky wrote:
> >>
> >> Writing tests for gtk is outside the scope of the Chromium project.
> >> The bug you pointed to has also been closed with this.
> >
> >
> >> NOT LGTM
> >
> >
> >
> > I think that this test case has two purposes:
> > 1) Testing the file-picker of libgtk2ui to see if it works fine.
> 
> This test exercises showing and closing the file picker. That isn't a
> particularly compelling test.
> 
> > 2) Aware of the gtk+ memory leaks in file-picker. Without this test case,
> > someone may suffer from the same memory leak.
> 
> See earlier comments.
> 
>   -Scott
> 

I see. Due to the reviews, the test case was really improved so I will apply
this code to https://codereview.chromium.org/1233913009/

sky@ msw@ sadrul@ thanks for the reviews.

Powered by Google App Engine
This is Rietveld 408576698