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

Unified Diff: components/payments/core/test_address_normalizer.cc

Issue 2836353002: [Payments] Normalize shipping address change on Desktop (Closed)
Patch Set: Fixed Deps Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/payments/core/test_address_normalizer.cc
diff --git a/components/payments/core/test_address_normalizer.cc b/components/payments/core/test_address_normalizer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..acb290661a272dc5f38351c11a82e38e1dd45367
--- /dev/null
+++ b/components/payments/core/test_address_normalizer.cc
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/payments/core/test_address_normalizer.h"
+
+namespace payments {
+
+bool TestAddressNormalizer::AreRulesLoadedForRegion(
+ const std::string& region_code) {
+ return true;
+}
+
+void TestAddressNormalizer::StartAddressNormalization(
+ const autofill::AutofillProfile& profile,
+ const std::string& region_code,
+ int timeout_seconds,
+ AddressNormalizer::Delegate* requester) {
+ if (instantaneous_normalization_) {
+ requester->OnAddressNormalized(profile);
+ return;
+ }
+
+ // Setup the necessary variables for the delayed normalization.
+ profile_ = profile;
+ requester_ = requester;
+}
+
+void TestAddressNormalizer::DelayNormalization() {
+ instantaneous_normalization_ = false;
+}
+
+void TestAddressNormalizer::CompleteAddressNormalization() {
+ requester_->OnAddressNormalized(profile_);
+}
+
+} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698