diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 13:26:51 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 13:26:51 +0000 |
commit | d5d7ebfc24f9a90183cc8bfd16243d604b35730f (patch) | |
tree | 70a48dd90aeca08579b846e40f2fd4ad02debf92 /chrome | |
parent | 2811d78a800287868e529161720b662d6994b792 (diff) | |
download | chromium_src-d5d7ebfc24f9a90183cc8bfd16243d604b35730f.zip chromium_src-d5d7ebfc24f9a90183cc8bfd16243d604b35730f.tar.gz chromium_src-d5d7ebfc24f9a90183cc8bfd16243d604b35730f.tar.bz2 |
Replace DeleteSoon with PostTask(DeleteTask) in browser_window_gtk for browser to be closed while in ui tests.
DevToolsSanityTests are running various scenarios including the ones that are waiting for browser to be closed. Tests are closing all the tabs in the browser and are running nested message loop until the BROWSER_CLOSE message arrives.
The browser close logic on Linux was using DeleteSoon on the window object, but DeleteSoon was never executed since the task was non-nestable. This change simply posts DeleteTask instead of DeleteSoon and hence browser close logic is working fine on a nested loop.
Review URL: http://codereview.chromium.org/151020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 1440791..9e362df 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -110,7 +110,11 @@ void MainWindowDestroy(GtkWidget* widget, BrowserWindowGtk* window) { // Additionally, now that we know the window is gone, we need to make sure to // set window_ to NULL, otherwise we will try to close the window again when // we call Close() in the destructor. - MessageLoop::current()->DeleteSoon(FROM_HERE, window); + // + // We don't want to use DeleteSoon() here since it won't work on a nested pump + // (like in UI tests). + MessageLoop::current()->PostTask(FROM_HERE, + new DeleteTask<BrowserWindowGtk>(window)); } // Using gtk_window_get_position/size creates a race condition, so only use |