| 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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "base/observer_list.h" | 6 #include "base/observer_list.h" |
| 7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
| 11 #include "chrome/browser/signin/fake_signin_manager.h" | 11 #include "chrome/browser/signin/fake_signin_manager.h" |
| 12 #include "chrome/browser/signin/signin_names_io_thread.h" | 12 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 13 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "chrome/test/base/testing_profile_manager.h" | 15 #include "chrome/test/base/testing_profile_manager.h" |
| 16 #include "components/signin/core/browser/signin_manager.h" | 16 #include "components/signin/core/browser/signin_manager.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 class SigninNamesOnIOThreadTest : public testing::Test { | 22 class SigninNamesOnIOThreadTest : public testing::Test { |
| 23 public: | 23 public: |
| 24 SigninNamesOnIOThreadTest(); | 24 SigninNamesOnIOThreadTest(); |
| 25 virtual void SetUp() override; | 25 void SetUp() override; |
| 26 virtual void TearDown() override; | 26 void TearDown() override; |
| 27 | 27 |
| 28 void SimulateSignin(const base::string16& email); | 28 void SimulateSignin(const base::string16& email); |
| 29 void AddNewProfile(const base::string16& name, const base::string16& email); | 29 void AddNewProfile(const base::string16& name, const base::string16& email); |
| 30 | 30 |
| 31 base::MessageLoop message_loop_; | 31 base::MessageLoop message_loop_; |
| 32 content::TestBrowserThread ui_thread_; | 32 content::TestBrowserThread ui_thread_; |
| 33 content::TestBrowserThread io_thread_; | 33 content::TestBrowserThread io_thread_; |
| 34 scoped_ptr<TestingProfile> profile_; | 34 scoped_ptr<TestingProfile> profile_; |
| 35 FakeSigninManager* signin_manager_; | 35 FakeSigninManager* signin_manager_; |
| 36 TestingProfileManager testing_profile_manager_; | 36 TestingProfileManager testing_profile_manager_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 SigninNamesOnIOThread signin_names; | 108 SigninNamesOnIOThread signin_names; |
| 109 | 109 |
| 110 const SigninNamesOnIOThread::EmailSet& emails = signin_names.GetEmails(); | 110 const SigninNamesOnIOThread::EmailSet& emails = signin_names.GetEmails(); |
| 111 ASSERT_EQ(2u, emails.size()); | 111 ASSERT_EQ(2u, emails.size()); |
| 112 ASSERT_EQ(1u, emails.count(email1)); | 112 ASSERT_EQ(1u, emails.count(email1)); |
| 113 ASSERT_EQ(1u, emails.count(email2)); | 113 ASSERT_EQ(1u, emails.count(email2)); |
| 114 | 114 |
| 115 signin_names.ReleaseResourcesOnUIThread(); | 115 signin_names.ReleaseResourcesOnUIThread(); |
| 116 } | 116 } |
| OLD | NEW |