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

Side by Side Diff: chrome/browser/password_manager/credential_manager_browsertest.cc

Issue 2157343002: Disable flaky CredentialManagerBrowserTest.SaveViaAPIAndAutofill and UpdateViaAPIAndAutofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/macros.h" 5 #include "base/macros.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/password_manager/password_manager_test_base.h" 7 #include "chrome/browser/password_manager/password_manager_test_base.h"
8 #include "chrome/browser/password_manager/password_store_factory.h" 8 #include "chrome/browser/password_manager/password_store_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 NavigationObserver observer(WebContents()); 123 NavigationObserver observer(WebContents());
124 observer.SetPathToWaitFor("/password/done.html"); 124 observer.SetPathToWaitFor("/password/done.html");
125 observer.Wait(); 125 observer.Wait();
126 126
127 std::unique_ptr<BubbleObserver> prompt_observer( 127 std::unique_ptr<BubbleObserver> prompt_observer(
128 new BubbleObserver(WebContents())); 128 new BubbleObserver(WebContents()));
129 // The autofill password manager shouldn't react to the successful login. 129 // The autofill password manager shouldn't react to the successful login.
130 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt()); 130 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
131 } 131 }
132 132
133 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, SaveViaAPIAndAutofill) { 133 // Disabled due to flakes; see https://crbug.com/629459.
134 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
135 DISABLED_SaveViaAPIAndAutofill) {
134 NavigateToFile("/password/password_form.html"); 136 NavigateToFile("/password/password_form.html");
135 std::string fill_password = 137 std::string fill_password =
136 "document.getElementById('username_field').value = 'user';" 138 "document.getElementById('username_field').value = 'user';"
137 "document.getElementById('password_field').value = '12345';"; 139 "document.getElementById('password_field').value = '12345';";
138 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_password)); 140 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_password));
139 141
140 // Call the API to save the form. 142 // Call the API to save the form.
141 ASSERT_TRUE(content::ExecuteScript( 143 ASSERT_TRUE(content::ExecuteScript(
142 RenderViewHost(), 144 RenderViewHost(),
143 "var c = new PasswordCredential({ id: 'user', password: '12345' });" 145 "var c = new PasswordCredential({ id: 'user', password: '12345' });"
144 "navigator.credentials.store(c);")); 146 "navigator.credentials.store(c);"));
145 std::unique_ptr<BubbleObserver> prompt_observer( 147 std::unique_ptr<BubbleObserver> prompt_observer(
146 new BubbleObserver(WebContents())); 148 new BubbleObserver(WebContents()));
147 EXPECT_TRUE(prompt_observer->IsShowingSavePrompt()); 149 EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
148 prompt_observer->Dismiss(); 150 prompt_observer->Dismiss();
149 151
150 NavigationObserver form_submit_observer(WebContents()); 152 NavigationObserver form_submit_observer(WebContents());
151 ASSERT_TRUE(content::ExecuteScript( 153 ASSERT_TRUE(content::ExecuteScript(
152 RenderViewHost(), 154 RenderViewHost(),
153 "document.getElementById('input_submit_button').click();")); 155 "document.getElementById('input_submit_button').click();"));
154 form_submit_observer.Wait(); 156 form_submit_observer.Wait();
155 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt()); 157 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
156 } 158 }
157 159
158 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, UpdateViaAPIAndAutofill) { 160 // Disabled due to flakes; see https://crbug.com/629459.
161 IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
162 DISABLED_UpdateViaAPIAndAutofill) {
159 // Save credentials with 'skip_zero_click' false. 163 // Save credentials with 'skip_zero_click' false.
160 scoped_refptr<password_manager::TestPasswordStore> password_store = 164 scoped_refptr<password_manager::TestPasswordStore> password_store =
161 static_cast<password_manager::TestPasswordStore*>( 165 static_cast<password_manager::TestPasswordStore*>(
162 PasswordStoreFactory::GetForProfile( 166 PasswordStoreFactory::GetForProfile(
163 browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) 167 browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS)
164 .get()); 168 .get());
165 autofill::PasswordForm signin_form; 169 autofill::PasswordForm signin_form;
166 signin_form.signon_realm = embedded_test_server()->base_url().spec(); 170 signin_form.signon_realm = embedded_test_server()->base_url().spec();
167 signin_form.password_value = base::ASCIIToUTF16("12345"); 171 signin_form.password_value = base::ASCIIToUTF16("12345");
168 signin_form.username_value = base::ASCIIToUTF16("user"); 172 signin_form.username_value = base::ASCIIToUTF16("user");
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 "document.getElementById('input_submit_button').click();")); 205 "document.getElementById('input_submit_button').click();"));
202 form_submit_observer.Wait(); 206 form_submit_observer.Wait();
203 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt()); 207 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
204 EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt()); 208 EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
205 stored = password_store->stored_passwords(); 209 stored = password_store->stored_passwords();
206 ASSERT_EQ(1u, stored.size()); 210 ASSERT_EQ(1u, stored.size());
207 EXPECT_EQ(signin_form, stored[signin_form.signon_realm][0]); 211 EXPECT_EQ(signin_form, stored[signin_form.signon_realm][0]);
208 } 212 }
209 213
210 } // namespace 214 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698