Index: chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc |
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc |
index 4fbb0359f0ffb37cef90000ac552275d8ed0c7e5..09bd84594bcab35f2a1323b4cc0690c2ddc63011 100644 |
--- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc |
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc |
@@ -378,13 +378,18 @@ TEST_F(AutofillPopupControllerUnitTest, GrowPopupInSpace) { |
desired_width / 2, desired_height /2, desired_width, desired_height)); |
for (size_t i = 0; i < element_bounds.size(); ++i) { |
- TestAutofillPopupController autofill_popup_controller(&external_delegate_, |
- element_bounds[i]); |
- autofill_popup_controller.set_display(display); |
- autofill_popup_controller.Show(names, names, names, autofill_ids); |
+ TestAutofillPopupController* autofill_popup_controller = |
+ new TestAutofillPopupController(&external_delegate_, |
+ element_bounds[i]); |
+ |
+ autofill_popup_controller->set_display(display); |
+ autofill_popup_controller->Show(names, names, names, autofill_ids); |
EXPECT_EQ(expected_popup_bounds[i].ToString(), |
- autofill_popup_controller.popup_bounds().ToString()) << |
+ autofill_popup_controller->popup_bounds().ToString()) << |
"Popup bounds failed to match for test " << i; |
+ |
+ // Hide the controller to delete it. |
+ autofill_popup_controller->DoHide(); |
} |
} |