OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 tray_date->CreateDefaultViewForTesting(ash::user::LOGGED_IN_NONE); | 45 tray_date->CreateDefaultViewForTesting(ash::user::LOGGED_IN_NONE); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class SystemTrayDelegateChromeOSTest : public LoginManagerTest { | 50 class SystemTrayDelegateChromeOSTest : public LoginManagerTest { |
51 protected: | 51 protected: |
52 SystemTrayDelegateChromeOSTest() | 52 SystemTrayDelegateChromeOSTest() |
53 : LoginManagerTest(false /* should_launch_browser */) {} | 53 : LoginManagerTest(false /* should_launch_browser */) {} |
54 | 54 |
55 virtual ~SystemTrayDelegateChromeOSTest() {} | 55 ~SystemTrayDelegateChromeOSTest() override {} |
56 | 56 |
57 void SetupUserProfile(std::string user_name, bool use_24_hour_clock) { | 57 void SetupUserProfile(std::string user_name, bool use_24_hour_clock) { |
58 const user_manager::User* user = | 58 const user_manager::User* user = |
59 user_manager::UserManager::Get()->FindUser(user_name); | 59 user_manager::UserManager::Get()->FindUser(user_name); |
60 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); | 60 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); |
61 profile->GetPrefs()->SetBoolean(prefs::kUse24HourClock, use_24_hour_clock); | 61 profile->GetPrefs()->SetBoolean(prefs::kUse24HourClock, use_24_hour_clock); |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOSTest); | 65 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOSTest); |
(...skipping 18 matching lines...) Expand all Loading... |
84 AddUser(kUser2); | 84 AddUser(kUser2); |
85 SetupUserProfile(kUser2, false /* use_24_hour_clock */); | 85 SetupUserProfile(kUser2, false /* use_24_hour_clock */); |
86 CreateDefaultView(); | 86 CreateDefaultView(); |
87 EXPECT_EQ(base::k12HourClock, GetHourType()); | 87 EXPECT_EQ(base::k12HourClock, GetHourType()); |
88 user_manager::UserManager::Get()->SwitchActiveUser(kUser1); | 88 user_manager::UserManager::Get()->SwitchActiveUser(kUser1); |
89 CreateDefaultView(); | 89 CreateDefaultView(); |
90 EXPECT_EQ(base::k24HourClock, GetHourType()); | 90 EXPECT_EQ(base::k24HourClock, GetHourType()); |
91 } | 91 } |
92 | 92 |
93 } // namespace chromeos | 93 } // namespace chromeos |
OLD | NEW |