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

Unified Diff: chrome/test/base/browser_with_test_window_test.cc

Issue 9420036: Also delay regular profile destruction... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge Goof fix... 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
Index: chrome/test/base/browser_with_test_window_test.cc
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc
index 0ba91f08b25e708d3cf86d5f23d4743e8ce7ab13..10c9b76d5f31af7330e98d885292a71cb69ef262 100644
--- a/chrome/test/base/browser_with_test_window_test.cc
+++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -5,6 +5,7 @@
#include "chrome/test/base/browser_with_test_window_test.h"
#include "base/synchronization/waitable_event.h"
+#include "chrome/browser/profiles/profile_destroyer.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -45,7 +46,7 @@ BrowserWithTestWindowTest::BrowserWithTestWindowTest()
void BrowserWithTestWindowTest::SetUp() {
testing::Test::SetUp();
- profile_.reset(CreateProfile());
+ set_profile(CreateProfile());
browser_.reset(new Browser(Browser::TYPE_TABBED, profile()));
window_.reset(new TestBrowserWindow(browser()));
browser_->SetWindowForTesting(window_.get());
@@ -86,6 +87,13 @@ BrowserWithTestWindowTest::~BrowserWithTestWindowTest() {
MessageLoop::current()->Run();
}
+void BrowserWithTestWindowTest::set_profile(TestingProfile* profile) {
+ if (profile_.get() != NULL)
+ ProfileDestroyer::DestroyProfileWhenAppropriate(profile_.release());
+
+ profile_.reset(profile);
+}
+
void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) {
browser::NavigateParams params(browser, url, content::PAGE_TRANSITION_TYPED);
params.tabstrip_index = 0;
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.h ('k') | chrome/test/data/extensions/api_test/get_views/infobar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698