OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/autofill/password_generation_popup_view.h" | 5 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" | 8 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" |
9 #include "chrome/browser/ui/autofill/password_generation_popup_view_tester.h" | 9 #include "chrome/browser/ui/autofill/password_generation_popup_view_tester.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 gfx::NativeView native_view) | 23 gfx::NativeView native_view) |
24 : PasswordGenerationPopupControllerImpl( | 24 : PasswordGenerationPopupControllerImpl( |
25 gfx::RectF(0, 0, 10, 10), | 25 gfx::RectF(0, 0, 10, 10), |
26 PasswordForm(), | 26 PasswordForm(), |
27 10, | 27 10, |
28 NULL /* PasswordManager*/, | 28 NULL /* PasswordManager*/, |
29 NULL /* PasswordGenerationPopupObserver*/, | 29 NULL /* PasswordGenerationPopupObserver*/, |
30 web_contents, | 30 web_contents, |
31 native_view) {} | 31 native_view) {} |
32 | 32 |
33 virtual ~TestPasswordGenerationPopupController() {} | 33 ~TestPasswordGenerationPopupController() override {} |
34 | 34 |
35 PasswordGenerationPopupView* view() { | 35 PasswordGenerationPopupView* view() { |
36 return view_; | 36 return view_; |
37 } | 37 } |
38 }; | 38 }; |
39 | 39 |
40 class PasswordGenerationPopupViewTest : public InProcessBrowserTest { | 40 class PasswordGenerationPopupViewTest : public InProcessBrowserTest { |
41 public: | 41 public: |
42 virtual void SetUpOnMainThread() override { | 42 void SetUpOnMainThread() override { |
43 gfx::NativeView native_view = | 43 gfx::NativeView native_view = |
44 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); | 44 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); |
45 | 45 |
46 controller_ = | 46 controller_ = |
47 new TestPasswordGenerationPopupController( | 47 new TestPasswordGenerationPopupController( |
48 browser()->tab_strip_model()->GetActiveWebContents(), native_view); | 48 browser()->tab_strip_model()->GetActiveWebContents(), native_view); |
49 } | 49 } |
50 | 50 |
51 scoped_ptr<PasswordGenerationPopupViewTester> GetViewTester() { | 51 scoped_ptr<PasswordGenerationPopupViewTester> GetViewTester() { |
52 return PasswordGenerationPopupViewTester::For(controller_->view()).Pass(); | 52 return PasswordGenerationPopupViewTester::For(controller_->view()).Pass(); |
(...skipping 15 matching lines...) Expand all Loading... |
68 static_cast<PasswordGenerationPopupController*>( | 68 static_cast<PasswordGenerationPopupController*>( |
69 controller_)->popup_bounds().CenterPoint(); | 69 controller_)->popup_bounds().CenterPoint(); |
70 GetViewTester()->SimulateMouseMovementAt(center_point); | 70 GetViewTester()->SimulateMouseMovementAt(center_point); |
71 | 71 |
72 // Deletes |controller_|. | 72 // Deletes |controller_|. |
73 controller_->HideAndDestroy(); | 73 controller_->HideAndDestroy(); |
74 } | 74 } |
75 #endif | 75 #endif |
76 | 76 |
77 } // namespace autofill | 77 } // namespace autofill |
OLD | NEW |