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 {
void ShowGAIALoginForm();
void ShowSAMLInterstitial();
void ClickBackOnSAMLInterstitialPage();
void ClickNextOnSAMLInterstitialPage();
void LogInWithSAML(const std::string& user_id,
const std::string& auth_sid_cookie,
......@@ -1470,6 +1471,10 @@ void SAMLPolicyTest::ShowSAMLInterstitial() {
->Wait();
}
void SAMLPolicyTest::ClickBackOnSAMLInterstitialPage() {
test::OobeJS().TapOnPath({"gaia-signin", "interstitial-back"});
}
void SAMLPolicyTest::ClickNextOnSAMLInterstitialPage() {
content::DOMMessageQueue message_queue;
SetupAuthFlowChangeListener();
......@@ -1707,6 +1712,12 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLInterstitialNext) {
SetLoginBehaviorPolicyToSAMLInterstitial();
WaitForSigninScreen();
ShowSAMLInterstitial();
ClickBackOnSAMLInterstitialPage();
// Back button should hide OOBE dialog.
EXPECT_FALSE(ash::LoginScreenTestApi::IsOobeDialogVisible());
EXPECT_TRUE(ash::LoginScreenTestApi::IsAddUserButtonShown());
ShowSAMLInterstitial();
ClickNextOnSAMLInterstitialPage();
......
......@@ -39,7 +39,9 @@
slot="bottom-buttons" class="relative flex layout horizontal">
<div id="buttons-container" class="flex layout horizontal center">
<oobe-back-button id="signin-back-button"
disabled="[[!navigationEnabled_]]"></oobe-back-button>
disabled="[[!navigationEnabled_]]"
on-click="onBackButtonClicked_">
</oobe-back-button>
<div class="flex">
</div>
<oobe-text-button id="secondary-action-button"
......@@ -91,7 +93,11 @@
</a>
</p>
</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_"
id="interstitial-next" class="focus-on-show"></oobe-next-button>
</div>
......
......@@ -415,8 +415,6 @@ Polymer({
eventName, authenticatorEventListeners[eventName].bind(this));
}
this.$['signin-back-button'].addEventListener(
'click', this.onBackButtonClicked_.bind(this));
this.$['offline-gaia'].addEventListener(
'offline-gaia-cancel', this.cancel.bind(this));
......@@ -1327,8 +1325,7 @@ Polymer({
// TODO(crbug.com/470893): Figure out whether/which of these exit conditions
// are useful.
if (this.screenMode_ == AuthMode.SAML_INTERSTITIAL ||
this.isWhitelistErrorShown_ || this.authCompleted_) {
if (this.isWhitelistErrorShown_ || this.authCompleted_) {
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