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

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

Issue 2526973002: Added retry policy (Closed)
Patch Set: Addressed further comments Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chromeos/login/enrollment/enterprise_enrollment_helper_ mock.h" 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ mock.h"
6 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
6 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h" 7 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h"
8 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
7 9
8 namespace chromeos { 10 namespace chromeos {
9 11
10 EnterpriseEnrollmentHelperMock::EnterpriseEnrollmentHelperMock( 12 EnterpriseEnrollmentHelperMock::EnterpriseEnrollmentHelperMock(
11 EnrollmentStatusConsumer* status_consumer) 13 EnrollmentStatusConsumer* status_consumer)
12 : EnterpriseEnrollmentHelper(status_consumer) {} 14 : EnterpriseEnrollmentHelper(status_consumer) {}
13 15
14 EnterpriseEnrollmentHelperMock::~EnterpriseEnrollmentHelperMock() {} 16 EnterpriseEnrollmentHelperMock::~EnterpriseEnrollmentHelperMock() {}
15 17
16 EnterpriseEnrollmentHelper::EnrollmentStatusConsumer* 18 EnterpriseEnrollmentHelper::EnrollmentStatusConsumer*
17 EnterpriseEnrollmentHelperMock::status_consumer() { 19 EnterpriseEnrollmentHelperMock::status_consumer() {
18 return EnterpriseEnrollmentHelper::status_consumer(); 20 return EnterpriseEnrollmentHelper::status_consumer();
19 } 21 }
20 22
23 void EnterpriseEnrollmentHelperMock::SucceedEnrollment() {
24 static_cast<EnrollmentScreen*>(status_consumer())
xiyuan 2017/02/03 23:34:15 static_cast should be avoided. Can you call stat
kumarniranjan 2017/02/06 21:38:25 The method OnDeviceAttributeUpdatePermission is no
xiyuan 2017/02/06 23:05:33 It seems to be part of EnrollmentStatusConsumer [1
kumarniranjan 2017/02/06 23:35:12 Sorry, I meant that ShowEnrollmentStatusOnSuccess
xiyuan 2017/02/06 23:46:05 Thank you for trying it out. static_cast makes En
kumarniranjan 2017/02/07 21:26:00 I came up with a solution using anonymous function
25 ->ShowEnrollmentStatusOnSuccess();
26 }
27
28 void EnterpriseEnrollmentHelperMock::FailEnrollment() {
29 status_consumer()->OnEnrollmentError(policy::EnrollmentStatus::ForStatus(
30 policy::EnrollmentStatus::REGISTRATION_FAILED));
31 }
32
21 } // namespace chromeos 33 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698