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

Side by Side Diff: chrome/browser/chromeos/login/crash_restore_browsertest.cc

Issue 623293003: replace OVERRIDE and FINAL with override and final in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run git cl format on echo_dialog_view.h Created 6 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 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 19 matching lines...) Expand all
30 const char kUserId3[] = "user3@example.com"; 30 const char kUserId3[] = "user3@example.com";
31 31
32 } // namespace 32 } // namespace
33 33
34 class CrashRestoreSimpleTest : public InProcessBrowserTest { 34 class CrashRestoreSimpleTest : public InProcessBrowserTest {
35 protected: 35 protected:
36 CrashRestoreSimpleTest() {} 36 CrashRestoreSimpleTest() {}
37 37
38 virtual ~CrashRestoreSimpleTest() {} 38 virtual ~CrashRestoreSimpleTest() {}
39 39
40 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 40 virtual void SetUpCommandLine(CommandLine* command_line) override {
41 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1); 41 command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1);
42 command_line->AppendSwitchASCII( 42 command_line->AppendSwitchASCII(
43 switches::kLoginProfile, 43 switches::kLoginProfile,
44 CryptohomeClient::GetStubSanitizedUsername(kUserId1)); 44 CryptohomeClient::GetStubSanitizedUsername(kUserId1));
45 } 45 }
46 46
47 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 47 virtual void SetUpInProcessBrowserTestFixture() override {
48 // Redirect session_manager DBus calls to FakeSessionManagerClient. 48 // Redirect session_manager DBus calls to FakeSessionManagerClient.
49 session_manager_client_ = new FakeSessionManagerClient; 49 session_manager_client_ = new FakeSessionManagerClient;
50 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( 50 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient(
51 scoped_ptr<SessionManagerClient>(session_manager_client_)); 51 scoped_ptr<SessionManagerClient>(session_manager_client_));
52 session_manager_client_->StartSession(kUserId1); 52 session_manager_client_->StartSession(kUserId1);
53 } 53 }
54 54
55 FakeSessionManagerClient* session_manager_client_; 55 FakeSessionManagerClient* session_manager_client_;
56 }; 56 };
57 57
(...skipping 12 matching lines...) Expand all
70 public: 70 public:
71 UserSessionRestoreObserver() 71 UserSessionRestoreObserver()
72 : running_loop_(false), 72 : running_loop_(false),
73 user_sessions_restored_( 73 user_sessions_restored_(
74 UserSessionManager::GetInstance()->UserSessionsRestored()) { 74 UserSessionManager::GetInstance()->UserSessionsRestored()) {
75 if (!user_sessions_restored_) 75 if (!user_sessions_restored_)
76 UserSessionManager::GetInstance()->AddSessionStateObserver(this); 76 UserSessionManager::GetInstance()->AddSessionStateObserver(this);
77 } 77 }
78 virtual ~UserSessionRestoreObserver() {} 78 virtual ~UserSessionRestoreObserver() {}
79 79
80 virtual void PendingUserSessionsRestoreFinished() OVERRIDE { 80 virtual void PendingUserSessionsRestoreFinished() override {
81 user_sessions_restored_ = true; 81 user_sessions_restored_ = true;
82 UserSessionManager::GetInstance()->RemoveSessionStateObserver(this); 82 UserSessionManager::GetInstance()->RemoveSessionStateObserver(this);
83 if (!running_loop_) 83 if (!running_loop_)
84 return; 84 return;
85 85
86 message_loop_runner_->Quit(); 86 message_loop_runner_->Quit();
87 running_loop_ = false; 87 running_loop_ = false;
88 } 88 }
89 89
90 // Wait until the user sessions are restored. If that happened between the 90 // Wait until the user sessions are restored. If that happened between the
(...skipping 14 matching lines...) Expand all
105 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; 105 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
106 106
107 DISALLOW_COPY_AND_ASSIGN(UserSessionRestoreObserver); 107 DISALLOW_COPY_AND_ASSIGN(UserSessionRestoreObserver);
108 }; 108 };
109 109
110 class CrashRestoreComplexTest : public CrashRestoreSimpleTest { 110 class CrashRestoreComplexTest : public CrashRestoreSimpleTest {
111 protected: 111 protected:
112 CrashRestoreComplexTest() {} 112 CrashRestoreComplexTest() {}
113 virtual ~CrashRestoreComplexTest() {} 113 virtual ~CrashRestoreComplexTest() {}
114 114
115 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 115 virtual void SetUpInProcessBrowserTestFixture() override {
116 CrashRestoreSimpleTest::SetUpInProcessBrowserTestFixture(); 116 CrashRestoreSimpleTest::SetUpInProcessBrowserTestFixture();
117 session_manager_client_->StartSession(kUserId2); 117 session_manager_client_->StartSession(kUserId2);
118 session_manager_client_->StartSession(kUserId3); 118 session_manager_client_->StartSession(kUserId3);
119 } 119 }
120 }; 120 };
121 121
122 IN_PROC_BROWSER_TEST_F(CrashRestoreComplexTest, RestoreSessionForThreeUsers) { 122 IN_PROC_BROWSER_TEST_F(CrashRestoreComplexTest, RestoreSessionForThreeUsers) {
123 { 123 {
124 UserSessionRestoreObserver restore_observer; 124 UserSessionRestoreObserver restore_observer;
125 restore_observer.Wait(); 125 restore_observer.Wait();
(...skipping 18 matching lines...) Expand all
144 users[0]->username_hash()); 144 users[0]->username_hash());
145 EXPECT_EQ(kUserId2, users[1]->email()); 145 EXPECT_EQ(kUserId2, users[1]->email());
146 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2), 146 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId2),
147 users[1]->username_hash()); 147 users[1]->username_hash());
148 EXPECT_EQ(kUserId1, users[2]->email()); 148 EXPECT_EQ(kUserId1, users[2]->email());
149 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1), 149 EXPECT_EQ(CryptohomeClient::GetStubSanitizedUsername(kUserId1),
150 users[2]->username_hash()); 150 users[2]->username_hash());
151 } 151 }
152 152
153 } // namespace chromeos 153 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698