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

Side by Side Diff: chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc

Issue 2705363002: cros: Move BaseScreenDelegate::ExitCodes into separate file, ScreenExitCode. (Closed)
Patch Set: Rebase Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" 9 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
10 #include "chrome/browser/chromeos/login/enrollment/mock_enrollment_screen.h" 10 #include "chrome/browser/chromeos/login/enrollment/mock_enrollment_screen.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 base::RunLoop run_loop; 48 base::RunLoop run_loop;
49 MockBaseScreenDelegate mock_base_screen_delegate; 49 MockBaseScreenDelegate mock_base_screen_delegate;
50 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 50 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
51 &mock_base_screen_delegate; 51 &mock_base_screen_delegate;
52 52
53 ASSERT_EQ(WizardController::default_controller()->current_screen(), 53 ASSERT_EQ(WizardController::default_controller()->current_screen(),
54 enrollment_screen); 54 enrollment_screen);
55 55
56 EXPECT_CALL(mock_base_screen_delegate, 56 EXPECT_CALL(mock_base_screen_delegate,
57 OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_COMPLETED, _)) 57 OnExit(_, ScreenExitCode::ENTERPRISE_ENROLLMENT_COMPLETED, _))
58 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 58 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
59 enrollment_screen->OnCancel(); 59 enrollment_screen->OnCancel();
60 content::RunThisRunLoop(&run_loop); 60 content::RunThisRunLoop(&run_loop);
61 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); 61 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
62 62
63 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 63 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
64 WizardController::default_controller(); 64 WizardController::default_controller();
65 } 65 }
66 66
67 // Flaky test: crbug.com/394069 67 // Flaky test: crbug.com/394069
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 base::RunLoop run_loop; 112 base::RunLoop run_loop;
113 MockBaseScreenDelegate mock_base_screen_delegate; 113 MockBaseScreenDelegate mock_base_screen_delegate;
114 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 114 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
115 &mock_base_screen_delegate; 115 &mock_base_screen_delegate;
116 116
117 ASSERT_EQ(WizardController::default_controller()->current_screen(), 117 ASSERT_EQ(WizardController::default_controller()->current_screen(),
118 enrollment_screen); 118 enrollment_screen);
119 119
120 EXPECT_CALL(mock_base_screen_delegate, 120 EXPECT_CALL(mock_base_screen_delegate,
121 OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_COMPLETED, _)) 121 OnExit(_, ScreenExitCode::ENTERPRISE_ENROLLMENT_COMPLETED, _))
122 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 122 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
123 ASSERT_FALSE(enrollment_screen->AdvanceToNextAuth()); 123 ASSERT_FALSE(enrollment_screen->AdvanceToNextAuth());
124 enrollment_screen->OnCancel(); 124 enrollment_screen->OnCancel();
125 content::RunThisRunLoop(&run_loop); 125 content::RunThisRunLoop(&run_loop);
126 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); 126 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
127 127
128 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 128 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
129 WizardController::default_controller(); 129 WizardController::default_controller();
130 } 130 }
131 131
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 base::RunLoop run_loop; 184 base::RunLoop run_loop;
185 MockBaseScreenDelegate mock_base_screen_delegate; 185 MockBaseScreenDelegate mock_base_screen_delegate;
186 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 186 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
187 &mock_base_screen_delegate; 187 &mock_base_screen_delegate;
188 188
189 ASSERT_EQ(WizardController::default_controller()->current_screen(), 189 ASSERT_EQ(WizardController::default_controller()->current_screen(),
190 enrollment_screen); 190 enrollment_screen);
191 191
192 EXPECT_CALL(mock_base_screen_delegate, 192 EXPECT_CALL(mock_base_screen_delegate,
193 OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_BACK, _)) 193 OnExit(_, ScreenExitCode::ENTERPRISE_ENROLLMENT_BACK, _))
194 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 194 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
195 ASSERT_FALSE(enrollment_screen->AdvanceToNextAuth()); 195 ASSERT_FALSE(enrollment_screen->AdvanceToNextAuth());
196 enrollment_screen->OnCancel(); 196 enrollment_screen->OnCancel();
197 content::RunThisRunLoop(&run_loop); 197 content::RunThisRunLoop(&run_loop);
198 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); 198 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
199 199
200 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 200 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
201 WizardController::default_controller(); 201 WizardController::default_controller();
202 } 202 }
203 203
(...skipping 26 matching lines...) Expand all
230 230
231 base::RunLoop run_loop; 231 base::RunLoop run_loop;
232 MockBaseScreenDelegate mock_base_screen_delegate; 232 MockBaseScreenDelegate mock_base_screen_delegate;
233 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 233 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
234 &mock_base_screen_delegate; 234 &mock_base_screen_delegate;
235 235
236 ASSERT_EQ(WizardController::default_controller()->current_screen(), 236 ASSERT_EQ(WizardController::default_controller()->current_screen(),
237 enrollment_screen); 237 enrollment_screen);
238 238
239 EXPECT_CALL(mock_base_screen_delegate, 239 EXPECT_CALL(mock_base_screen_delegate,
240 OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_BACK, _)) 240 OnExit(_, ScreenExitCode::ENTERPRISE_ENROLLMENT_BACK, _))
241 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 241 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
242 ASSERT_TRUE(enrollment_screen->AdvanceToNextAuth()); 242 ASSERT_TRUE(enrollment_screen->AdvanceToNextAuth());
243 enrollment_screen->OnCancel(); 243 enrollment_screen->OnCancel();
244 content::RunThisRunLoop(&run_loop); 244 content::RunThisRunLoop(&run_loop);
245 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); 245 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
246 246
247 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 247 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
248 WizardController::default_controller(); 248 WizardController::default_controller();
249 } 249 }
250 250
(...skipping 24 matching lines...) Expand all
275 275
276 base::RunLoop run_loop; 276 base::RunLoop run_loop;
277 MockBaseScreenDelegate mock_base_screen_delegate; 277 MockBaseScreenDelegate mock_base_screen_delegate;
278 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 278 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
279 &mock_base_screen_delegate; 279 &mock_base_screen_delegate;
280 280
281 ASSERT_EQ(WizardController::default_controller()->current_screen(), 281 ASSERT_EQ(WizardController::default_controller()->current_screen(),
282 enrollment_screen); 282 enrollment_screen);
283 283
284 EXPECT_CALL(mock_base_screen_delegate, 284 EXPECT_CALL(mock_base_screen_delegate,
285 OnExit(_, BaseScreenDelegate::ENTERPRISE_ENROLLMENT_BACK, _)) 285 OnExit(_, ScreenExitCode::ENTERPRISE_ENROLLMENT_BACK, _))
286 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 286 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
287 enrollment_screen->OnCancel(); 287 enrollment_screen->OnCancel();
288 content::RunThisRunLoop(&run_loop); 288 content::RunThisRunLoop(&run_loop);
289 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate); 289 Mock::VerifyAndClearExpectations(&mock_base_screen_delegate);
290 290
291 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ = 291 static_cast<BaseScreen*>(enrollment_screen)->base_screen_delegate_ =
292 WizardController::default_controller(); 292 WizardController::default_controller();
293 } 293 }
294 294
295 } // namespace chromeos 295 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698