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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc

Issue 1208133002: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added |match_start| usage. 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 (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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698