| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 using content::BrowserThread; | 23 using content::BrowserThread; |
| 24 using content::WebContents; | 24 using content::WebContents; |
| 25 using testing::_; | 25 using testing::_; |
| 26 using webkit::forms::FormData; | 26 using webkit::forms::FormData; |
| 27 | 27 |
| 28 class MockWebDataService : public WebDataService { | 28 class MockWebDataService : public WebDataService { |
| 29 public: | 29 public: |
| 30 MOCK_METHOD1(AddFormFields, | 30 MOCK_METHOD1(AddFormFields, |
| 31 void(const std::vector<webkit::forms::FormField>&)); // NOLINT | 31 void(const std::vector<webkit::forms::FormField>&)); // NOLINT |
| 32 |
| 33 protected: |
| 34 virtual ~MockWebDataService() {} |
| 32 }; | 35 }; |
| 33 | 36 |
| 34 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { | 37 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { |
| 35 protected: | 38 protected: |
| 36 AutocompleteHistoryManagerTest() | 39 AutocompleteHistoryManagerTest() |
| 37 : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) { | 40 : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) { |
| 38 } | 41 } |
| 39 | 42 |
| 40 virtual void SetUp() { | 43 virtual void SetUp() { |
| 41 ChromeRenderViewHostTestHarness::SetUp(); | 44 ChromeRenderViewHostTestHarness::SetUp(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 &profile_, web_data_service_); | 186 &profile_, web_data_service_); |
| 184 | 187 |
| 185 MockAutofillExternalDelegate external_delegate( | 188 MockAutofillExternalDelegate external_delegate( |
| 186 TabContentsWrapper::GetCurrentWrapperForContents(contents())); | 189 TabContentsWrapper::GetCurrentWrapperForContents(contents())); |
| 187 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 190 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
| 188 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 191 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
| 189 | 192 |
| 190 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 193 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
| 191 autocomplete_history_manager.SendSuggestions(NULL); | 194 autocomplete_history_manager.SendSuggestions(NULL); |
| 192 } | 195 } |
| OLD | NEW |