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

Side by Side Diff: components/password_manager/core/browser/browser_save_password_progress_logger_unittest.cc

Issue 232663002: Password manager internals page: clean-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/password_manager/core/browser/browser_save_password_progres s_logger.h" 5 #include "components/password_manager/core/browser/browser_save_password_progres s_logger.h"
6 6
7 #include "components/password_manager/core/browser/stub_password_manager_client. h" 7 #include "components/password_manager/core/browser/stub_password_manager_client. h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace password_manager { 11 namespace password_manager {
12 12
13 namespace { 13 namespace {
14 14
15 const char kTestText[] = "test"; 15 const char kTestText[] = "test";
16 16
17 // The only purpose of TestLogger is to expose SendLog for the test. 17 // The only purpose of TestLogger is to expose SendLog for the test.
18 class TestLogger : public BrowserSavePasswordProgressLogger { 18 class TestLogger : public BrowserSavePasswordProgressLogger {
19 public: 19 public:
20 TestLogger(PasswordManagerClient* client) 20 explicit TestLogger(PasswordManagerClient* client)
21 : BrowserSavePasswordProgressLogger(client) {} 21 : BrowserSavePasswordProgressLogger(client) {}
22 22
23 using BrowserSavePasswordProgressLogger::SendLog; 23 using BrowserSavePasswordProgressLogger::SendLog;
24 }; 24 };
25 25
26 class MockPasswordManagerClient : public StubPasswordManagerClient { 26 class MockPasswordManagerClient : public StubPasswordManagerClient {
27 public: 27 public:
28 MOCK_METHOD1(LogSavePasswordProgress, void(const std::string& text)); 28 MOCK_METHOD1(LogSavePasswordProgress, void(const std::string& text));
29 }; 29 };
30 30
31 } // namespace 31 } // namespace
32 32
33 TEST(BrowserSavePasswordProgressLoggerTest, SendLog) { 33 TEST(BrowserSavePasswordProgressLoggerTest, SendLog) {
34 MockPasswordManagerClient client; 34 MockPasswordManagerClient client;
35 TestLogger logger(&client); 35 TestLogger logger(&client);
36 EXPECT_CALL(client, LogSavePasswordProgress(kTestText)).Times(1); 36 EXPECT_CALL(client, LogSavePasswordProgress(kTestText)).Times(1);
37 logger.SendLog(kTestText); 37 logger.SendLog(kTestText);
38 } 38 }
39 39
40 } // namespace password_manager 40 } // namespace password_manager
OLDNEW
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698