| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 content::TestBrowserThread ui_thread_; | 208 content::TestBrowserThread ui_thread_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelperTest); | 210 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelperTest); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 OneClickSigninHelperTest::OneClickSigninHelperTest() | 213 OneClickSigninHelperTest::OneClickSigninHelperTest() |
| 214 : ui_thread_(content::BrowserThread::UI, &message_loop_) { | 214 : ui_thread_(content::BrowserThread::UI, &message_loop_) { |
| 215 } | 215 } |
| 216 | 216 |
| 217 void OneClickSigninHelperTest::SetUp() { | 217 void OneClickSigninHelperTest::SetUp() { |
| 218 // Make sure web flow is enabled for tests. | |
| 219 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 220 switches::kUseWebBasedSigninFlow); | |
| 221 | |
| 222 TestingProfile* testing_profile = new TestingProfile(); | 218 TestingProfile* testing_profile = new TestingProfile(); |
| 223 browser_context_.reset(testing_profile); | 219 browser_context_.reset(testing_profile); |
| 224 | 220 |
| 225 content::RenderViewHostTestHarness::SetUp(); | 221 content::RenderViewHostTestHarness::SetUp(); |
| 226 } | 222 } |
| 227 | 223 |
| 228 void OneClickSigninHelperTest::CreateSigninManager( | 224 void OneClickSigninHelperTest::CreateSigninManager( |
| 229 bool use_incognito, | 225 bool use_incognito, |
| 230 const std::string& username) { | 226 const std::string& username) { |
| 231 TestingProfile* testing_profile = static_cast<TestingProfile*>( | 227 TestingProfile* testing_profile = static_cast<TestingProfile*>( |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 valid_gaia_url_, "", &request_, io_data.get())); | 615 valid_gaia_url_, "", &request_, io_data.get())); |
| 620 } | 616 } |
| 621 | 617 |
| 622 TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) { | 618 TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) { |
| 623 AllowSigninCookies(false); | 619 AllowSigninCookies(false); |
| 624 scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); | 620 scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); |
| 625 EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, | 621 EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, |
| 626 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 622 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
| 627 valid_gaia_url_, "", &request_, io_data.get())); | 623 valid_gaia_url_, "", &request_, io_data.get())); |
| 628 } | 624 } |
| OLD | NEW |