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 "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/autofill_external_delegate.h" | 9 #include "chrome/browser/autofill/autofill_external_delegate.h" |
10 #include "chrome/browser/autofill/autofill_manager.h" | 10 #include "chrome/browser/autofill/autofill_manager.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 AutofillPopupControllerImpl::GetOrCreate( | 316 AutofillPopupControllerImpl::GetOrCreate( |
317 test_controller->GetWeakPtr(), | 317 test_controller->GetWeakPtr(), |
318 &delegate, | 318 &delegate, |
319 NULL, | 319 NULL, |
320 bounds); | 320 bounds); |
321 EXPECT_EQ( | 321 EXPECT_EQ( |
322 bounds, | 322 bounds, |
323 static_cast<AutofillPopupController*>(controller3)->element_bounds()); | 323 static_cast<AutofillPopupController*>(controller3)->element_bounds()); |
324 controller3->Hide(); | 324 controller3->Hide(); |
325 | 325 |
326 delete test_controller; | 326 // Hide the test_controller to delete it. |
| 327 test_controller->DoHide(); |
327 } | 328 } |
328 | 329 |
329 #if !defined(OS_ANDROID) | 330 #if !defined(OS_ANDROID) |
330 TEST_F(AutofillPopupControllerUnitTest, ElideText) { | 331 TEST_F(AutofillPopupControllerUnitTest, ElideText) { |
331 std::vector<string16> names; | 332 std::vector<string16> names; |
332 names.push_back(ASCIIToUTF16("Text that will need to be trimmed")); | 333 names.push_back(ASCIIToUTF16("Text that will need to be trimmed")); |
333 names.push_back(ASCIIToUTF16("Untrimmed")); | 334 names.push_back(ASCIIToUTF16("Untrimmed")); |
334 | 335 |
335 std::vector<string16> subtexts; | 336 std::vector<string16> subtexts; |
336 subtexts.push_back(ASCIIToUTF16("Label that will be trimmed")); | 337 subtexts.push_back(ASCIIToUTF16("Label that will be trimmed")); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 autofill_popup_controller->Show(names, names, names, autofill_ids); | 427 autofill_popup_controller->Show(names, names, names, autofill_ids); |
427 | 428 |
428 EXPECT_EQ(expected_popup_bounds[i].ToString(), | 429 EXPECT_EQ(expected_popup_bounds[i].ToString(), |
429 autofill_popup_controller->popup_bounds().ToString()) << | 430 autofill_popup_controller->popup_bounds().ToString()) << |
430 "Popup bounds failed to match for test " << i; | 431 "Popup bounds failed to match for test " << i; |
431 | 432 |
432 // Hide the controller to delete it. | 433 // Hide the controller to delete it. |
433 autofill_popup_controller->DoHide(); | 434 autofill_popup_controller->DoHide(); |
434 } | 435 } |
435 } | 436 } |
OLD | NEW |