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

Side by Side Diff: components/autofill/core/browser/autofill_manager_unittest.cc

Issue 79103002: Abstracted AcceptPasswordAutofillSuggestion IPC out of core Autofill code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 std::vector<ServerFieldTypeSet> expected_submitted_field_types_; 535 std::vector<ServerFieldTypeSet> expected_submitted_field_types_;
536 536
537 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); 537 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager);
538 }; 538 };
539 539
540 class TestAutofillExternalDelegate : public AutofillExternalDelegate { 540 class TestAutofillExternalDelegate : public AutofillExternalDelegate {
541 public: 541 public:
542 explicit TestAutofillExternalDelegate(content::WebContents* web_contents, 542 explicit TestAutofillExternalDelegate(content::WebContents* web_contents,
543 AutofillManager* autofill_manager, 543 AutofillManager* autofill_manager,
544 AutofillDriver* autofill_driver) 544 AutofillDriver* autofill_driver)
545 : AutofillExternalDelegate(web_contents, autofill_manager, 545 : AutofillExternalDelegate(autofill_manager, autofill_driver),
546 autofill_driver),
547 on_query_seen_(false), 546 on_query_seen_(false),
548 on_suggestions_returned_seen_(false) {} 547 on_suggestions_returned_seen_(false) {}
549 virtual ~TestAutofillExternalDelegate() {} 548 virtual ~TestAutofillExternalDelegate() {}
550 549
551 virtual void OnQuery(int query_id, 550 virtual void OnQuery(int query_id,
552 const FormData& form, 551 const FormData& form,
553 const FormFieldData& field, 552 const FormFieldData& field,
554 const gfx::RectF& bounds, 553 const gfx::RectF& bounds,
555 bool display_warning) OVERRIDE { 554 bool display_warning) OVERRIDE {
556 on_query_seen_ = true; 555 on_query_seen_ = true;
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 test::CreateTestAddressFormData(&form); 2942 test::CreateTestAddressFormData(&form);
2944 std::vector<FormData> forms(1, form); 2943 std::vector<FormData> forms(1, form);
2945 FormsSeen(forms); 2944 FormsSeen(forms);
2946 const FormFieldData& field = form.fields[0]; 2945 const FormFieldData& field = form.fields[0];
2947 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 2946 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
2948 2947
2949 EXPECT_TRUE(external_delegate_->on_query_seen()); 2948 EXPECT_TRUE(external_delegate_->on_query_seen());
2950 } 2949 }
2951 2950
2952 } // namespace autofill 2951 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698