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

Side by Side Diff: chrome/browser/signin/cross_device_promo_unittest.cc

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/signin/cross_device_promo.h" 5 #include "chrome/browser/signin/cross_device_promo.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/histogram_tester.h" 9 #include "base/test/histogram_tester.h"
10 #include "chrome/browser/prefs/browser_prefs.h" 10 #include "chrome/browser/prefs/browser_prefs.h"
11 #include "chrome/browser/prefs/pref_service_syncable.h"
12 #include "chrome/browser/signin/chrome_signin_client_factory.h" 11 #include "chrome/browser/signin/chrome_signin_client_factory.h"
13 #include "chrome/browser/signin/cross_device_promo_factory.h" 12 #include "chrome/browser/signin/cross_device_promo_factory.h"
14 #include "chrome/browser/signin/fake_gaia_cookie_manager_service.h" 13 #include "chrome/browser/signin/fake_gaia_cookie_manager_service.h"
15 #include "chrome/browser/signin/fake_signin_manager_builder.h" 14 #include "chrome/browser/signin/fake_signin_manager_builder.h"
16 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" 15 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
17 #include "chrome/browser/signin/signin_manager_factory.h" 16 #include "chrome/browser/signin/signin_manager_factory.h"
18 #include "chrome/browser/signin/test_signin_client_builder.h" 17 #include "chrome/browser/signin/test_signin_client_builder.h"
19 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
20 #include "chrome/test/base/testing_browser_process.h" 19 #include "chrome/test/base/testing_browser_process.h"
21 #include "chrome/test/base/testing_pref_service_syncable.h"
22 #include "chrome/test/base/testing_profile.h" 20 #include "chrome/test/base/testing_profile.h"
23 #include "chrome/test/base/testing_profile_manager.h" 21 #include "chrome/test/base/testing_profile_manager.h"
24 #include "components/signin/core/browser/signin_manager.h" 22 #include "components/signin/core/browser/signin_manager.h"
25 #include "components/signin/core/browser/signin_metrics.h" 23 #include "components/signin/core/browser/signin_metrics.h"
26 #include "components/signin/core/browser/test_signin_client.h" 24 #include "components/signin/core/browser/test_signin_client.h"
25 #include "components/syncable_prefs/pref_service_syncable.h"
26 #include "components/syncable_prefs/testing_pref_service_syncable.h"
27 #include "components/variations/entropy_provider.h" 27 #include "components/variations/entropy_provider.h"
28 #include "components/variations/variations_associated_data.h" 28 #include "components/variations/variations_associated_data.h"
29 #include "content/public/test/test_browser_thread_bundle.h" 29 #include "content/public/test/test_browser_thread_bundle.h"
30 #include "google_apis/gaia/gaia_urls.h" 30 #include "google_apis/gaia/gaia_urls.h"
31 #include "net/url_request/test_url_fetcher_factory.h" 31 #include "net/url_request/test_url_fetcher_factory.h"
32 #include "testing/gtest/include/gtest/gtest.h" 32 #include "testing/gtest/include/gtest/gtest.h"
33 33
34 namespace { 34 namespace {
35 35
36 typedef std::map<std::string, std::string> VariationsMap; 36 typedef std::map<std::string, std::string> VariationsMap;
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 EXPECT_EQ(2, prefs()->GetInteger(prefs::kCrossDevicePromoNumDevices)); 646 EXPECT_EQ(2, prefs()->GetInteger(prefs::kCrossDevicePromoNumDevices));
647 EXPECT_EQ(device2_last_active.ToInternalValue(), 647 EXPECT_EQ(device2_last_active.ToInternalValue(),
648 prefs()->GetInt64(prefs::kCrossDevicePromoLastDeviceActiveTime)); 648 prefs()->GetInt64(prefs::kCrossDevicePromoLastDeviceActiveTime));
649 EXPECT_TRUE(prefs()->GetBoolean(prefs::kCrossDevicePromoShouldBeShown)); 649 EXPECT_TRUE(prefs()->GetBoolean(prefs::kCrossDevicePromoShouldBeShown));
650 test_two_devices.ExpectUniqueSample("Signin.XDevicePromo.Eligibility", 650 test_two_devices.ExpectUniqueSample("Signin.XDevicePromo.Eligibility",
651 signin_metrics::ELIGIBLE, 1); 651 signin_metrics::ELIGIBLE, 1);
652 EXPECT_TRUE(observer.is_eligible()); 652 EXPECT_TRUE(observer.is_eligible());
653 EXPECT_EQ(1, observer.times_set_eligible()); 653 EXPECT_EQ(1, observer.times_set_eligible());
654 } 654 }
655 } 655 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/cross_device_promo_factory.cc ('k') | chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698