| 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 "chrome/browser/content_settings/cookie_settings.h" | 5 #include "chrome/browser/content_settings/cookie_settings.h" |
| 6 #include "chrome/browser/prefs/pref_service.h" | 6 #include "chrome/browser/prefs/pref_service.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 10 #include "chrome/browser/signin/signin_manager_fake.h" | 10 #include "chrome/browser/signin/signin_manager_fake.h" |
| 11 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 11 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
| 16 #include "content/public/browser/site_instance.h" | 16 #include "content/public/browser/site_instance.h" |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "content/test/test_browser_context.h" | |
| 19 #include "content/test/test_browser_thread.h" | 18 #include "content/test/test_browser_thread.h" |
| 20 #include "content/test/web_contents_tester.h" | 19 #include "content/test/web_contents_tester.h" |
| 21 #include "testing/gmock/include/gmock/gmock-actions.h" | 20 #include "testing/gmock/include/gmock/gmock-actions.h" |
| 22 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| 26 | 25 |
| 27 class OneClickSigninHelperTest : public testing::Test { | 26 class OneClickSigninHelperTest : public testing::Test { |
| 28 public: | 27 public: |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 145 } |
| 147 | 146 |
| 148 TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) { | 147 TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) { |
| 149 MarkCurrentThreadAsUIThread(); | 148 MarkCurrentThreadAsUIThread(); |
| 150 content::WebContents* web_contents = CreateMockWebContents(true); | 149 content::WebContents* web_contents = CreateMockWebContents(true); |
| 151 AllowSigninCookies(false); | 150 AllowSigninCookies(false); |
| 152 | 151 |
| 153 EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents, true)); | 152 EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents, true)); |
| 154 EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents, false)); | 153 EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents, false)); |
| 155 } | 154 } |
| OLD | NEW |