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

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate_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 <vector> 5 #include <vector>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 : public ChromeRenderViewHostTestHarness { 102 : public ChromeRenderViewHostTestHarness {
103 protected: 103 protected:
104 virtual void SetUp() OVERRIDE { 104 virtual void SetUp() OVERRIDE {
105 ChromeRenderViewHostTestHarness::SetUp(); 105 ChromeRenderViewHostTestHarness::SetUp();
106 autofill_driver_.reset(new MockAutofillDriver(web_contents())); 106 autofill_driver_.reset(new MockAutofillDriver(web_contents()));
107 autofill_manager_.reset( 107 autofill_manager_.reset(
108 new MockAutofillManager(autofill_driver_.get(), 108 new MockAutofillManager(autofill_driver_.get(),
109 &manager_delegate_)); 109 &manager_delegate_));
110 external_delegate_.reset( 110 external_delegate_.reset(
111 new AutofillExternalDelegate( 111 new AutofillExternalDelegate(
112 web_contents(),
113 autofill_manager_.get(), autofill_driver_.get())); 112 autofill_manager_.get(), autofill_driver_.get()));
114 } 113 }
115 114
116 virtual void TearDown() OVERRIDE { 115 virtual void TearDown() OVERRIDE {
117 // Order of destruction is important as AutofillManager relies on 116 // Order of destruction is important as AutofillManager relies on
118 // PersonalDataManager to be around when it gets destroyed. Also, a real 117 // PersonalDataManager to be around when it gets destroyed. Also, a real
119 // AutofillManager is tied to the lifetime of the WebContents, so it must 118 // AutofillManager is tied to the lifetime of the WebContents, so it must
120 // be destroyed at the destruction of the WebContents. 119 // be destroyed at the destruction of the WebContents.
121 autofill_manager_.reset(); 120 autofill_manager_.reset();
122 external_delegate_.reset(); 121 external_delegate_.reset();
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 EXPECT_CALL(manager_delegate_, HideAutofillPopup()); 488 EXPECT_CALL(manager_delegate_, HideAutofillPopup());
490 base::string16 dummy_string(ASCIIToUTF16("baz foo")); 489 base::string16 dummy_string(ASCIIToUTF16("baz foo"));
491 EXPECT_CALL(*autofill_driver_, 490 EXPECT_CALL(*autofill_driver_,
492 RendererShouldSetNodeText(dummy_string)); 491 RendererShouldSetNodeText(dummy_string));
493 external_delegate_->DidAcceptSuggestion( 492 external_delegate_->DidAcceptSuggestion(
494 dummy_string, 493 dummy_string,
495 WebAutofillClient::MenuItemIDAutocompleteEntry); 494 WebAutofillClient::MenuItemIDAutocompleteEntry);
496 } 495 }
497 496
498 } // namespace autofill 497 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698