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

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

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return ChromePasswordManagerClient::FromWebContents(web_contents()); 98 return ChromePasswordManagerClient::FromWebContents(web_contents());
99 } 99 }
100 100
101 bool ChromePasswordManagerClientTest::WasLoggingActivationMessageSent( 101 bool ChromePasswordManagerClientTest::WasLoggingActivationMessageSent(
102 bool* activation_flag) { 102 bool* activation_flag) {
103 const uint32 kMsgID = AutofillMsg_SetLoggingState::ID; 103 const uint32 kMsgID = AutofillMsg_SetLoggingState::ID;
104 const IPC::Message* message = 104 const IPC::Message* message =
105 process()->sink().GetFirstMessageMatching(kMsgID); 105 process()->sink().GetFirstMessageMatching(kMsgID);
106 if (!message) 106 if (!message)
107 return false; 107 return false;
108 Tuple1<bool> param; 108 Tuple<bool> param;
109 AutofillMsg_SetLoggingState::Read(message, &param); 109 AutofillMsg_SetLoggingState::Read(message, &param);
110 *activation_flag = param.a; 110 *activation_flag = get<0>(param);
111 process()->sink().ClearMessages(); 111 process()->sink().ClearMessages();
112 return true; 112 return true;
113 } 113 }
114 114
115 TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNoReceiver) { 115 TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNoReceiver) {
116 ChromePasswordManagerClient* client = GetClient(); 116 ChromePasswordManagerClient* client = GetClient();
117 117
118 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(0); 118 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(0);
119 // Before attaching the receiver, no text should be passed. 119 // Before attaching the receiver, no text should be passed.
120 client->LogSavePasswordProgress(kTestText); 120 client->LogSavePasswordProgress(kTestText);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 // Again, without a custom passphrase. 395 // Again, without a custom passphrase.
396 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase()) 396 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase())
397 .WillRepeatedly(Return(false)); 397 .WillRepeatedly(Return(false));
398 398
399 EXPECT_FALSE( 399 EXPECT_FALSE(
400 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE)); 400 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE));
401 EXPECT_FALSE(client->IsPasswordSyncEnabled( 401 EXPECT_FALSE(client->IsPasswordSyncEnabled(
402 password_manager::WITHOUT_CUSTOM_PASSPHRASE)); 402 password_manager::WITHOUT_CUSTOM_PASSPHRASE));
403 } 403 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.cc ('k') | chrome/browser/safe_browsing/client_side_detection_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698