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

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

Issue 71683003: Have AutofillManagerDelegate supply the AutofillWebDataService to core code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 7 years, 1 month 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
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 <map> 5 #include <map>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 18 matching lines...) Expand all
29 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" 29 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h"
30 #include "components/autofill/content/browser/wallet/full_wallet.h" 30 #include "components/autofill/content/browser/wallet/full_wallet.h"
31 #include "components/autofill/content/browser/wallet/instrument.h" 31 #include "components/autofill/content/browser/wallet/instrument.h"
32 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" 32 #include "components/autofill/content/browser/wallet/mock_wallet_client.h"
33 #include "components/autofill/content/browser/wallet/wallet_address.h" 33 #include "components/autofill/content/browser/wallet/wallet_address.h"
34 #include "components/autofill/content/browser/wallet/wallet_service_url.h" 34 #include "components/autofill/content/browser/wallet/wallet_service_url.h"
35 #include "components/autofill/content/browser/wallet/wallet_test_util.h" 35 #include "components/autofill/content/browser/wallet/wallet_test_util.h"
36 #include "components/autofill/core/browser/autofill_metrics.h" 36 #include "components/autofill/core/browser/autofill_metrics.h"
37 #include "components/autofill/core/browser/autofill_test_utils.h" 37 #include "components/autofill/core/browser/autofill_test_utils.h"
38 #include "components/autofill/core/browser/test_personal_data_manager.h" 38 #include "components/autofill/core/browser/test_personal_data_manager.h"
39 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
39 #include "components/autofill/core/common/autofill_switches.h" 40 #include "components/autofill/core/common/autofill_switches.h"
40 #include "components/autofill/core/common/form_data.h" 41 #include "components/autofill/core/common/form_data.h"
41 #include "components/user_prefs/user_prefs.h" 42 #include "components/user_prefs/user_prefs.h"
42 #include "content/public/browser/web_contents.h" 43 #include "content/public/browser/web_contents.h"
43 #include "content/public/test/mock_render_process_host.h" 44 #include "content/public/test/mock_render_process_host.h"
44 #include "google_apis/gaia/google_service_auth_error.h" 45 #include "google_apis/gaia/google_service_auth_error.h"
45 #include "testing/gmock/include/gmock/gmock.h" 46 #include "testing/gmock/include/gmock/gmock.h"
46 #include "testing/gtest/include/gtest/gtest.h" 47 #include "testing/gtest/include/gtest/gtest.h"
47 48
48 #if defined(OS_WIN) 49 #if defined(OS_WIN)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 mock_new_card_bubble_controller_(mock_new_card_bubble_controller), 250 mock_new_card_bubble_controller_(mock_new_card_bubble_controller),
250 submit_button_delay_count_(0) {} 251 submit_button_delay_count_(0) {}
251 252
252 virtual ~TestAutofillDialogController() {} 253 virtual ~TestAutofillDialogController() {}
253 254
254 virtual AutofillDialogView* CreateView() OVERRIDE { 255 virtual AutofillDialogView* CreateView() OVERRIDE {
255 return new testing::NiceMock<TestAutofillDialogView>(); 256 return new testing::NiceMock<TestAutofillDialogView>();
256 } 257 }
257 258
258 void Init(content::BrowserContext* browser_context) { 259 void Init(content::BrowserContext* browser_context) {
259 test_manager_.Init(browser_context, 260 test_manager_.Init(
260 user_prefs::UserPrefs::Get(browser_context), 261 AutofillWebDataService::FromBrowserContext(browser_context),
261 browser_context->IsOffTheRecord()); 262 user_prefs::UserPrefs::Get(browser_context),
263 browser_context->IsOffTheRecord());
262 } 264 }
263 265
264 TestAutofillDialogView* GetView() { 266 TestAutofillDialogView* GetView() {
265 return static_cast<TestAutofillDialogView*>(view()); 267 return static_cast<TestAutofillDialogView*>(view());
266 } 268 }
267 269
268 TestPersonalDataManager* GetTestingManager() { 270 TestPersonalDataManager* GetTestingManager() {
269 return &test_manager_; 271 return &test_manager_;
270 } 272 }
271 273
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 EXPECT_NE(TestAutofillDialogController::NOT_CHECKED, 2691 EXPECT_NE(TestAutofillDialogController::NOT_CHECKED,
2690 controller()->SignedInState()); 2692 controller()->SignedInState());
2691 controller()->OnDidFetchWalletCookieValue(std::string()); 2693 controller()->OnDidFetchWalletCookieValue(std::string());
2692 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems()); 2694 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems());
2693 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( 2695 controller()->OnPassiveSigninFailure(GoogleServiceAuthError(
2694 GoogleServiceAuthError::CONNECTION_FAILED)); 2696 GoogleServiceAuthError::CONNECTION_FAILED));
2695 EXPECT_NE(use_wallet_text, controller()->SignInLinkText()); 2697 EXPECT_NE(use_wallet_text, controller()->SignInLinkText());
2696 } 2698 }
2697 2699
2698 } // namespace autofill 2700 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698