| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { | 144 class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { |
| 145 public: | 145 public: |
| 146 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper) | 146 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper) |
| 147 : TestAutofillExternalDelegate(wrapper, NULL) {} | 147 : TestAutofillExternalDelegate(wrapper, NULL) {} |
| 148 virtual ~MockAutofillExternalDelegate() {} | 148 virtual ~MockAutofillExternalDelegate() {} |
| 149 | 149 |
| 150 virtual void ApplyAutofillSuggestions( | 150 virtual void ApplyAutofillSuggestions( |
| 151 const std::vector<string16>& autofill_values, | 151 const std::vector<string16>& autofill_values, |
| 152 const std::vector<string16>& autofill_labels, | 152 const std::vector<string16>& autofill_labels, |
| 153 const std::vector<string16>& autofill_icons, | 153 const std::vector<string16>& autofill_icons, |
| 154 const std::vector<int>& autofill_unique_ids, | 154 const std::vector<int>& autofill_unique_ids) OVERRIDE {}; |
| 155 int separator_index) OVERRIDE {}; | |
| 156 | 155 |
| 157 MOCK_METHOD5(OnSuggestionsReturned, | 156 MOCK_METHOD5(OnSuggestionsReturned, |
| 158 void(int query_id, | 157 void(int query_id, |
| 159 const std::vector<string16>& autofill_values, | 158 const std::vector<string16>& autofill_values, |
| 160 const std::vector<string16>& autofill_labels, | 159 const std::vector<string16>& autofill_labels, |
| 161 const std::vector<string16>& autofill_icons, | 160 const std::vector<string16>& autofill_icons, |
| 162 const std::vector<int>& autofill_unique_ids)); | 161 const std::vector<int>& autofill_unique_ids)); |
| 163 | 162 |
| 164 private: | 163 private: |
| 165 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); | 164 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 186 &profile_, web_data_service_); | 185 &profile_, web_data_service_); |
| 187 | 186 |
| 188 MockAutofillExternalDelegate external_delegate( | 187 MockAutofillExternalDelegate external_delegate( |
| 189 TabContentsWrapper::GetCurrentWrapperForContents(contents())); | 188 TabContentsWrapper::GetCurrentWrapperForContents(contents())); |
| 190 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 189 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
| 191 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 190 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
| 192 | 191 |
| 193 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 192 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
| 194 autocomplete_history_manager.SendSuggestions(NULL); | 193 autocomplete_history_manager.SendSuggestions(NULL); |
| 195 } | 194 } |
| OLD | NEW |