| 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/ui/autofill/autofill_popup_controller_impl.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 public: | 136 public: |
| 137 AutofillPopupControllerUnitTest() | 137 AutofillPopupControllerUnitTest() |
| 138 : manager_delegate_(new MockAutofillManagerDelegate()), | 138 : manager_delegate_(new MockAutofillManagerDelegate()), |
| 139 autofill_popup_controller_(NULL) {} | 139 autofill_popup_controller_(NULL) {} |
| 140 virtual ~AutofillPopupControllerUnitTest() {} | 140 virtual ~AutofillPopupControllerUnitTest() {} |
| 141 | 141 |
| 142 virtual void SetUp() OVERRIDE { | 142 virtual void SetUp() OVERRIDE { |
| 143 ChromeRenderViewHostTestHarness::SetUp(); | 143 ChromeRenderViewHostTestHarness::SetUp(); |
| 144 | 144 |
| 145 AutofillManager::CreateForWebContentsAndDelegate( | 145 AutofillManager::CreateForWebContentsAndDelegate( |
| 146 web_contents(), manager_delegate_.get()); | 146 web_contents(), manager_delegate_.get(), "en-US"); |
| 147 external_delegate_.reset( | 147 external_delegate_.reset( |
| 148 new NiceMock<MockAutofillExternalDelegate>( | 148 new NiceMock<MockAutofillExternalDelegate>( |
| 149 web_contents(), AutofillManager::FromWebContents(web_contents()))); | 149 web_contents(), AutofillManager::FromWebContents(web_contents()))); |
| 150 | 150 |
| 151 autofill_popup_controller_ = | 151 autofill_popup_controller_ = |
| 152 new testing::NiceMock<TestAutofillPopupController>( | 152 new testing::NiceMock<TestAutofillPopupController>( |
| 153 external_delegate_.get(), gfx::Rect()); | 153 external_delegate_.get(), gfx::Rect()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 virtual void TearDown() OVERRIDE { | 156 virtual void TearDown() OVERRIDE { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 autofill_popup_controller->Show(names, names, names, autofill_ids); | 427 autofill_popup_controller->Show(names, names, names, autofill_ids); |
| 428 | 428 |
| 429 EXPECT_EQ(expected_popup_bounds[i].ToString(), | 429 EXPECT_EQ(expected_popup_bounds[i].ToString(), |
| 430 autofill_popup_controller->popup_bounds().ToString()) << | 430 autofill_popup_controller->popup_bounds().ToString()) << |
| 431 "Popup bounds failed to match for test " << i; | 431 "Popup bounds failed to match for test " << i; |
| 432 | 432 |
| 433 // Hide the controller to delete it. | 433 // Hide the controller to delete it. |
| 434 autofill_popup_controller->DoHide(); | 434 autofill_popup_controller->DoHide(); |
| 435 } | 435 } |
| 436 } | 436 } |
| OLD | NEW |