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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "chrome/browser/autofill/autofill_manager.h" | 6 #include "chrome/browser/autofill/autofill_manager.h" |
7 #include "chrome/browser/autofill/test_autofill_external_delegate.h" | 7 #include "chrome/browser/autofill/test_autofill_external_delegate.h" |
8 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 8 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
9 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace { | 28 namespace { |
29 | 29 |
30 class MockAutofillExternalDelegate : public AutofillExternalDelegate { | 30 class MockAutofillExternalDelegate : public AutofillExternalDelegate { |
31 public: | 31 public: |
32 explicit MockAutofillExternalDelegate(content::WebContents* web_contents) | 32 explicit MockAutofillExternalDelegate(content::WebContents* web_contents) |
33 : AutofillExternalDelegate( | 33 : AutofillExternalDelegate( |
34 web_contents, | 34 web_contents, |
35 AutofillManager::FromWebContents(web_contents)) {} | 35 AutofillManager::FromWebContents(web_contents)) {} |
36 ~MockAutofillExternalDelegate() {} | 36 ~MockAutofillExternalDelegate() {} |
37 | 37 |
38 virtual void SelectAutofillSuggestionAtIndex(int unique_id) | 38 virtual void SelectSuggestion(int unique_id) OVERRIDE {} |
39 OVERRIDE {} | |
40 | 39 |
41 virtual void ClearPreviewedForm() OVERRIDE {} | 40 virtual void ClearPreviewedForm() OVERRIDE {} |
42 | 41 |
43 AutofillPopupControllerImpl* GetController() { | 42 AutofillPopupControllerImpl* GetController() { |
44 return controller(); | 43 return controller(); |
45 } | 44 } |
46 | 45 |
47 MOCK_METHOD0(HideAutofillPopup, void()); | 46 MOCK_METHOD0(HideAutofillPopup, void()); |
48 }; | 47 }; |
49 | 48 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 MAYBE_CloseWidgetAndNoLeaking) { | 140 MAYBE_CloseWidgetAndNoLeaking) { |
142 EXPECT_CALL(*autofill_external_delegate_, | 141 EXPECT_CALL(*autofill_external_delegate_, |
143 HideAutofillPopup()).Times(AtLeast(1)); | 142 HideAutofillPopup()).Times(AtLeast(1)); |
144 | 143 |
145 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 144 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
146 | 145 |
147 // Delete the view from under the delegate to ensure that the | 146 // Delete the view from under the delegate to ensure that the |
148 // delegate and the controller can handle the popup getting deleted elsewhere. | 147 // delegate and the controller can handle the popup getting deleted elsewhere. |
149 autofill_external_delegate_->GetController()->view()->Hide(); | 148 autofill_external_delegate_->GetController()->view()->Hide(); |
150 } | 149 } |
OLD | NEW |