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/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 static MockWebDataService* current_mock_web_data_service_; | 53 static MockWebDataService* current_mock_web_data_service_; |
54 }; | 54 }; |
55 | 55 |
56 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; | 56 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; |
57 | 57 |
58 class MockAutofillManagerDelegate | 58 class MockAutofillManagerDelegate |
59 : public autofill::TestAutofillManagerDelegate { | 59 : public autofill::TestAutofillManagerDelegate { |
60 public: | 60 public: |
61 MockAutofillManagerDelegate() {} | 61 MockAutofillManagerDelegate() {} |
62 virtual ~MockAutofillManagerDelegate() {} | 62 virtual ~MockAutofillManagerDelegate() {} |
63 virtual PrefService* GetPrefs() { return &prefs_; } | 63 virtual PrefService* GetPrefs() OVERRIDE { return &prefs_; } |
64 | 64 |
65 private: | 65 private: |
66 TestingPrefServiceSimple prefs_; | 66 TestingPrefServiceSimple prefs_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(MockAutofillManagerDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(MockAutofillManagerDelegate); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 | 72 |
73 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { | 73 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 AutofillManager::CreateForWebContentsAndDelegate( | 229 AutofillManager::CreateForWebContentsAndDelegate( |
230 web_contents(), &manager_delegate); | 230 web_contents(), &manager_delegate); |
231 | 231 |
232 MockAutofillExternalDelegate external_delegate(web_contents()); | 232 MockAutofillExternalDelegate external_delegate(web_contents()); |
233 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 233 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
234 | 234 |
235 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 235 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
236 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 236 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
237 autocomplete_history_manager.SendSuggestions(NULL); | 237 autocomplete_history_manager.SendSuggestions(NULL); |
238 } | 238 } |
OLD | NEW |