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

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

Issue 765073004: Adding skeleton code for showing Bubble, asking user to submit URL when Password Manager fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/sync/profile_sync_service_factory.h" 10 #include "chrome/browser/sync/profile_sync_service_factory.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 service_->UnregisterReceiver(&receiver_); 222 service_->UnregisterReceiver(&receiver_);
223 EXPECT_FALSE(client->IsLoggingActive()); 223 EXPECT_FALSE(client->IsLoggingActive());
224 } 224 }
225 225
226 TEST_F(ChromePasswordManagerClientTest, 226 TEST_F(ChromePasswordManagerClientTest,
227 ShouldAskUserToSubmitURLDefaultBehaviour) { 227 ShouldAskUserToSubmitURLDefaultBehaviour) {
228 ChromePasswordManagerClient* client = GetClient(); 228 ChromePasswordManagerClient* client = GetClient();
229 // TODO(melandory) Since "Ask user to submit URL" functionality is currently 229 // TODO(melandory) Since "Ask user to submit URL" functionality is currently
230 // in development, so the user should not be asked to submit a URL. 230 // in development, so the user should not be asked to submit a URL.
231 EXPECT_FALSE(client->ShouldAskUserToSubmitURL()); 231 EXPECT_FALSE(client->ShouldAskUserToSubmitURL(GURL("https://hostname.com/")));
232 }
233
234 TEST_F(ChromePasswordManagerClientTest, ShouldAskUserToSubmitURLEmptyURL) {
235 ChromePasswordManagerClient* client = GetClient();
236 // TODO(melandory) Since "Ask user to submit URL" functionality is currently
vabr (Chromium) 2014/12/04 13:25:32 The TODO comment here seems like a copy&paste mist
melandory 2014/12/05 12:56:52 Done.
237 // in development, so the user should not be asked to submit a URL.
238 EXPECT_FALSE(client->ShouldAskUserToSubmitURL(GURL::EmptyGURL()));
232 } 239 }
233 240
234 TEST_F(ChromePasswordManagerClientTest, ShouldFilterAutofillResult_Reauth) { 241 TEST_F(ChromePasswordManagerClientTest, ShouldFilterAutofillResult_Reauth) {
235 // Make client disallow only reauth requests. 242 // Make client disallow only reauth requests.
236 CommandLine* command_line = CommandLine::ForCurrentProcess(); 243 CommandLine* command_line = CommandLine::ForCurrentProcess();
237 command_line->AppendSwitch( 244 command_line->AppendSwitch(
238 password_manager::switches::kDisallowAutofillSyncCredentialForReauth); 245 password_manager::switches::kDisallowAutofillSyncCredentialForReauth);
239 scoped_ptr<TestChromePasswordManagerClient> client( 246 scoped_ptr<TestChromePasswordManagerClient> client(
240 new TestChromePasswordManagerClient(web_contents())); 247 new TestChromePasswordManagerClient(web_contents()));
241 autofill::PasswordForm form; 248 autofill::PasswordForm form;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 396
390 // Again, without a custom passphrase. 397 // Again, without a custom passphrase.
391 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase()) 398 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase())
392 .WillRepeatedly(Return(false)); 399 .WillRepeatedly(Return(false));
393 400
394 EXPECT_FALSE( 401 EXPECT_FALSE(
395 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE)); 402 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE));
396 EXPECT_FALSE(client->IsPasswordSyncEnabled( 403 EXPECT_FALSE(client->IsPasswordSyncEnabled(
397 password_manager::WITHOUT_CUSTOM_PASSPHRASE)); 404 password_manager::WITHOUT_CUSTOM_PASSPHRASE));
398 } 405 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698