Commit 0cbb1d8a authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

cros: Add back button for the SAML interstitial

Fixed: 1051867
Change-Id: Idae22190f05a870645aa55f62d0c77dc9f366595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2073719
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744713}
parent 7240eebd
...@@ -1274,6 +1274,7 @@ class SAMLPolicyTest : public SamlTest { ...@@ -1274,6 +1274,7 @@ class SAMLPolicyTest : public SamlTest {
void ShowGAIALoginForm(); void ShowGAIALoginForm();
void ShowSAMLInterstitial(); void ShowSAMLInterstitial();
void ClickBackOnSAMLInterstitialPage();
void ClickNextOnSAMLInterstitialPage(); void ClickNextOnSAMLInterstitialPage();
void LogInWithSAML(const std::string& user_id, void LogInWithSAML(const std::string& user_id,
const std::string& auth_sid_cookie, const std::string& auth_sid_cookie,
...@@ -1470,6 +1471,10 @@ void SAMLPolicyTest::ShowSAMLInterstitial() { ...@@ -1470,6 +1471,10 @@ void SAMLPolicyTest::ShowSAMLInterstitial() {
->Wait(); ->Wait();
} }
void SAMLPolicyTest::ClickBackOnSAMLInterstitialPage() {
test::OobeJS().TapOnPath({"gaia-signin", "interstitial-back"});
}
void SAMLPolicyTest::ClickNextOnSAMLInterstitialPage() { void SAMLPolicyTest::ClickNextOnSAMLInterstitialPage() {
content::DOMMessageQueue message_queue; content::DOMMessageQueue message_queue;
SetupAuthFlowChangeListener(); SetupAuthFlowChangeListener();
...@@ -1707,6 +1712,12 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLInterstitialNext) { ...@@ -1707,6 +1712,12 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLInterstitialNext) {
SetLoginBehaviorPolicyToSAMLInterstitial(); SetLoginBehaviorPolicyToSAMLInterstitial();
WaitForSigninScreen(); WaitForSigninScreen();
ShowSAMLInterstitial();
ClickBackOnSAMLInterstitialPage();
// Back button should hide OOBE dialog.
EXPECT_FALSE(ash::LoginScreenTestApi::IsOobeDialogVisible());
EXPECT_TRUE(ash::LoginScreenTestApi::IsAddUserButtonShown());
ShowSAMLInterstitial(); ShowSAMLInterstitial();
ClickNextOnSAMLInterstitialPage(); ClickNextOnSAMLInterstitialPage();
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
slot="bottom-buttons" class="relative flex layout horizontal"> slot="bottom-buttons" class="relative flex layout horizontal">
<div id="buttons-container" class="flex layout horizontal center"> <div id="buttons-container" class="flex layout horizontal center">
<oobe-back-button id="signin-back-button" <oobe-back-button id="signin-back-button"
disabled="[[!navigationEnabled_]]"></oobe-back-button> disabled="[[!navigationEnabled_]]"
on-click="onBackButtonClicked_">
</oobe-back-button>
<div class="flex"> <div class="flex">
</div> </div>
<oobe-text-button id="secondary-action-button" <oobe-text-button id="secondary-action-button"
...@@ -91,7 +93,11 @@ ...@@ -91,7 +93,11 @@
</a> </a>
</p> </p>
</div> </div>
<div slot="bottom-buttons" class="flex layout horizontal end-justified"> <div slot="bottom-buttons" class="flex layout horizontal">
<oobe-back-button id="interstitial-back" on-tap="onBackButtonClicked_">
</oobe-back-button>
<div class="flex">
</div>
<oobe-next-button on-tap="onSamlInterstitialNext_" <oobe-next-button on-tap="onSamlInterstitialNext_"
id="interstitial-next" class="focus-on-show"></oobe-next-button> id="interstitial-next" class="focus-on-show"></oobe-next-button>
</div> </div>
......
...@@ -415,8 +415,6 @@ Polymer({ ...@@ -415,8 +415,6 @@ Polymer({
eventName, authenticatorEventListeners[eventName].bind(this)); eventName, authenticatorEventListeners[eventName].bind(this));
} }
this.$['signin-back-button'].addEventListener(
'click', this.onBackButtonClicked_.bind(this));
this.$['offline-gaia'].addEventListener( this.$['offline-gaia'].addEventListener(
'offline-gaia-cancel', this.cancel.bind(this)); 'offline-gaia-cancel', this.cancel.bind(this));
...@@ -1327,8 +1325,7 @@ Polymer({ ...@@ -1327,8 +1325,7 @@ Polymer({
// TODO(crbug.com/470893): Figure out whether/which of these exit conditions // TODO(crbug.com/470893): Figure out whether/which of these exit conditions
// are useful. // are useful.
if (this.screenMode_ == AuthMode.SAML_INTERSTITIAL || if (this.isWhitelistErrorShown_ || this.authCompleted_) {
this.isWhitelistErrorShown_ || this.authCompleted_) {
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment