| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 10 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 class MockAutofillExternalDelegate : public AutofillExternalDelegate { | 41 class MockAutofillExternalDelegate : public AutofillExternalDelegate { |
| 42 public: | 42 public: |
| 43 MockAutofillExternalDelegate(AutofillManager* autofill_manager, | 43 MockAutofillExternalDelegate(AutofillManager* autofill_manager, |
| 44 AutofillDriver* autofill_driver) | 44 AutofillDriver* autofill_driver) |
| 45 : AutofillExternalDelegate(autofill_manager, autofill_driver) {} | 45 : AutofillExternalDelegate(autofill_manager, autofill_driver) {} |
| 46 ~MockAutofillExternalDelegate() override {} | 46 ~MockAutofillExternalDelegate() override {} |
| 47 | 47 |
| 48 void DidSelectSuggestion(const base::string16& value, | 48 void DidSelectSuggestion(const base::string16& value, |
| 49 int identifier) override {} | 49 int identifier, |
| 50 size_t match_start) override {} |
| 50 bool RemoveSuggestion(const base::string16& value, int identifier) override { | 51 bool RemoveSuggestion(const base::string16& value, int identifier) override { |
| 51 return true; | 52 return true; |
| 52 } | 53 } |
| 53 void ClearPreviewedForm() override {} | 54 void ClearPreviewedForm() override {} |
| 54 base::WeakPtr<AutofillExternalDelegate> GetWeakPtr() { | 55 base::WeakPtr<AutofillExternalDelegate> GetWeakPtr() { |
| 55 return AutofillExternalDelegate::GetWeakPtr(); | 56 return AutofillExternalDelegate::GetWeakPtr(); |
| 56 } | 57 } |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 class MockAutofillClient : public autofill::TestAutofillClient { | 60 class MockAutofillClient : public autofill::TestAutofillClient { |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 529 |
| 529 // The second element was shorter so it should be unchanged. | 530 // The second element was shorter so it should be unchanged. |
| 530 EXPECT_EQ(autofill_popup_controller_->GetSuggestionAt(1).value, | 531 EXPECT_EQ(autofill_popup_controller_->GetSuggestionAt(1).value, |
| 531 autofill_popup_controller_->GetElidedValueAt(1)); | 532 autofill_popup_controller_->GetElidedValueAt(1)); |
| 532 EXPECT_EQ(autofill_popup_controller_->GetSuggestionAt(1).label, | 533 EXPECT_EQ(autofill_popup_controller_->GetSuggestionAt(1).label, |
| 533 autofill_popup_controller_->GetElidedLabelAt(1)); | 534 autofill_popup_controller_->GetElidedLabelAt(1)); |
| 534 } | 535 } |
| 535 #endif | 536 #endif |
| 536 | 537 |
| 537 } // namespace autofill | 538 } // namespace autofill |
| OLD | NEW |