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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.cc
diff --git a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.cc b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.cc
index b3a45e2ef0e9c15cc93c1315f838e1b9c34b71e3..4f889c09afb224d234dbf25146abfad99309ecff 100644
--- a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.cc
+++ b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_mock.h"
+#include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
#include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.h"
+#include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
namespace chromeos {
@@ -18,4 +20,14 @@ EnterpriseEnrollmentHelperMock::status_consumer() {
return EnterpriseEnrollmentHelper::status_consumer();
}
+void EnterpriseEnrollmentHelperMock::SucceedEnrollment() {
+ 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
+ ->ShowEnrollmentStatusOnSuccess();
+}
+
+void EnterpriseEnrollmentHelperMock::FailEnrollment() {
+ status_consumer()->OnEnrollmentError(policy::EnrollmentStatus::ForStatus(
+ policy::EnrollmentStatus::REGISTRATION_FAILED));
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698