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

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

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 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/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return ChromePasswordManagerClient::FromWebContents(web_contents()); 112 return ChromePasswordManagerClient::FromWebContents(web_contents());
113 } 113 }
114 114
115 bool ChromePasswordManagerClientTest::WasLoggingActivationMessageSent( 115 bool ChromePasswordManagerClientTest::WasLoggingActivationMessageSent(
116 bool* activation_flag) { 116 bool* activation_flag) {
117 const uint32 kMsgID = AutofillMsg_SetLoggingState::ID; 117 const uint32 kMsgID = AutofillMsg_SetLoggingState::ID;
118 const IPC::Message* message = 118 const IPC::Message* message =
119 process()->sink().GetFirstMessageMatching(kMsgID); 119 process()->sink().GetFirstMessageMatching(kMsgID);
120 if (!message) 120 if (!message)
121 return false; 121 return false;
122 Tuple<bool> param; 122 base::Tuple<bool> param;
123 AutofillMsg_SetLoggingState::Read(message, &param); 123 AutofillMsg_SetLoggingState::Read(message, &param);
124 *activation_flag = get<0>(param); 124 *activation_flag = base::get<0>(param);
125 process()->sink().ClearMessages(); 125 process()->sink().ClearMessages();
126 return true; 126 return true;
127 } 127 }
128 128
129 TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNoReceiver) { 129 TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNoReceiver) {
130 ChromePasswordManagerClient* client = GetClient(); 130 ChromePasswordManagerClient* client = GetClient();
131 131
132 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(0); 132 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(0);
133 // Before attaching the receiver, no text should be passed. 133 // Before attaching the receiver, no text should be passed.
134 client->LogSavePasswordProgress(kTestText); 134 client->LogSavePasswordProgress(kTestText);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 profile()->ForceIncognito(true); 460 profile()->ForceIncognito(true);
461 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); 461 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage());
462 462
463 // Functionality disabled in Incognito mode also when manager itself is 463 // Functionality disabled in Incognito mode also when manager itself is
464 // enabled. 464 // enabled.
465 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled, 465 prefs()->SetUserPref(password_manager::prefs::kPasswordManagerSavingEnabled,
466 new base::FundamentalValue(true)); 466 new base::FundamentalValue(true));
467 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage()); 467 EXPECT_FALSE(client->IsSavingEnabledForCurrentPage());
468 profile()->ForceIncognito(false); 468 profile()->ForceIncognito(false);
469 } 469 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698