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

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

Issue 2421383003: Add operator==(const GURL&, const StringPiece&) to gurl.h (Closed)
Patch Set: Created 4 years, 2 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
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 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 // Set the canonical forms to the updated value for the following comparison. 1203 // Set the canonical forms to the updated value for the following comparison.
1204 form_google_.skip_zero_click = true; 1204 form_google_.skip_zero_click = true;
1205 form_facebook_.skip_zero_click = true; 1205 form_facebook_.skip_zero_click = true;
1206 PasswordStoreChangeList expected_changes; 1206 PasswordStoreChangeList expected_changes;
1207 expected_changes.push_back( 1207 expected_changes.push_back(
1208 PasswordStoreChange(PasswordStoreChange::UPDATE, form_facebook_)); 1208 PasswordStoreChange(PasswordStoreChange::UPDATE, form_facebook_));
1209 1209
1210 PasswordStoreChangeList changes; 1210 PasswordStoreChangeList changes;
1211 BrowserThread::PostTaskAndReplyWithResult( 1211 BrowserThread::PostTaskAndReplyWithResult(
1212 BrowserThread::DB, FROM_HERE, 1212 BrowserThread::DB, FROM_HERE,
1213 base::Bind(&NativeBackendGnome::DisableAutoSignInForOrigins, 1213 base::Bind(
1214 base::Unretained(&backend), 1214 &NativeBackendGnome::DisableAutoSignInForOrigins,
1215 base::Bind(&GURL::operator==, 1215 base::Unretained(&backend),
1216 base::Unretained(&form_facebook_.origin)), 1216 base::Bind(
1217 &changes), 1217 static_cast<bool (*)(const GURL&, const GURL&)>(operator==),
1218 form_facebook_.origin),
1219 &changes),
1218 base::Bind(&CheckPasswordChangesWithResult, &expected_changes, &changes)); 1220 base::Bind(&CheckPasswordChangesWithResult, &expected_changes, &changes));
1219 RunBothThreads(); 1221 RunBothThreads();
1220 1222
1221 EXPECT_EQ(2u, mock_keyring_items.size()); 1223 EXPECT_EQ(2u, mock_keyring_items.size());
1222 CheckStringAttribute( 1224 CheckStringAttribute(
1223 &mock_keyring_items[0], "origin_url", form_google_.origin.spec()); 1225 &mock_keyring_items[0], "origin_url", form_google_.origin.spec());
1224 CheckUint32Attribute(&mock_keyring_items[0], "should_skip_zero_click", 0); 1226 CheckUint32Attribute(&mock_keyring_items[0], "should_skip_zero_click", 0);
1225 CheckStringAttribute( 1227 CheckStringAttribute(
1226 &mock_keyring_items[1], "origin_url", form_facebook_.origin.spec()); 1228 &mock_keyring_items[1], "origin_url", form_facebook_.origin.spec());
1227 CheckUint32Attribute(&mock_keyring_items[1], "should_skip_zero_click", 1); 1229 CheckUint32Attribute(&mock_keyring_items[1], "should_skip_zero_click", 1);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 base::Bind(&CheckTrue)); 1301 base::Bind(&CheckTrue));
1300 1302
1301 RunBothThreads(); 1303 RunBothThreads();
1302 1304
1303 EXPECT_EQ(2u, form_list.size()); 1305 EXPECT_EQ(2u, form_list.size());
1304 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), 1306 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_),
1305 Pointee(form_facebook_))); 1307 Pointee(form_facebook_)));
1306 } 1308 }
1307 1309
1308 // TODO(mdm): add more basic tests here at some point. 1310 // TODO(mdm): add more basic tests here at some point.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698