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

Unified Diff: chrome/browser/ui/views/first_run_bubble_unittest.cc

Issue 1105373002: Add task runners to more tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstRunBubbleTest.CreateAndClose Created 5 years, 8 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/browser/ui/views/first_run_bubble_unittest.cc
diff --git a/chrome/browser/ui/views/first_run_bubble_unittest.cc b/chrome/browser/ui/views/first_run_bubble_unittest.cc
index d5f9386c68be52eaedb5484261bb37e015492caf..83c1b9c1f2b339b4325748a2b1ff66dd6e7f7f3d 100644
--- a/chrome/browser/ui/views/first_run_bubble_unittest.cc
+++ b/chrome/browser/ui/views/first_run_bubble_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/views/first_run_bubble.h"
+#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
@@ -19,12 +20,13 @@ class FirstRunBubbleTest : public views::ViewsTestBase {
// Overrides from views::ViewsTestBase:
void SetUp() override;
+ void TearDown() override;
protected:
- TestingProfile* profile() { return &profile_; }
+ TestingProfile* profile() { return profile_.get(); }
private:
- TestingProfile profile_;
+ scoped_ptr<TestingProfile> profile_;
DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleTest);
};
@@ -34,13 +36,20 @@ FirstRunBubbleTest::~FirstRunBubbleTest() {}
void FirstRunBubbleTest::SetUp() {
ViewsTestBase::SetUp();
+ profile_.reset(new TestingProfile());
TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
- &profile_, &TemplateURLServiceFactory::BuildInstanceFor);
+ profile_.get(), &TemplateURLServiceFactory::BuildInstanceFor);
TemplateURLService* turl_model =
- TemplateURLServiceFactory::GetForProfile(&profile_);
+ TemplateURLServiceFactory::GetForProfile(profile_.get());
turl_model->Load();
}
+void FirstRunBubbleTest::TearDown() {
+ ViewsTestBase::TearDown();
+ profile_.reset();
+ TestingBrowserProcess::DeleteInstance();
+}
+
TEST_F(FirstRunBubbleTest, CreateAndClose) {
// Create the anchor and parent widgets.
views::Widget::InitParams params =

Powered by Google App Engine
This is Rietveld 408576698