Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 10024059: DataList UI (Chromium part) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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};
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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 2984
2984 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); 2985 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager();
2985 EXPECT_TRUE(autofill_manager->external_delegate()); 2986 EXPECT_TRUE(autofill_manager->external_delegate());
2986 2987
2987 AutocompleteHistoryManager* autocomplete_history_manager = 2988 AutocompleteHistoryManager* autocomplete_history_manager =
2988 contents_wrapper()->autocomplete_history_manager(); 2989 contents_wrapper()->autocomplete_history_manager();
2989 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); 2990 EXPECT_TRUE(autocomplete_history_manager->external_delegate());
2990 } 2991 }
2991 2992
2992 #endif // OS_ANDROID 2993 #endif // OS_ANDROID
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698