Index: chrome/browser/chromeos/login/wizard_controller.cc |
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc |
index 782236cc53f948940b254edd9723f03e85269532..bd058505555c2350524a2b736f77b8dc1e0687c0 100644 |
--- a/chrome/browser/chromeos/login/wizard_controller.cc |
+++ b/chrome/browser/chromeos/login/wizard_controller.cc |
@@ -12,6 +12,7 @@ |
#include <vector> |
#include "base/bind.h" |
+#include "base/callback_helpers.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
#include "base/prefs/pref_registry_simple.h" |
@@ -154,6 +155,7 @@ WizardController::WizardController(chromeos::LoginDisplayHost* host, |
skip_update_enroll_after_eula_(false), |
login_screen_started_(false), |
user_image_screen_return_to_previous_hack_(false), |
+ timezone_resolved_(false), |
weak_factory_(this) { |
DCHECK(default_controller_ == NULL); |
default_controller_ = this; |
@@ -1000,6 +1002,9 @@ void WizardController::OnTimezoneResolved( |
// (timezone_provider_) in this case. Expect crash here. |
DCHECK(timezone_provider_.get()); |
+ timezone_resolved_ = true; |
+ base::ScopedClosureRunner inform_test(on_timezone_resolved_for_testing_); |
+ |
VLOG(1) << "Resolved local timezone={" << timezone->ToStringForDebug() |
<< "}."; |
@@ -1066,4 +1071,13 @@ void WizardController::OnLocationResolved(const Geoposition& position, |
base::Unretained(this))); |
} |
+bool WizardController::SetOnTimeZoneResolvedForTesting( |
+ const base::Closure& callback) { |
+ if (timezone_resolved_) |
+ return true; |
+ |
+ on_timezone_resolved_for_testing_ = callback; |
+ return false; |
+} |
+ |
} // namespace chromeos |