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 <map> | 5 #include <map> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 mock_new_card_bubble_controller_(mock_new_card_bubble_controller), | 269 mock_new_card_bubble_controller_(mock_new_card_bubble_controller), |
270 submit_button_delay_count_(0) {} | 270 submit_button_delay_count_(0) {} |
271 | 271 |
272 virtual ~TestAutofillDialogController() {} | 272 virtual ~TestAutofillDialogController() {} |
273 | 273 |
274 virtual AutofillDialogView* CreateView() override { | 274 virtual AutofillDialogView* CreateView() override { |
275 return new testing::NiceMock<TestAutofillDialogView>(); | 275 return new testing::NiceMock<TestAutofillDialogView>(); |
276 } | 276 } |
277 | 277 |
278 void Init(content::BrowserContext* browser_context) { | 278 void Init(content::BrowserContext* browser_context) { |
279 test_manager_.Init( | 279 test_manager_.Init(WebDataServiceFactory::GetAutofillWebDataForProfile( |
280 WebDataServiceFactory::GetAutofillWebDataForProfile( | 280 Profile::FromBrowserContext(browser_context), |
281 Profile::FromBrowserContext(browser_context), | 281 ServiceAccessType::EXPLICIT_ACCESS), |
282 Profile::EXPLICIT_ACCESS), | 282 user_prefs::UserPrefs::Get(browser_context), |
283 user_prefs::UserPrefs::Get(browser_context), | 283 browser_context->IsOffTheRecord()); |
284 browser_context->IsOffTheRecord()); | |
285 } | 284 } |
286 | 285 |
287 TestAutofillDialogView* GetView() { | 286 TestAutofillDialogView* GetView() { |
288 return static_cast<TestAutofillDialogView*>(view()); | 287 return static_cast<TestAutofillDialogView*>(view()); |
289 } | 288 } |
290 | 289 |
291 TestPersonalDataManager* GetTestingManager() { | 290 TestPersonalDataManager* GetTestingManager() { |
292 return &test_manager_; | 291 return &test_manager_; |
293 } | 292 } |
294 | 293 |
(...skipping 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3647 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); | 3646 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); |
3648 EXPECT_EQ(ADDRESS_HOME_COUNTRY, | 3647 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
3649 form_structure()->field(3)->Type().GetStorableType()); | 3648 form_structure()->field(3)->Type().GetStorableType()); |
3650 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); | 3649 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); |
3651 EXPECT_EQ(ADDRESS_HOME_COUNTRY, | 3650 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
3652 form_structure()->field(4)->Type().GetStorableType()); | 3651 form_structure()->field(4)->Type().GetStorableType()); |
3653 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); | 3652 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); |
3654 } | 3653 } |
3655 | 3654 |
3656 } // namespace autofill | 3655 } // namespace autofill |
OLD | NEW |