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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc

Issue 10443113: Fix memory leak in OneClickSigninHelperTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put back commented out call Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
index 7622cf2ff0ad5ba29ab990d3ec1bcc566a834f1f..58ce81fd2ecce1160d2a8420c5da2160fed96c60 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/message_loop.h"
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -65,7 +66,12 @@ class OneClickSigninHelperTest : public testing::Test {
void OneClickSigninHelperTest::TearDown() {
// Destroy things in proper order.
web_contents_.reset();
+
+ // Flush messages related web contents destruction before destroying the
Derek Bruening 2012/06/01 15:04:24 nit: grammar
+ // browser context.
+ MessageLoop::current()->RunAllPending();
profile_.reset();
+
ui_thread_.reset();
}
@@ -146,7 +152,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferIncognito) {
TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) {
MarkCurrentThreadAsUIThread();
- content::WebContents* web_contents = CreateMockWebContents(true);
+ content::WebContents* web_contents = CreateMockWebContents(false);
AllowSigninCookies(false);
EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents, true));
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698