OLD | NEW |
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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 class TestPasswordManagerDriver : public PasswordManagerDriver { | 30 class TestPasswordManagerDriver : public PasswordManagerDriver { |
31 public: | 31 public: |
32 TestPasswordManagerDriver() {} | 32 TestPasswordManagerDriver() {} |
33 | 33 |
34 virtual void FillPasswordForm( | 34 virtual void FillPasswordForm( |
35 const autofill::PasswordFormFillData& form_data) OVERRIDE {} | 35 const autofill::PasswordFormFillData& form_data) OVERRIDE {} |
36 virtual bool DidLastPageLoadEncounterSSLErrors() OVERRIDE { return false; } | 36 virtual bool DidLastPageLoadEncounterSSLErrors() OVERRIDE { return false; } |
| 37 virtual PasswordGenerationManager* GetPasswordGenerationManager() OVERRIDE { |
| 38 return NULL; |
| 39 } |
| 40 virtual PasswordManager* GetPasswordManager() OVERRIDE { return NULL; } |
37 }; | 41 }; |
38 | 42 |
39 class TestPasswordManagerDelegate : public PasswordManagerDelegate { | 43 class TestPasswordManagerDelegate : public PasswordManagerDelegate { |
40 public: | 44 public: |
41 explicit TestPasswordManagerDelegate(Profile* profile) : profile_(profile) {} | 45 explicit TestPasswordManagerDelegate(Profile* profile) : profile_(profile) {} |
42 | 46 |
43 virtual void AddSavePasswordInfoBarIfPermitted( | 47 virtual void AddSavePasswordInfoBarIfPermitted( |
44 PasswordFormManager* form_to_save) OVERRIDE {} | 48 PasswordFormManager* form_to_save) OVERRIDE {} |
45 virtual Profile* GetProfile() OVERRIDE { return profile_; } | 49 virtual Profile* GetProfile() OVERRIDE { return profile_; } |
46 virtual PasswordManagerDriver* GetDriver() OVERRIDE { return &driver_; } | 50 virtual PasswordManagerDriver* GetDriver() OVERRIDE { return &driver_; } |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 599 |
596 SanitizePossibleUsernames(manager.get(), &credentials); | 600 SanitizePossibleUsernames(manager.get(), &credentials); |
597 | 601 |
598 // SSN, duplicate in |other_possible_usernames| and duplicate of | 602 // SSN, duplicate in |other_possible_usernames| and duplicate of |
599 // |username_value| all removed. | 603 // |username_value| all removed. |
600 expected.clear(); | 604 expected.clear(); |
601 expected.push_back(ASCIIToUTF16("duplicate")); | 605 expected.push_back(ASCIIToUTF16("duplicate")); |
602 expected.push_back(ASCIIToUTF16("random")); | 606 expected.push_back(ASCIIToUTF16("random")); |
603 EXPECT_THAT(credentials.other_possible_usernames, Eq(expected)); | 607 EXPECT_THAT(credentials.other_possible_usernames, Eq(expected)); |
604 } | 608 } |
OLD | NEW |