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

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

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
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/ui/autofill/autofill_popup_controller_impl.h" 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
10 #include "chrome/browser/ui/autofill/autofill_popup_view.h" 10 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 gfx::Rect()); 381 gfx::Rect());
382 EXPECT_EQ(controller.get(), controller2.get()); 382 EXPECT_EQ(controller.get(), controller2.get());
383 controller->Hide(); 383 controller->Hide();
384 384
385 testing::NiceMock<TestAutofillPopupController>* test_controller = 385 testing::NiceMock<TestAutofillPopupController>* test_controller =
386 new testing::NiceMock<TestAutofillPopupController>(delegate.GetWeakPtr(), 386 new testing::NiceMock<TestAutofillPopupController>(delegate.GetWeakPtr(),
387 gfx::Rect()); 387 gfx::Rect());
388 EXPECT_CALL(*test_controller, Hide()); 388 EXPECT_CALL(*test_controller, Hide());
389 389
390 gfx::RectF bounds(0.f, 0.f, 1.f, 2.f); 390 gfx::RectF bounds(0.f, 0.f, 1.f, 2.f);
391 AutofillPopupControllerImpl* controller3 = 391 base::WeakPtr<AutofillPopupControllerImpl> controller3 =
392 AutofillPopupControllerImpl::GetOrCreate( 392 AutofillPopupControllerImpl::GetOrCreate(
393 test_controller->GetWeakPtr(), 393 test_controller->GetWeakPtr(),
394 delegate.GetWeakPtr(), 394 delegate.GetWeakPtr(),
395 NULL, 395 NULL,
396 bounds); 396 bounds);
397 EXPECT_EQ( 397 EXPECT_EQ(
398 bounds, 398 bounds,
399 static_cast<AutofillPopupController*>(controller3)->element_bounds()); 399 static_cast<AutofillPopupController*>(controller3.get())->
400 element_bounds());
400 controller3->Hide(); 401 controller3->Hide();
401 402
402 // Hide the test_controller to delete it. 403 // Hide the test_controller to delete it.
403 test_controller->DoHide(); 404 test_controller->DoHide();
404 } 405 }
405 406
406 TEST_F(AutofillPopupControllerUnitTest, ProperlyResetController) { 407 TEST_F(AutofillPopupControllerUnitTest, ProperlyResetController) {
407 std::vector<string16> names(2); 408 std::vector<string16> names(2);
408 std::vector<int> ids(2); 409 std::vector<int> ids(2);
409 popup_controller()->SetValues(names, names, names, ids); 410 popup_controller()->SetValues(names, names, names, ids);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 EXPECT_EQ(expected_popup_bounds[i].ToString(), 524 EXPECT_EQ(expected_popup_bounds[i].ToString(),
524 autofill_popup_controller->popup_bounds().ToString()) << 525 autofill_popup_controller->popup_bounds().ToString()) <<
525 "Popup bounds failed to match for test " << i; 526 "Popup bounds failed to match for test " << i;
526 527
527 // Hide the controller to delete it. 528 // Hide the controller to delete it.
528 autofill_popup_controller->DoHide(); 529 autofill_popup_controller->DoHide();
529 } 530 }
530 } 531 }
531 532
532 } // namespace autofill 533 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | content/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698