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

Side by Side Diff: chrome/browser/chromeos/power/power_prefs_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/power/power_prefs.h" 5 #include "chrome/browser/chromeos/power/power_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" 16 #include "chrome/browser/chromeos/profiles/profile_helper.h"
17 #include "chrome/browser/extensions/extension_special_storage_policy.h" 17 #include "chrome/browser/extensions/extension_special_storage_policy.h"
18 #include "chrome/browser/prefs/browser_prefs.h" 18 #include "chrome/browser/prefs/browser_prefs.h"
19 #include "chrome/browser/prefs/pref_service_syncable.h"
20 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/profiles/profile_manager.h" 20 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/common/chrome_constants.h" 21 #include "chrome/common/chrome_constants.h"
23 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
24 #include "chrome/test/base/testing_browser_process.h" 23 #include "chrome/test/base/testing_browser_process.h"
25 #include "chrome/test/base/testing_pref_service_syncable.h"
26 #include "chrome/test/base/testing_profile.h" 24 #include "chrome/test/base/testing_profile.h"
27 #include "chrome/test/base/testing_profile_manager.h" 25 #include "chrome/test/base/testing_profile_manager.h"
28 #include "chromeos/dbus/fake_power_manager_client.h" 26 #include "chromeos/dbus/fake_power_manager_client.h"
29 #include "chromeos/dbus/power_manager/policy.pb.h" 27 #include "chromeos/dbus/power_manager/policy.pb.h"
30 #include "chromeos/dbus/power_policy_controller.h" 28 #include "chromeos/dbus/power_policy_controller.h"
31 #include "components/pref_registry/pref_registry_syncable.h" 29 #include "components/pref_registry/pref_registry_syncable.h"
30 #include "components/syncable_prefs/pref_service_syncable.h"
31 #include "components/syncable_prefs/testing_pref_service_syncable.h"
32 #include "content/public/browser/notification_details.h" 32 #include "content/public/browser/notification_details.h"
33 #include "content/public/browser/notification_service.h" 33 #include "content/public/browser/notification_service.h"
34 #include "content/public/browser/notification_source.h" 34 #include "content/public/browser/notification_source.h"
35 #include "content/public/test/test_browser_thread_bundle.h" 35 #include "content/public/test/test_browser_thread_bundle.h"
36 #include "testing/gtest/include/gtest/gtest.h" 36 #include "testing/gtest/include/gtest/gtest.h"
37 37
38 namespace chromeos { 38 namespace chromeos {
39 39
40 class PowerPrefsTest : public testing::Test { 40 class PowerPrefsTest : public testing::Test {
41 protected: 41 protected:
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 content::Source<Profile>(user_profile), 295 content::Source<Profile>(user_profile),
296 content::NotificationService::NoDetails()); 296 content::NotificationService::NoDetails());
297 297
298 // The user profile's prefs should still be used. 298 // The user profile's prefs should still be used.
299 EXPECT_FALSE(GetProfile()); 299 EXPECT_FALSE(GetProfile());
300 EXPECT_EQ(GetExpectedPowerPolicyForProfile(user_profile, UNLOCKED), 300 EXPECT_EQ(GetExpectedPowerPolicyForProfile(user_profile, UNLOCKED),
301 GetCurrentPowerPolicy()); 301 GetCurrentPowerPolicy());
302 } 302 }
303 303
304 } // namespace chromeos 304 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc ('k') | chrome/browser/chromeos/preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698