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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc

Issue 870833002: [android] Autofill popup behavior fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant hide-on-resize on Views. Created 5 years, 11 months 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 "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
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 // Autofill UI isn't currently hidden on window move on Mac.
100 // http://crbug.com/180566
101 #if !defined(OS_MACOSX)
102 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, 99 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest,
103 HidePopupOnWindowConfiguration) { 100 HidePopupOnWindowResize) {
104 GenerateTestAutofillPopup(autofill_external_delegate_.get()); 101 GenerateTestAutofillPopup(autofill_external_delegate_.get());
105 102
106 EXPECT_FALSE(autofill_external_delegate_->popup_hidden()); 103 EXPECT_FALSE(autofill_external_delegate_->popup_hidden());
107 104
108 // Resize the window, which should cause the popup to hide. 105 // Resize the window, which should cause the popup to hide.
109 gfx::Rect new_bounds = browser()->window()->GetBounds() - gfx::Vector2d(1, 1); 106 gfx::Rect new_bounds = browser()->window()->GetBounds();
Evan Stade 2015/01/26 20:21:54 seems like you should leave this test as is (perha
please use gerrit instead 2015/01/26 23:49:03 Changed expectations and added another test. The t
107 new_bounds.Inset(1, 1);
110 browser()->window()->SetBounds(new_bounds); 108 browser()->window()->SetBounds(new_bounds);
111 109
112 autofill_external_delegate_->WaitForPopupHidden(); 110 autofill_external_delegate_->WaitForPopupHidden();
113 EXPECT_TRUE(autofill_external_delegate_->popup_hidden()); 111 EXPECT_TRUE(autofill_external_delegate_->popup_hidden());
114 } 112 }
115 #endif // !defined(OS_MACOSX)
116 113
117 // This test checks that the browser doesn't crash if the delegate is deleted 114 // This test checks that the browser doesn't crash if the delegate is deleted
118 // before the popup is hidden. 115 // before the popup is hidden.
119 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, 116 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest,
120 DeleteDelegateBeforePopupHidden){ 117 DeleteDelegateBeforePopupHidden){
121 GenerateTestAutofillPopup(autofill_external_delegate_.get()); 118 GenerateTestAutofillPopup(autofill_external_delegate_.get());
122 119
123 // Delete the external delegate here so that is gets deleted before popup is 120 // Delete the external delegate here so that is gets deleted before popup is
124 // hidden. This can happen if the web_contents are destroyed before the popup 121 // hidden. This can happen if the web_contents are destroyed before the popup
125 // is hidden. See http://crbug.com/232475 122 // is hidden. See http://crbug.com/232475
126 autofill_external_delegate_.reset(); 123 autofill_external_delegate_.reset();
127 } 124 }
128 125
129 } // namespace autofill 126 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698