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

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

Issue 536783002: [Password Manager] Remove action match requirement for RemoveLogin() on Gnome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « chrome/browser/password_manager/native_backend_gnome_x.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdarg.h> 5 #include <stdarg.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 BrowserThread::PostTask( 905 BrowserThread::PostTask(
906 BrowserThread::DB, FROM_HERE, 906 BrowserThread::DB, FROM_HERE,
907 base::Bind(base::IgnoreResult(&NativeBackendGnome::RemoveLogin), 907 base::Bind(base::IgnoreResult(&NativeBackendGnome::RemoveLogin),
908 base::Unretained(&backend), form_google_)); 908 base::Unretained(&backend), form_google_));
909 909
910 RunBothThreads(); 910 RunBothThreads();
911 911
912 EXPECT_EQ(0u, mock_keyring_items.size()); 912 EXPECT_EQ(0u, mock_keyring_items.size());
913 } 913 }
914 914
915 // Verify fix for http://crbug.com/408783.
916 TEST_F(NativeBackendGnomeTest, RemoveLoginActionMismatch) {
917 NativeBackendGnome backend(42);
918 backend.Init();
919
920 BrowserThread::PostTask(
921 BrowserThread::DB, FROM_HERE,
922 base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin),
923 base::Unretained(&backend), form_google_));
924
925 RunBothThreads();
926
927 EXPECT_EQ(1u, mock_keyring_items.size());
928 if (mock_keyring_items.size() > 0)
929 CheckMockKeyringItem(&mock_keyring_items[0], form_google_, "chrome-42");
930
931 // Action url match not required for removal.
932 form_google_.action = GURL("https://some.other.url.com/path");
933
934 BrowserThread::PostTask(
935 BrowserThread::DB, FROM_HERE,
936 base::Bind(base::IgnoreResult(&NativeBackendGnome::RemoveLogin),
937 base::Unretained(&backend), form_google_));
938
939 RunBothThreads();
940
941 EXPECT_EQ(0u, mock_keyring_items.size());
942 }
943
915 TEST_F(NativeBackendGnomeTest, RemoveNonexistentLogin) { 944 TEST_F(NativeBackendGnomeTest, RemoveNonexistentLogin) {
916 NativeBackendGnome backend(42); 945 NativeBackendGnome backend(42);
917 backend.Init(); 946 backend.Init();
918 947
919 // First add an unrelated login. 948 // First add an unrelated login.
920 BrowserThread::PostTask( 949 BrowserThread::PostTask(
921 BrowserThread::DB, FROM_HERE, 950 BrowserThread::DB, FROM_HERE,
922 base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin), 951 base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin),
923 base::Unretained(&backend), form_google_)); 952 base::Unretained(&backend), form_google_));
924 953
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 1083
1055 TEST_F(NativeBackendGnomeTest, RemoveLoginsCreatedBetween) { 1084 TEST_F(NativeBackendGnomeTest, RemoveLoginsCreatedBetween) {
1056 CheckRemoveLoginsBetween(CREATED); 1085 CheckRemoveLoginsBetween(CREATED);
1057 } 1086 }
1058 1087
1059 TEST_F(NativeBackendGnomeTest, RemoveLoginsSyncedBetween) { 1088 TEST_F(NativeBackendGnomeTest, RemoveLoginsSyncedBetween) {
1060 CheckRemoveLoginsBetween(SYNCED); 1089 CheckRemoveLoginsBetween(SYNCED);
1061 } 1090 }
1062 1091
1063 // TODO(mdm): add more basic tests here at some point. 1092 // TODO(mdm): add more basic tests here at some point.
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/native_backend_gnome_x.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698