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

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

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android webview init fix merged in. Created 7 years, 4 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/sync/sync_promo_ui_unittest.cc
diff --git a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
index 1a9d8d6727e0a10bd6127794cec4828b2ae678ac..20aa0296066ef9c029141831918eb7071ea79e47 100644
--- a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
+++ b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
@@ -12,26 +12,18 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
class SyncPromoUITest : public testing::Test {
- public:
- SyncPromoUITest() {}
-
- // testing::Test:
- virtual void SetUp() OVERRIDE {
- testing::Test::SetUp();
- profile_.reset(new TestingProfile());
- }
-
protected:
void CreateSigninManager(const std::string& username) {
SigninManagerBase* signin_manager =
static_cast<FakeSigninManagerBase*>(
SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
- profile_.get(),
+ &profile_,
&FakeSigninManagerBase::Build));
- signin_manager->Initialize(profile_.get(), NULL);
+ signin_manager->Initialize(&profile_, NULL);
if (!username.empty()) {
ASSERT_TRUE(signin_manager);
@@ -43,10 +35,8 @@ class SyncPromoUITest : public testing::Test {
CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
}
- scoped_ptr<TestingProfile> profile_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SyncPromoUITest);
+ content::TestBrowserThreadBundle thread_bundle_;
+ TestingProfile profile_;
};
// Verifies that ShouldShowSyncPromo returns false if sync is disabled by
@@ -54,7 +44,7 @@ class SyncPromoUITest : public testing::Test {
TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncDisabled) {
CreateSigninManager("");
DisableSync();
- EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
+ EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
}
// Verifies that ShouldShowSyncPromo returns true if all conditions to
@@ -63,8 +53,8 @@ TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncEnabled) {
CreateSigninManager("");
#if defined(OS_CHROMEOS)
// No sync promo on CrOS.
- EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
+ EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
#else
- EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
+ EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
#endif
}

Powered by Google App Engine
This is Rietveld 408576698