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

Side by Side Diff: chromeos/login/scoped_test_public_session_login_state.h

Issue 2856053004: [Refactor] Use ScopedTestPublicSessionLoginState in code (Closed)
Patch Set: Rebase Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_ 5 #ifndef CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_
6 #define CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_ 6 #define CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
11 11
12 // A class to start and shutdown public session state for a test. 12 // A class to start and shutdown public session state for a test. Only one
13 // instance is allowed to exist at a given time. To be instantiated on the stack
14 // (so it nicely cleans up after going out of scope).
13 class ScopedTestPublicSessionLoginState { 15 class ScopedTestPublicSessionLoginState {
14 public: 16 public:
15 ScopedTestPublicSessionLoginState(); 17 ScopedTestPublicSessionLoginState();
16 ~ScopedTestPublicSessionLoginState(); 18 ~ScopedTestPublicSessionLoginState();
17 19
18 private: 20 private:
21 bool needs_shutdown_ = false;
22
19 DISALLOW_COPY_AND_ASSIGN(ScopedTestPublicSessionLoginState); 23 DISALLOW_COPY_AND_ASSIGN(ScopedTestPublicSessionLoginState);
20 }; 24 };
21 25
22 } // namespace chromeos 26 } // namespace chromeos
23 27
24 #endif // CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_ 28 #endif // CHROMEOS_LOGIN_SCOPED_TEST_PUBLIC_SESSION_LOGIN_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698