diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 16:15:21 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 16:15:21 +0000 |
commit | 3c44df5b169f8e7617eeb02a167dced84a5c108a (patch) | |
tree | 2f661809b1c9ddbb83f543c528191b95b4ff1dcf | |
parent | 85da1b8a8bf56b3596f2150a66537810a54d18eb (diff) | |
download | chromium_src-3c44df5b169f8e7617eeb02a167dced84a5c108a.zip chromium_src-3c44df5b169f8e7617eeb02a167dced84a5c108a.tar.gz chromium_src-3c44df5b169f8e7617eeb02a167dced84a5c108a.tar.bz2 |
Attempt at fixing flaky test. SelectFileDialog may be invoked after a
delay (DownloadManager triggers this code path, because it posts a
task from the file thread to the UI thread). As such, it is entirely
possible for SelectFileDialog to be run at a point when there are no
browsers, causing the DCHECK to hit (and my test to crash). I'm
removing the DCHECK and silently doing nothing in this case. The
assumption being we're in the process of going down.
BUG=77168
TEST=covered by test
R=xiyuan@chromium.org,ben@chromium.org,phadjan.jr@chromium.org
Review URL: http://codereview.chromium.org/6834027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81600 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/instant/instant_browsertest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/views/select_file_dialog.cc | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc index 757af10..a9632cc 100644 --- a/chrome/browser/instant/instant_browsertest.cc +++ b/chrome/browser/instant/instant_browsertest.cc @@ -771,13 +771,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, DontCrashOnBlockedJS) { // As long as we get the notification we're good (the renderer didn't crash). } -// Crashes on linux: http://crbug.com/77168. -#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) -#define MAYBE_DownloadOnEnter DISABLED_DownloadOnEnter -#else -#define MAYBE_DownloadOnEnter DownloadOnEnter -#endif -IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_DownloadOnEnter) { +IN_PROC_BROWSER_TEST_F(InstantTest, DownloadOnEnter) { ASSERT_TRUE(test_server()->Start()); EnableInstant(); // Make sure the browser window is the front most window. diff --git a/chrome/browser/ui/views/select_file_dialog.cc b/chrome/browser/ui/views/select_file_dialog.cc index 4a5f61e..2590005 100644 --- a/chrome/browser/ui/views/select_file_dialog.cc +++ b/chrome/browser/ui/views/select_file_dialog.cc @@ -228,8 +228,10 @@ void SelectFileDialogImpl::SelectFile( if (browser_mode_) { Browser* browser = BrowserList::GetLastActive(); - DCHECK(browser); - browser->BrowserShowHtmlDialog(file_browse_delegate, owning_window); + // As SelectFile may be invoked after a delay, it is entirely possible for + // it be invoked when no browser is around. Silently ignore this case. + if (browser) + browser->BrowserShowHtmlDialog(file_browse_delegate, owning_window); } else { BrowserThread::PostTask( BrowserThread::UI, |