| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/task.h" | 9 #include "base/task.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/autocomplete_history_manager.h" | 11 #include "chrome/browser/autocomplete_history_manager.h" |
| 12 #include "chrome/browser/autofill/autofill_external_delegate.h" | 12 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "chrome/browser/webdata/web_data_service.h" | 14 #include "chrome/browser/webdata/web_data_service.h" |
| 15 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 15 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 16 #include "chrome/test/base/testing_browser_process.h" | 16 #include "chrome/test/base/testing_browser_process.h" |
| 17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "content/browser/tab_contents/test_tab_contents.h" | 18 #include "content/browser/tab_contents/test_tab_contents.h" |
| 19 #include "content/test/test_browser_thread.h" | 19 #include "content/test/test_browser_thread.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "webkit/glue/form_data.h" | 22 #include "webkit/glue/form_data.h" |
| 23 | 23 |
| 24 using content::BrowserThread; |
| 24 using testing::_; | 25 using testing::_; |
| 25 using webkit_glue::FormData; | 26 using webkit_glue::FormData; |
| 26 | 27 |
| 27 class MockWebDataService : public WebDataService { | 28 class MockWebDataService : public WebDataService { |
| 28 public: | 29 public: |
| 29 MOCK_METHOD1(AddFormFields, | 30 MOCK_METHOD1(AddFormFields, |
| 30 void(const std::vector<webkit_glue::FormField>&)); // NOLINT | 31 void(const std::vector<webkit_glue::FormField>&)); // NOLINT |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { | 34 class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 179 |
| 179 MockAutofillExternalDelegate external_delegate( | 180 MockAutofillExternalDelegate external_delegate( |
| 180 TabContentsWrapper::GetCurrentWrapperForContents(contents())); | 181 TabContentsWrapper::GetCurrentWrapperForContents(contents())); |
| 181 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 182 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
| 182 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 183 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
| 183 | 184 |
| 184 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 185 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
| 185 autocomplete_history_manager.SendSuggestions(NULL); | 186 autocomplete_history_manager.SendSuggestions(NULL); |
| 186 } | 187 } |
| 187 | 188 |
| OLD | NEW |