| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/autocomplete_history_manager.h" | 10 #include "chrome/browser/autocomplete_history_manager.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { | 141 class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { |
| 142 public: | 142 public: |
| 143 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper) | 143 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper) |
| 144 : TestAutofillExternalDelegate(wrapper, NULL) {} | 144 : TestAutofillExternalDelegate(wrapper, NULL) {} |
| 145 virtual ~MockAutofillExternalDelegate() {} | 145 virtual ~MockAutofillExternalDelegate() {} |
| 146 | 146 |
| 147 virtual void ApplyAutofillSuggestions( | 147 virtual void ApplyAutofillSuggestions( |
| 148 const std::vector<string16>& autofill_values, | 148 const std::vector<string16>& autofill_values, |
| 149 const std::vector<string16>& autofill_labels, | 149 const std::vector<string16>& autofill_labels, |
| 150 const std::vector<string16>& autofill_icons, | 150 const std::vector<string16>& autofill_icons, |
| 151 const std::vector<int>& autofill_unique_ids, | 151 const std::vector<int>& autofill_unique_ids) OVERRIDE {}; |
| 152 int separator_index) OVERRIDE {}; | |
| 153 | 152 |
| 154 MOCK_METHOD5(OnSuggestionsReturned, | 153 MOCK_METHOD5(OnSuggestionsReturned, |
| 155 void(int query_id, | 154 void(int query_id, |
| 156 const std::vector<string16>& autofill_values, | 155 const std::vector<string16>& autofill_values, |
| 157 const std::vector<string16>& autofill_labels, | 156 const std::vector<string16>& autofill_labels, |
| 158 const std::vector<string16>& autofill_icons, | 157 const std::vector<string16>& autofill_icons, |
| 159 const std::vector<int>& autofill_unique_ids)); | 158 const std::vector<int>& autofill_unique_ids)); |
| 160 | 159 |
| 161 private: | 160 private: |
| 162 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); | 161 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 183 &profile_, web_data_service_); | 182 &profile_, web_data_service_); |
| 184 | 183 |
| 185 MockAutofillExternalDelegate external_delegate( | 184 MockAutofillExternalDelegate external_delegate( |
| 186 TabContentsWrapper::GetCurrentWrapperForContents(contents())); | 185 TabContentsWrapper::GetCurrentWrapperForContents(contents())); |
| 187 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 186 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
| 188 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 187 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
| 189 | 188 |
| 190 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 189 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
| 191 autocomplete_history_manager.SendSuggestions(NULL); | 190 autocomplete_history_manager.SendSuggestions(NULL); |
| 192 } | 191 } |
| OLD | NEW |