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

Side by Side Diff: chrome/browser/ui/autofill/mock_address_validator.h

Issue 389733002: Reland "Use upstream libaddressinput in Chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GN build. Created 6 years, 5 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
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/browser/ui/webui/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre ss_data.h" 10 #include "third_party/libaddressinput/chromium/chrome_address_validator.h"
11 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre ss_validator.h" 11 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da ta.h"
12 12
13 namespace autofill { 13 namespace autofill {
14 14
15 MATCHER_P(CountryCodeMatcher, country_code, "Checks an AddressData's country") { 15 MATCHER_P(CountryCodeMatcher, country_code, "Checks an AddressData's country") {
16 // |arg| is an AddressData object. 16 // |arg| is an AddressData object.
17 return arg.region_code == country_code; 17 return arg.region_code == country_code;
18 } 18 }
19 19
20 class MockAddressValidator : public ::i18n::addressinput::AddressValidator { 20 class MockAddressValidator : public AddressValidator {
21 public: 21 public:
22 MockAddressValidator(); 22 MockAddressValidator();
23 virtual ~MockAddressValidator(); 23 virtual ~MockAddressValidator();
24 24
25 MOCK_METHOD1(LoadRules, void(const std::string& country_code)); 25 MOCK_METHOD1(LoadRules, void(const std::string& country_code));
26 26
27 MOCK_CONST_METHOD3(ValidateAddress, 27 MOCK_CONST_METHOD3(ValidateAddress,
28 ::i18n::addressinput::AddressValidator::Status( 28 AddressValidator::Status(
29 const ::i18n::addressinput::AddressData& address, 29 const ::i18n::addressinput::AddressData& address,
30 const ::i18n::addressinput::AddressProblemFilter& filter, 30 const ::i18n::addressinput::FieldProblemMap* filter,
31 ::i18n::addressinput::AddressProblems* problems)); 31 ::i18n::addressinput::FieldProblemMap* problems));
32 32
33 MOCK_CONST_METHOD4(GetSuggestions, 33 MOCK_CONST_METHOD4(GetSuggestions,
34 ::i18n::addressinput::AddressValidator::Status( 34 AddressValidator::Status(
35 const ::i18n::addressinput::AddressData& user_input, 35 const ::i18n::addressinput::AddressData& user_input,
36 ::i18n::addressinput::AddressField focused_field, 36 ::i18n::addressinput::AddressField focused_field,
37 size_t suggestions_limit, 37 size_t suggestions_limit,
38 std::vector< ::i18n::addressinput::AddressData>* suggestions)); 38 std::vector< ::i18n::addressinput::AddressData>* suggestions));
39 39
40 MOCK_CONST_METHOD1(CanonicalizeAdministrativeArea, 40 MOCK_CONST_METHOD1(CanonicalizeAdministrativeArea,
41 bool(::i18n::addressinput::AddressData* address_data)); 41 bool(::i18n::addressinput::AddressData* address_data));
42 42
43 private: 43 private:
44 DISALLOW_COPY_AND_ASSIGN(MockAddressValidator); 44 DISALLOW_COPY_AND_ASSIGN(MockAddressValidator);
45 }; 45 };
46 46
47 } // namespace autofill 47 } // namespace autofill
48 48
49 #endif // CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_ 49 #endif // CHROME_BROWSER_UI_AUTOFILL_MOCK_ADDRESS_VALIDATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/browser/ui/webui/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698