Commit a6dcb701 authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

[Payment Request] Enable kWebPaymentsRedactShippingAddress by default.

This change was announced to developers in M76. This patch will ship it in M78.

Spec: https://w3c.github.io/payment-request/#shipping-address-changed-algorithm
Intent to ship and implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/69dw-4Myc_A
Chrome Status entry: https://chromestatus.com/features/5653566570102784

Bug: 821771
Change-Id: Idedf89cc868e7b98ff00ef649d898458c3edbe49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1741296Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685250}
parent 3be69878
...@@ -12,10 +12,8 @@ import org.junit.Test; ...@@ -12,10 +12,8 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.autofill.AutofillTestHelper; import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.CardType; import org.chromium.chrome.browser.autofill.CardType;
...@@ -53,31 +51,6 @@ public class PaymentRequestShippingAddressChangeTest implements MainActivityStar ...@@ -53,31 +51,6 @@ public class PaymentRequestShippingAddressChangeTest implements MainActivityStar
CardType.UNKNOWN, billingAddressId, "" /* serverId */)); CardType.UNKNOWN, billingAddressId, "" /* serverId */));
} }
/**
* Tests the format of the shipping address that is sent to the merchant when the user changes
* the shipping address selection.
*/
@Test
@MediumTest
@Feature({"Payments"})
@DisabledTest(message = "https://crbug.com/894011")
@CommandLineFlags.
Add({"disable-features=" + ChromeFeatureList.WEB_PAYMENTS_REDACT_SHIPPING_ADDRESS})
public void testShippingAddressChangeFormat() throws InterruptedException, TimeoutException {
// Select a shipping address and cancel out.
mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getReadyForInput());
mPaymentRequestTestRule.clickInShippingAddressAndWait(
R.id.payments_section, mPaymentRequestTestRule.getReadyForInput());
mPaymentRequestTestRule.clickOnShippingAddressSuggestionOptionAndWait(
0, mPaymentRequestTestRule.getReadyForInput());
mPaymentRequestTestRule.clickAndWait(
R.id.close_button, mPaymentRequestTestRule.getDismissed());
// The phone number should be formatted to the internation format.
mPaymentRequestTestRule.expectResultContains(new String[] {"Jon Doe", "Google",
"340 Main St", "CA", "Los Angeles", "90291", "+16502530000", "US"});
}
/** /**
* Tests that only redacted shipping address is sent to the merchant when the user changes the * Tests that only redacted shipping address is sent to the merchant when the user changes the
* shipping address selection. * shipping address selection.
...@@ -85,8 +58,6 @@ public class PaymentRequestShippingAddressChangeTest implements MainActivityStar ...@@ -85,8 +58,6 @@ public class PaymentRequestShippingAddressChangeTest implements MainActivityStar
@Test @Test
@MediumTest @MediumTest
@Feature({"Payments"}) @Feature({"Payments"})
@CommandLineFlags.
Add({"enable-features=" + ChromeFeatureList.WEB_PAYMENTS_REDACT_SHIPPING_ADDRESS})
public void testAddressRedactionInShippingAddressChange() public void testAddressRedactionInShippingAddressChange()
throws InterruptedException, TimeoutException { throws InterruptedException, TimeoutException {
// Select a shipping address and cancel out. // Select a shipping address and cancel out.
......
...@@ -42,7 +42,7 @@ const base::Feature kWebPaymentsPerMethodCanMakePaymentQuota{ ...@@ -42,7 +42,7 @@ const base::Feature kWebPaymentsPerMethodCanMakePaymentQuota{
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kWebPaymentsRedactShippingAddress{ const base::Feature kWebPaymentsRedactShippingAddress{
"WebPaymentsRedactShippingAddress", base::FEATURE_DISABLED_BY_DEFAULT}; "WebPaymentsRedactShippingAddress", base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features } // namespace features
} // namespace payments } // namespace payments
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment