Backed out changeset 8a29a154e88d (bug 1435155) for browser chrome leakchecks (APZEventState, ActiveElementManager, Array, AsyncFreeSnowWhite, AsyncLatencyLogger, ...) on a CLOSED TREE

This commit is contained in:
Andreea Pavel 2018-03-07 18:19:29 +02:00
Родитель e4f04ff4cc
Коммит dc797492f3
4 изменённых файлов: 11 добавлений и 42 удалений

Просмотреть файл

@ -743,14 +743,9 @@ PaymentRequest::RespondShowPayment(const nsAString& aMethodName,
return;
}
// When the user agent has opted to redact the shipping address
// in earlier steps, the spec doesn't update the request with
// the unredacted address at this point. Maybe, to reduce the
// number of footguns, it should (without an event).
RefPtr<PaymentResponse> paymentResponse =
new PaymentResponse(GetOwner(), mInternalId, mId, aMethodName,
mShippingOption, mFullShippingAddress, aDetails,
mShippingOption, mShippingAddress, aDetails,
aPayerName, aPayerEmail, aPayerPhone);
mResponse = paymentResponse;
mAcceptPromise->MaybeResolve(paymentResponse);
@ -945,15 +940,11 @@ PaymentRequest::UpdateShippingAddress(const nsAString& aCountry,
const nsAString& aRecipient,
const nsAString& aPhone)
{
nsTArray<nsString> emptyArray;
mShippingAddress = new PaymentAddress(GetOwner(), aCountry, emptyArray,
mShippingAddress = new PaymentAddress(GetOwner(), aCountry, aAddressLine,
aRegion, aCity, aDependentLocality,
aPostalCode, aSortingCode, aLanguageCode,
EmptyString(), EmptyString(), EmptyString());
mFullShippingAddress = new PaymentAddress(GetOwner(), aCountry, aAddressLine,
aRegion, aCity, aDependentLocality,
aPostalCode, aSortingCode, aLanguageCode,
aOrganization, aRecipient, aPhone);
aOrganization, aRecipient, aPhone);
// Fire shippingaddresschange event
return DispatchUpdateEvent(NS_LITERAL_STRING("shippingaddresschange"));
}

Просмотреть файл

@ -161,10 +161,8 @@ protected:
RefPtr<Promise> mAbortPromise;
// Resolve mAcceptPromise with mResponse if user accepts the request.
RefPtr<PaymentResponse> mResponse;
// The redacted shipping address.
// It is populated when the user provides a shipping address.
RefPtr<PaymentAddress> mShippingAddress;
// The full shipping address to be used in the response upon payment.
RefPtr<PaymentAddress> mFullShippingAddress;
// It is populated when the user chooses a shipping option.
nsString mShippingOption;

Просмотреть файл

@ -21,11 +21,11 @@ shippingAddress.init("USA", // country
addressLine, // address line
"CA", // region
"San Bruno", // city
"Test locality", // dependent locality
"", // dependent locality
"94066", // postal code
"123456", // sorting code
"en", // language code
"Testing Org", // organization
"", // organization
"Bill A. Pacheco", // recipient
"+1-434-441-3879"); // phone

Просмотреть файл

@ -23,7 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345366
const defaultMethods = [{
supportedMethods: "basic-card",
data: {
data: {
supportedNetworks: ['unionpay', 'visa', 'mastercard', 'amex', 'discover',
'diners', 'jcb', 'mir',
],
@ -160,16 +160,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345366
return new Promise((resolve, reject) => {
const payRequest = new PaymentRequest(defaultMethods, defaultDetails, defaultOptions);
payRequest.addEventListener("shippingaddresschange", event => {
is(payRequest.shippingAddress.country, "USA", "payRequest.shippingAddress.country should be 'USA' from event.");
is(payRequest.shippingAddress.addressLine.length, 0, "payRequest.shippingAddress.addressLine.length should be 0 from event.");
is(payRequest.shippingAddress.region, "CA", "payRequest.shippingAddress.region should be 'CA' from event.");
is(payRequest.shippingAddress.city, "San Bruno", "payRequest.shippingAddress.city should be 'San Bruno' from event.");
is(payRequest.shippingAddress.dependentLocality, "Test locality", "payRequest.shippingAddress.dependentLocality should be 'Test locality' from event.");
is(payRequest.shippingAddress.postalCode, "94066", "payRequest.shippingAddress.postalCode should be '94066' from event.");
is(payRequest.shippingAddress.sortingCode, "123456", "payRequest.shippingAddress.sortingCode should be '123456' from event.");
is(payRequest.shippingAddress.organization, "", "payRequest.shippingAddress.organization should be empty from event.");
is(payRequest.shippingAddress.recipient, "", "payRequest.shippingAddress.recipient should be empty from event.");
is(payRequest.shippingAddress.phone, "", "payRequest.shippingAddress.phone should be empty from event.");
event.updateWith(updateWithShippingAddress());
});
payRequest.addEventListener("shippingoptionchange", event => {
@ -184,26 +174,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345366
is(response.shippingAddress.addressLine[0], "Easton Ave", "response.shippingAddress.addressLine[0] should be 'Easton Ave'.");
is(response.shippingAddress.region, "CA", "response.shippingAddress.region should be 'CA'.");
is(response.shippingAddress.city, "San Bruno", "response.shippingAddress.city should be 'San Bruno'.");
is(response.shippingAddress.dependentLocality, "Test locality", "response.shippingAddress.dependentLocality should be 'Test locality'.");
is(response.shippingAddress.dependentLocality, "", "response.shippingAddress.dependentLocality should be empty.");
is(response.shippingAddress.postalCode, "94066", "response.shippingAddress.postalCode should be '94066'.");
is(response.shippingAddress.sortingCode, "123456", "response.shippingAddress.sortingCode should be '123456'.");
is(response.shippingAddress.organization, "Testing Org", "response.shippingAddress.organization should be 'Testing Org'.");
is(response.shippingAddress.organization, "", "response.shippingAddress.organization should be empty.");
is(response.shippingAddress.recipient, "Bill A. Pacheco", "response.shippingAddress.recipient should be 'Bill A. Pacheco'.");
is(response.shippingAddress.phone, "+1-434-441-3879", "response.shippingAddress.phone should be '+1-434-441-3879'.");
is(response.shippingOption, "FastShipping", "response.shippingOption should be 'FastShipping'.");
is(response.payerName, "Bill A. Pacheco", "response.payerName should be 'Bill A. Pacheco'.");
ok(!response.payerEmail, "response.payerEmail should be empty");
ok(!response.payerEamil, "response.payerEmail should be empty");
ok(!response.payerPhone, "response.payerPhone should be empty");
is(payRequest.shippingAddress.country, "USA", "payRequest.shippingAddress.country should be 'USA' from promise.");
is(payRequest.shippingAddress.addressLine.length, 0, "payRequest.shippingAddress.addressLine.length should be 0 from promise.");
is(payRequest.shippingAddress.region, "CA", "payRequest.shippingAddress.region should be 'CA' from promise.");
is(payRequest.shippingAddress.city, "San Bruno", "payRequest.shippingAddress.city should be 'San Bruno' from promise.");
is(payRequest.shippingAddress.dependentLocality, "Test locality", "payRequest.shippingAddress.dependentLocality should be 'Test locality' from promise.");
is(payRequest.shippingAddress.postalCode, "94066", "payRequest.shippingAddress.postalCode should be '94066' from promise.");
is(payRequest.shippingAddress.sortingCode, "123456", "payRequest.shippingAddress.sortingCode should be '123456' from promise.");
is(payRequest.shippingAddress.organization, "", "payRequest.shippingAddress.organization should be empty from promise.");
is(payRequest.shippingAddress.recipient, "", "payRequest.shippingAddress.recipient should be empty from promise.");
is(payRequest.shippingAddress.phone, "", "payRequest.shippingAddress.phone should be empty from promise.");
response.complete("success").then(() =>{
resolve();
}).catch(e => {