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

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

Issue 180953004: Componentize several Autofill unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 9 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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 class AutofillDialogControllerTest : public InProcessBrowserTest { 308 class AutofillDialogControllerTest : public InProcessBrowserTest {
309 public: 309 public:
310 AutofillDialogControllerTest() {} 310 AutofillDialogControllerTest() {}
311 virtual ~AutofillDialogControllerTest() {} 311 virtual ~AutofillDialogControllerTest() {}
312 312
313 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 313 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
314 command_line->AppendSwitch(::switches::kReduceSecurityForTesting); 314 command_line->AppendSwitch(::switches::kReduceSecurityForTesting);
315 } 315 }
316 316
317 virtual void SetUpOnMainThread() OVERRIDE { 317 virtual void SetUpOnMainThread() OVERRIDE {
318 autofill::test::DisableSystemServices(browser()->profile()); 318 autofill::test::DisableSystemServices(browser()->profile()->GetPrefs());
319 InitializeController(); 319 InitializeController();
320 } 320 }
321 321
322 protected: 322 protected:
323 bool SectionHasField(DialogSection section, ServerFieldType type) { 323 bool SectionHasField(DialogSection section, ServerFieldType type) {
324 const DetailInputs& fields = 324 const DetailInputs& fields =
325 controller()->RequestedFieldsForSection(section); 325 controller()->RequestedFieldsForSection(section);
326 for (size_t i = 0; i < fields.size(); ++i) { 326 for (size_t i = 0; i < fields.size(); ++i) {
327 if (type == fields[i].type) 327 if (type == fields[i].type)
328 return true; 328 return true;
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 // Relevant country loaded but revalidation already happened, no further 1664 // Relevant country loaded but revalidation already happened, no further
1665 // validation should occur. 1665 // validation should occur.
1666 controller()->OnAddressValidationRulesLoaded("DE", false); 1666 controller()->OnAddressValidationRulesLoaded("DE", false);
1667 1667
1668 // Cancelling the dialog causes additional validation to see if the user 1668 // Cancelling the dialog causes additional validation to see if the user
1669 // cancelled with invalid fields, so verify and clear here. 1669 // cancelled with invalid fields, so verify and clear here.
1670 testing::Mock::VerifyAndClearExpectations(controller()->GetMockValidator()); 1670 testing::Mock::VerifyAndClearExpectations(controller()->GetMockValidator());
1671 } 1671 }
1672 1672
1673 } // namespace autofill 1673 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698