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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 3131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 content::SSLStatus()); | 3142 content::SSLStatus()); |
3143 | 3143 |
3144 EXPECT_EQ(1, autofill_manager_->request_autocomplete_error_count()); | 3144 EXPECT_EQ(1, autofill_manager_->request_autocomplete_error_count()); |
3145 } | 3145 } |
3146 | 3146 |
3147 namespace { | 3147 namespace { |
3148 | 3148 |
3149 class MockAutofillExternalDelegate : | 3149 class MockAutofillExternalDelegate : |
3150 public autofill::TestAutofillExternalDelegate { | 3150 public autofill::TestAutofillExternalDelegate { |
3151 public: | 3151 public: |
3152 explicit MockAutofillExternalDelegate(content::WebContents* web_contents, | 3152 MockAutofillExternalDelegate(content::WebContents* web_contents, |
3153 AutofillManager* autofill_manager) | 3153 AutofillManager* autofill_manager) |
3154 : TestAutofillExternalDelegate(web_contents, autofill_manager) {} | 3154 : TestAutofillExternalDelegate(web_contents, autofill_manager) {} |
3155 virtual ~MockAutofillExternalDelegate() {} | 3155 virtual ~MockAutofillExternalDelegate() {} |
3156 | 3156 |
3157 MOCK_METHOD5(OnQuery, void(int query_id, | 3157 MOCK_METHOD5(OnQuery, void(int query_id, |
3158 const FormData& form, | 3158 const FormData& form, |
3159 const FormFieldData& field, | 3159 const FormFieldData& field, |
3160 const gfx::Rect& bounds, | 3160 const gfx::Rect& bounds, |
3161 bool display_warning)); | 3161 bool display_warning)); |
3162 | 3162 |
3163 private: | 3163 private: |
(...skipping 11 matching lines...) Expand all Loading... |
3175 | 3175 |
3176 FormData form; | 3176 FormData form; |
3177 CreateTestAddressFormData(&form); | 3177 CreateTestAddressFormData(&form); |
3178 std::vector<FormData> forms(1, form); | 3178 std::vector<FormData> forms(1, form); |
3179 FormsSeen(forms); | 3179 FormsSeen(forms); |
3180 const FormFieldData& field = form.fields[0]; | 3180 const FormFieldData& field = form.fields[0]; |
3181 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3181 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3182 | 3182 |
3183 autofill_manager_->SetExternalDelegate(NULL); | 3183 autofill_manager_->SetExternalDelegate(NULL); |
3184 } | 3184 } |
OLD | NEW |