summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-30 18:11:30 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-30 18:11:30 +0000
commitb7e144b3b26c78e3e74804c9c3a71fbf55ef5d51 (patch)
tree59d3638111dd3de97ac612cf4c83f6e4ea547e34
parent6b67a4ae48dd1c2019baaaa013a0f6172ee7215f (diff)
downloadchromium_src-b7e144b3b26c78e3e74804c9c3a71fbf55ef5d51.zip
chromium_src-b7e144b3b26c78e3e74804c9c3a71fbf55ef5d51.tar.gz
chromium_src-b7e144b3b26c78e3e74804c9c3a71fbf55ef5d51.tar.bz2
cros: Ignore ERR_ABORTED to break potential infinte loading loop.
ERR_ABORTED could be triggered from LoadAuthExtension() and ReloadGaiaScreen() if there is pending load on gaia frame and new load request would cause that pending load to be aborted. Infinite loading loop could be triggered when the test URL that triggers the test content script to auto submit the login form is loaded. The scenario is roughly like the following: 1. When the test URL is loaded with an error screen (frame error 11), the login form loaded okay and a POST request is created by content script. 2. The form loading okay clears the error and ReloadGaiaScreen() follows that. 3. When POST comes back from server, whola, ERR_ABORTED is generated because that request is aborted; 4. ERR_ABORTED brings up the error screen and a ReloadGaiaScreen() is called to retry the loading; And we go back to step 1 and this could go on and on. This CL breaks the loading loop by ignore ERR_ABORTED once per LoadAuthExtension/ReloadGaiaScreen call. BUG=242527 R=ygorshenin@chromium.org, zelidrag@chromium.org Review URL: https://codereview.chromium.org/15876012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203181 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/oobe_browsertest.cc5
-rw-r--r--chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc20
-rw-r--r--chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h6
3 files changed, 26 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/login/oobe_browsertest.cc b/chrome/browser/chromeos/login/oobe_browsertest.cc
index 3ecab68..1cd9a41 100644
--- a/chrome/browser/chromeos/login/oobe_browsertest.cc
+++ b/chrome/browser/chromeos/login/oobe_browsertest.cc
@@ -207,8 +207,7 @@ class OobeTest : public chromeos::CrosInProcessBrowserTest {
// needs UI thread.
};
-// Test is flaky - http://crbug.com/242587
-IN_PROC_BROWSER_TEST_F(OobeTest, DISABLED_NewUser) {
+IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) {
chromeos::WizardController::SkipPostLoginScreensForTesting();
chromeos::WizardController* wizard_controller =
chromeos::WizardController::default_controller();
@@ -222,4 +221,4 @@ IN_PROC_BROWSER_TEST_F(OobeTest, DISABLED_NewUser) {
runner->Run();
}
-}
+} // namespace
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index 2bcf094..f54ffa3 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -334,7 +334,8 @@ SigninScreenHandler::SigninScreenHandler(
is_first_update_state_call_(true),
offline_login_active_(false),
last_network_state_(NetworkStateInformer::UNKNOWN),
- has_pending_auth_ui_(false) {
+ has_pending_auth_ui_(false),
+ ignore_next_user_abort_frame_error_(false) {
DCHECK(network_state_informer_);
DCHECK(error_screen_actor_);
network_state_informer_->AddObserver(this);
@@ -433,7 +434,7 @@ void SigninScreenHandler::DeclareLocalizedValues(
IDS_LOGIN_PUBLIC_ACCOUNT_ENTER_ACCESSIBLE_NAME);
if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled())
- builder->Add("demoLoginMessage", IDS_KIOSK_MODE_LOGIN_MESSAGE);
+ builder->Add("demoLoginMessage", IDS_KIOSK_MODE_LOGIN_MESSAGE);
}
void SigninScreenHandler::Show(bool oobe_ui) {
@@ -722,6 +723,7 @@ void SigninScreenHandler::ReloadGaiaScreen() {
}
LOG(WARNING) << "Reload auth extension frame.";
frame_state_ = FRAME_STATE_LOADING;
+ ignore_next_user_abort_frame_error_ = true;
CallJS("login.GaiaSigninScreen.doReload");
}
@@ -1067,6 +1069,8 @@ void SigninScreenHandler::LoadAuthExtension(
test_pass_.clear();
}
}
+ frame_state_ = FRAME_STATE_LOADING;
+ ignore_next_user_abort_frame_error_ = true;
CallJS("login.GaiaSigninScreen.loadAuthExtension", params);
}
@@ -1475,9 +1479,21 @@ void SigninScreenHandler::HandleFrameLoadingCompleted(int status) {
LOG(INFO) << "Gaia frame is loaded";
frame_state_ = FRAME_STATE_LOADED;
} else {
+ // Ignore net::ERR_ABORTED frame error once.
+ if (ignore_next_user_abort_frame_error_ &&
+ frame_error_ == net::ERR_ABORTED) {
+ LOG(WARNING) << "Ignore gaia frame error: " << frame_error_;
+ ignore_next_user_abort_frame_error_ = false;
+ return;
+ }
+
LOG(WARNING) << "Gaia frame error: " << frame_error_;
frame_state_ = FRAME_STATE_ERROR;
}
+
+ // Frame load okay and other frame error clears the flag.
+ ignore_next_user_abort_frame_error_ = false;
+
if (network_state_informer_->state() != NetworkStateInformer::ONLINE)
return;
if (frame_state_ == FRAME_STATE_LOADED) {
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
index 143cbcd..a7f6328 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
@@ -451,6 +451,12 @@ class SigninScreenHandler
// NOTIFICATION_AUTH_CANCELLED.
bool has_pending_auth_ui_;
+ // Whether to ignore the next net::ERR_ABORTED frame error. ERR_ABORTED could
+ // be triggered when reloading gaia frame's src with a pending load.
+ // ReloadGaiaExtension() sets this flag to true to ignore potential
+ // ERR_ABORTED triggered from its reload request. See http://crbug.com/242527.
+ bool ignore_next_user_abort_frame_error_;
+
// Testing helper, specifies new value for gaia url.
GURL gaia_url_for_test_;