OLD | NEW |
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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 7 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 // Normally the WebContents will automatically delete the delegate, but here | 91 // Normally the WebContents will automatically delete the delegate, but here |
92 // the delegate is owned by this test, so we have to manually destroy. | 92 // the delegate is owned by this test, so we have to manually destroy. |
93 void WebContentsDestroyed() override { autofill_external_delegate_.reset(); } | 93 void WebContentsDestroyed() override { autofill_external_delegate_.reset(); } |
94 | 94 |
95 protected: | 95 protected: |
96 scoped_ptr<TestAutofillExternalDelegate> autofill_external_delegate_; | 96 scoped_ptr<TestAutofillExternalDelegate> autofill_external_delegate_; |
97 }; | 97 }; |
98 | 98 |
| 99 #if defined(OS_MACOSX) |
| 100 // Fails on Mac OS, see crbug/453256 |
| 101 #define MAYBE_DoNotHidePopupOnWindowMove DISABLED_DoNotHidePopupOnWindowMove |
| 102 #else |
| 103 #define MAYBE_DoNotHidePopupOnWindowMove DoNotHidePopupOnWindowMove |
| 104 #endif |
99 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, | 105 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, |
100 DoNotHidePopupOnWindowMove) { | 106 MAYBE_DoNotHidePopupOnWindowMove) { |
101 GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 107 GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
102 | 108 |
103 EXPECT_FALSE(autofill_external_delegate_->popup_hidden()); | 109 EXPECT_FALSE(autofill_external_delegate_->popup_hidden()); |
104 | 110 |
105 // Move the window, which should not cause the popup to hide. | 111 // Move the window, which should not cause the popup to hide. |
106 gfx::Rect new_bounds = browser()->window()->GetBounds() - gfx::Vector2d(1, 1); | 112 gfx::Rect new_bounds = browser()->window()->GetBounds() - gfx::Vector2d(1, 1); |
107 browser()->window()->SetBounds(new_bounds); | 113 browser()->window()->SetBounds(new_bounds); |
108 | 114 |
109 EXPECT_FALSE(autofill_external_delegate_->popup_hidden()); | 115 EXPECT_FALSE(autofill_external_delegate_->popup_hidden()); |
110 } | 116 } |
(...skipping 19 matching lines...) Expand all Loading... |
130 DeleteDelegateBeforePopupHidden){ | 136 DeleteDelegateBeforePopupHidden){ |
131 GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 137 GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
132 | 138 |
133 // Delete the external delegate here so that is gets deleted before popup is | 139 // Delete the external delegate here so that is gets deleted before popup is |
134 // hidden. This can happen if the web_contents are destroyed before the popup | 140 // hidden. This can happen if the web_contents are destroyed before the popup |
135 // is hidden. See http://crbug.com/232475 | 141 // is hidden. See http://crbug.com/232475 |
136 autofill_external_delegate_.reset(); | 142 autofill_external_delegate_.reset(); |
137 } | 143 } |
138 | 144 |
139 } // namespace autofill | 145 } // namespace autofill |
OLD | NEW |