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/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 25 matching lines...) Expand all Loading... | |
36 #include "content/test/test_browser_thread.h" | 36 #include "content/test/test_browser_thread.h" |
37 #include "googleurl/src/gurl.h" | 37 #include "googleurl/src/gurl.h" |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "ipc/ipc_test_sink.h" | 39 #include "ipc/ipc_test_sink.h" |
40 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
41 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
42 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
43 #include "ui/gfx/rect.h" | 43 #include "ui/gfx/rect.h" |
44 #include "webkit/forms/form_data.h" | 44 #include "webkit/forms/form_data.h" |
45 #include "webkit/forms/form_field.h" | 45 #include "webkit/forms/form_field.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" | |
46 | 47 |
47 using content::BrowserThread; | 48 using content::BrowserThread; |
48 using content::WebContents; | 49 using content::WebContents; |
49 using testing::_; | 50 using testing::_; |
50 using webkit::forms::FormData; | 51 using webkit::forms::FormData; |
51 using webkit::forms::FormField; | 52 using webkit::forms::FormField; |
52 | 53 |
53 namespace { | 54 namespace { |
54 | 55 |
55 // The page ID sent to the AutofillManager from the RenderView, used to send | 56 // The page ID sent to the AutofillManager from the RenderView, used to send |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
904 std::vector<string16> icons; | 905 std::vector<string16> icons; |
905 std::vector<int> unique_ids; | 906 std::vector<int> unique_ids; |
906 EXPECT_TRUE(GetAutofillSuggestionsMessage(&page_id, &values, &labels, &icons, | 907 EXPECT_TRUE(GetAutofillSuggestionsMessage(&page_id, &values, &labels, &icons, |
907 &unique_ids)); | 908 &unique_ids)); |
908 | 909 |
909 string16 expected_values[] = { | 910 string16 expected_values[] = { |
910 l10n_util::GetStringUTF16(IDS_AUTOFILL_WARNING_FORM_DISABLED) | 911 l10n_util::GetStringUTF16(IDS_AUTOFILL_WARNING_FORM_DISABLED) |
911 }; | 912 }; |
912 string16 expected_labels[] = {string16()}; | 913 string16 expected_labels[] = {string16()}; |
913 string16 expected_icons[] = {string16()}; | 914 string16 expected_icons[] = {string16()}; |
914 int expected_unique_ids[] = {-1}; | 915 int expected_unique_ids[] = {WebKit::WarningMessageMenuItemID}; |
Ilya Sherman
2012/04/16 21:45:49
nit: I think you need to update the namespace unwr
keishi
2012/04/17 09:15:10
Done.
| |
915 ExpectSuggestions(page_id, values, labels, icons, unique_ids, | 916 ExpectSuggestions(page_id, values, labels, icons, unique_ids, |
916 kDefaultPageID, arraysize(expected_values), expected_values, | 917 kDefaultPageID, arraysize(expected_values), expected_values, |
917 expected_labels, expected_icons, expected_unique_ids); | 918 expected_labels, expected_icons, expected_unique_ids); |
918 | 919 |
919 // Now add some Autocomplete suggestions. We should return the autocomplete | 920 // Now add some Autocomplete suggestions. We should return the autocomplete |
920 // suggestions and the warning; these will be culled by the renderer. | 921 // suggestions and the warning; these will be culled by the renderer. |
921 const int kPageID2 = 2; | 922 const int kPageID2 = 2; |
922 GetAutofillSuggestions(kPageID2, form, field); | 923 GetAutofillSuggestions(kPageID2, form, field); |
923 | 924 |
924 std::vector<string16> suggestions; | 925 std::vector<string16> suggestions; |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2990 | 2991 |
2991 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); | 2992 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); |
2992 EXPECT_TRUE(autofill_manager->external_delegate()); | 2993 EXPECT_TRUE(autofill_manager->external_delegate()); |
2993 | 2994 |
2994 AutocompleteHistoryManager* autocomplete_history_manager = | 2995 AutocompleteHistoryManager* autocomplete_history_manager = |
2995 contents_wrapper()->autocomplete_history_manager(); | 2996 contents_wrapper()->autocomplete_history_manager(); |
2996 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); | 2997 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); |
2997 } | 2998 } |
2998 | 2999 |
2999 #endif // OS_ANDROID | 3000 #endif // OS_ANDROID |
OLD | NEW |