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

Unified Diff: chrome/browser/chromeos/login/screens/update_screen_browsertest.cc

Issue 1018523007: ChromeOS: Do not show the error dialog when captive portal is detected in OOBE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser tests. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/screens/update_screen_browsertest.cc
diff --git a/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc b/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc
index 771650b86312e81419fe07a360cacc4f3413dab4..d28437135ba8d13dc914dd07c18068fb8cd72010 100644
--- a/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc
+++ b/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc
@@ -240,7 +240,7 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestTemproraryOfflineNetwork) {
portal_state.response_code = 200;
SetDetectionResults(kStubEthernetGuid, portal_state);
- // Update screen will show error message about portal state because
+ // Update screen will delay error message about portal state because
// ethernet is behind captive portal.
EXPECT_CALL(*mock_error_screen_,
MockSetUIState(NetworkError::UI_STATE_UPDATE)).Times(1);
@@ -252,6 +252,15 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestTemproraryOfflineNetwork) {
update_screen_->StartNetworkCheck();
+ // Force timer expiration.
+ {
+ base::Closure timed_callback =
+ update_screen_->GetErrorMessageTimerForTesting().user_task();
+ ASSERT_FALSE(timed_callback.is_null());
+ update_screen_->GetErrorMessageTimerForTesting().Reset();
+ timed_callback.Run();
+ }
+
NetworkPortalDetector::CaptivePortalState online_state;
online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE;
online_state.response_code = 204;
@@ -282,7 +291,7 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestTwoOfflineNetworks) {
portal_state.response_code = 200;
SetDetectionResults(kStubEthernetGuid, portal_state);
- // Update screen will show error message about portal state because
+ // Update screen will delay error message about portal state because
// ethernet is behind captive portal.
EXPECT_CALL(*mock_error_screen_,
MockSetUIState(NetworkError::UI_STATE_UPDATE)).Times(1);
@@ -294,6 +303,15 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestTwoOfflineNetworks) {
update_screen_->StartNetworkCheck();
+ // Force timer expiration.
+ {
+ base::Closure timed_callback =
+ update_screen_->GetErrorMessageTimerForTesting().user_task();
+ ASSERT_FALSE(timed_callback.is_null());
+ update_screen_->GetErrorMessageTimerForTesting().Reset();
+ timed_callback.Run();
+ }
+
// Change active network to the wifi behind proxy.
NetworkPortalDetector::CaptivePortalState proxy_state;
proxy_state.status =
@@ -349,7 +367,7 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestAPReselection) {
portal_state.response_code = 200;
SetDetectionResults(kStubEthernetGuid, portal_state);
- // Update screen will show error message about portal state because
+ // Update screen will delay error message about portal state because
// ethernet is behind captive portal.
EXPECT_CALL(*mock_error_screen_,
MockSetUIState(NetworkError::UI_STATE_UPDATE)).Times(1);
@@ -361,6 +379,15 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestAPReselection) {
update_screen_->StartNetworkCheck();
+ // Force timer expiration.
+ {
+ base::Closure timed_callback =
+ update_screen_->GetErrorMessageTimerForTesting().user_task();
+ ASSERT_FALSE(timed_callback.is_null());
+ update_screen_->GetErrorMessageTimerForTesting().Reset();
+ timed_callback.Run();
+ }
+
// User re-selects the same network manually. In this case, hide
// offline message and skip network check. Since ethernet is still
// behind portal, update engine fails to update.
« no previous file with comments | « chrome/browser/chromeos/login/screens/update_screen.cc ('k') | chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698