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

Side by Side Diff: ash/common/test/test_system_tray_delegate.h

Issue 2420783002: mustash: Convert TraySupervisedUserTest to AshTest (Closed)
Patch Set: Created 4 years, 2 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 #ifndef ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ 5 #ifndef ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_
6 #define ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ 6 #define ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_
7 7
8 #include "ash/common/system/tray/default_system_tray_delegate.h" 8 #include "ash/common/system/tray/default_system_tray_delegate.h"
9 #include "ash/common/system/tray/ime_info.h" 9 #include "ash/common/system/tray/ime_info.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace test { 14 namespace test {
15 15
16 class TestSystemTrayDelegate : public DefaultSystemTrayDelegate { 16 class TestSystemTrayDelegate : public DefaultSystemTrayDelegate {
17 public: 17 public:
18 TestSystemTrayDelegate(); 18 TestSystemTrayDelegate();
19 ~TestSystemTrayDelegate() override; 19 ~TestSystemTrayDelegate() override;
20 20
21 // Sets whether a system update is required. Defaults to false. Static so 21 // Sets whether a system update is required. Defaults to false. Static so
22 // tests can set the value before the system tray is constructed. Reset in 22 // tests can set the value before the system tray is constructed. Reset in
23 // AshTestHelper::TearDown. 23 // AshTestHelper::TearDown.
24 static void SetSystemUpdateRequired(bool required); 24 static void SetSystemUpdateRequired(bool required);
25 25
26 // Changes the login status when initially the delegate is created. This will 26 // Changes the login status when initially the delegate is created. This will
27 // be called before AshTestBase::SetUp() to test the case when chrome is 27 // be called before AshTestBase::SetUp() to test the case when chrome is
28 // restarted right after the login (such like a flag is set). 28 // restarted right after the login (such like a flag is set). Tests must reset
29 // This value will be reset in AshTestHelper::TearDown, most test fixtures 29 // to LoginStatus::USER after they complete.
30 // don't need to care its lifecycle.
31 static void SetInitialLoginStatus(LoginStatus login_status); 30 static void SetInitialLoginStatus(LoginStatus login_status);
32 31
33 // Changes the current login status in the test. This also invokes 32 // Changes the current login status in the test. This also invokes
34 // UpdateAfterLoginStatusChange(). Usually this is called in the test code to 33 // UpdateAfterLoginStatusChange(). Usually this is called in the test code to
35 // set up a login status. This will fit to most of the test cases, but this 34 // set up a login status. This will fit to most of the test cases, but this
36 // cannot be set during the initialization. To test the initialization, 35 // cannot be set during the initialization. To test the initialization,
37 // consider using SetInitialLoginStatus() instead. 36 // consider using SetInitialLoginStatus() instead.
38 void SetLoginStatus(LoginStatus login_status); 37 void SetLoginStatus(LoginStatus login_status);
39 38
40 // Updates the session length limit so that the limit will come from now in 39 // Updates the session length limit so that the limit will come from now in
(...skipping 26 matching lines...) Expand all
67 IMEInfo current_ime_; 66 IMEInfo current_ime_;
68 IMEInfoList ime_list_; 67 IMEInfoList ime_list_;
69 68
70 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); 69 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate);
71 }; 70 };
72 71
73 } // namespace test 72 } // namespace test
74 } // namespace ash 73 } // namespace ash
75 74
76 #endif // ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ 75 #endif // ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698