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

Unified Diff: chrome/browser/chromeos/login/saml/saml_browsertest.cc

Issue 1079083002: [cros New-GAIA] Webview login and new GAIA endpoint enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix saml test Created 5 years, 8 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/saml/saml_browsertest.cc
diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc
index 0a11e4cfa14d0cd6bcfdb03858e8a6ef6bea22f5..ce4d3c0ffdf0209c493636e7fcb804fa01232e08 100644
--- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc
+++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc
@@ -170,7 +170,7 @@ void FakeSamlIdp::SetUp(const std::string& base_path, const GURL& gaia_url) {
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir));
html_template_dir_ = test_data_dir.Append("login");
- login_path_= base_path;
+ login_path_ = base_path;
login_auth_path_ = base_path + "Auth";
gaia_assertion_url_ = gaia_url.Resolve("/SSO");
}
@@ -259,9 +259,14 @@ scoped_ptr<HttpResponse> FakeSamlIdp::BuildHTMLResponse(
} // namespace
+// Boolean parameter is used to run this test for webview (true) and for
+// iframe (false) GAIA sign in.
class SamlTest : public OobeBaseTest, public testing::WithParamInterface<bool> {
public:
- SamlTest() : saml_load_injected_(false) { use_webview_ = GetParam(); }
+ SamlTest() : saml_load_injected_(false) {
+ set_use_webview(GetParam());
+ set_initialize_fake_merge_session(false);
+ }
~SamlTest() override {}
void SetUpCommandLine(base::CommandLine* command_line) override {
@@ -365,13 +370,13 @@ IN_PROC_BROWSER_TEST_P(SamlTest, SamlUI) {
// Saml flow UI expectations.
JsExpect("$('gaia-signin').classList.contains('full-width')");
- if (!use_webview_) {
+ if (!use_webview()) {
JsExpect("!$('cancel-add-user-button').hidden");
}
// Click on 'cancel'.
content::DOMMessageQueue message_queue; // Observe before 'cancel'.
- if (use_webview_) {
+ if (use_webview()) {
ASSERT_TRUE(content::ExecuteScript(
GetLoginUI()->GetWebContents(),
"$('close-button-item').click();"));
@@ -397,7 +402,7 @@ IN_PROC_BROWSER_TEST_P(SamlTest, CredentialPassingAPI) {
// webview.executeScript and there is no way to control the injection time.
// As a result, this test is flaky and fails about 20% of the time.
// TODO(xiyuan): Re-enable when webview.addContentScript API is ready.
- if (use_webview_)
+ if (use_webview())
return;
fake_saml_idp()->SetLoginHTMLTemplate("saml_api_login.html");

Powered by Google App Engine
This is Rietveld 408576698