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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
32 #include "chrome/test/base/testing_profile.h" | 32 #include "chrome/test/base/testing_profile.h" |
33 #include "content/browser/tab_contents/test_tab_contents.h" | 33 #include "content/browser/tab_contents/test_tab_contents.h" |
34 #include "content/test/test_browser_thread.h" | 34 #include "content/test/test_browser_thread.h" |
35 #include "googleurl/src/gurl.h" | 35 #include "googleurl/src/gurl.h" |
36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
37 #include "ipc/ipc_test_sink.h" | 37 #include "ipc/ipc_test_sink.h" |
38 #include "testing/gmock/include/gmock/gmock.h" | 38 #include "testing/gmock/include/gmock/gmock.h" |
39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
41 #include "ui/gfx/rect.h" | |
41 #include "webkit/glue/form_data.h" | 42 #include "webkit/glue/form_data.h" |
42 #include "webkit/glue/form_field.h" | 43 #include "webkit/glue/form_field.h" |
43 | 44 |
44 using content::BrowserThread; | 45 using content::BrowserThread; |
45 using testing::_; | 46 using testing::_; |
46 using webkit_glue::FormData; | 47 using webkit_glue::FormData; |
47 using webkit_glue::FormField; | 48 using webkit_glue::FormField; |
48 | 49 |
49 namespace { | 50 namespace { |
50 | 51 |
(...skipping 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2866 MOCK_METHOD3(OnQuery, void(int query_id, | 2867 MOCK_METHOD3(OnQuery, void(int query_id, |
2867 const webkit_glue::FormData& form, | 2868 const webkit_glue::FormData& form, |
2868 const webkit_glue::FormField& field)); | 2869 const webkit_glue::FormField& field)); |
2869 virtual void OnSuggestionsReturned( | 2870 virtual void OnSuggestionsReturned( |
2870 int query_id, | 2871 int query_id, |
2871 const std::vector<string16>& autofill_values, | 2872 const std::vector<string16>& autofill_values, |
2872 const std::vector<string16>& autofill_labels, | 2873 const std::vector<string16>& autofill_labels, |
2873 const std::vector<string16>& autofill_icons, | 2874 const std::vector<string16>& autofill_icons, |
2874 const std::vector<int>& autofill_unique_ids) {} | 2875 const std::vector<int>& autofill_unique_ids) {} |
2875 | 2876 |
2877 virtual void SetAutofillElementBounds(const gfx::Rect& bounds) {} | |
2878 | |
2879 virtual void ShowAutofillPopup() {} | |
2880 | |
2881 virtual void HideAutofillPopup() {} | |
Ilya Sherman
2011/11/07 21:48:49
nit: Please annotate these with OVERRIDE
csharp1
2011/11/08 19:59:00
Done.
| |
2882 | |
2876 private: | 2883 private: |
2877 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); | 2884 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); |
2878 }; | 2885 }; |
2879 | 2886 |
2880 } // namespace | 2887 } // namespace |
2881 | 2888 |
2882 // Test our external delegate is called at the right time. | 2889 // Test our external delegate is called at the right time. |
2883 TEST_F(AutofillManagerTest, TestExternalDelegate) { | 2890 TEST_F(AutofillManagerTest, TestExternalDelegate) { |
2884 MockAutofillExternalDelegate external_delegate(contents_wrapper()); | 2891 MockAutofillExternalDelegate external_delegate(contents_wrapper()); |
2885 EXPECT_CALL(external_delegate, OnQuery(_, _, _)); | 2892 EXPECT_CALL(external_delegate, OnQuery(_, _, _)); |
(...skipping 26 matching lines...) Expand all Loading... | |
2912 | 2919 |
2913 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); | 2920 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); |
2914 EXPECT_TRUE(autofill_manager->external_delegate()); | 2921 EXPECT_TRUE(autofill_manager->external_delegate()); |
2915 | 2922 |
2916 AutocompleteHistoryManager* autocomplete_history_manager = | 2923 AutocompleteHistoryManager* autocomplete_history_manager = |
2917 contents_wrapper()->autocomplete_history_manager(); | 2924 contents_wrapper()->autocomplete_history_manager(); |
2918 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); | 2925 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); |
2919 } | 2926 } |
2920 | 2927 |
2921 #endif // OS_ANDROID | 2928 #endif // OS_ANDROID |
OLD | NEW |