Commit cce52da2 authored by gcasto's avatar gcasto Committed by Commit bot

[Password Manager] Remove action match requirement for RemoveLogin() on Gnome

This requirement only exists on this implementation of PasswordStore.

BUG=408783

Review URL: https://codereview.chromium.org/536783002

Cr-Commit-Position: refs/heads/master@{#293179}
parent ce824a56
......@@ -404,7 +404,6 @@ void GKRMethod::RemoveLogin(const PasswordForm& form, const char* app_string) {
this, // data
NULL, // destroy_data
"origin_url", form.origin.spec().c_str(),
"action_url", form.action.spec().c_str(),
"username_element", UTF16ToUTF8(form.username_element).c_str(),
"username_value", UTF16ToUTF8(form.username_value).c_str(),
"password_element", UTF16ToUTF8(form.password_element).c_str(),
......
......@@ -912,6 +912,35 @@ TEST_F(NativeBackendGnomeTest, BasicRemoveLogin) {
EXPECT_EQ(0u, mock_keyring_items.size());
}
// Verify fix for http://crbug.com/408783.
TEST_F(NativeBackendGnomeTest, RemoveLoginActionMismatch) {
NativeBackendGnome backend(42);
backend.Init();
BrowserThread::PostTask(
BrowserThread::DB, FROM_HERE,
base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin),
base::Unretained(&backend), form_google_));
RunBothThreads();
EXPECT_EQ(1u, mock_keyring_items.size());
if (mock_keyring_items.size() > 0)
CheckMockKeyringItem(&mock_keyring_items[0], form_google_, "chrome-42");
// Action url match not required for removal.
form_google_.action = GURL("https://some.other.url.com/path");
BrowserThread::PostTask(
BrowserThread::DB, FROM_HERE,
base::Bind(base::IgnoreResult(&NativeBackendGnome::RemoveLogin),
base::Unretained(&backend), form_google_));
RunBothThreads();
EXPECT_EQ(0u, mock_keyring_items.size());
}
TEST_F(NativeBackendGnomeTest, RemoveNonexistentLogin) {
NativeBackendGnome backend(42);
backend.Init();
......
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