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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java

Issue 2750103005: [Payments] Move journey logger to native. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java
index 6d0324a445013306954579ac0522451d98486e5c..58c7a6bbbcc797c348f9c57afafd77c26e7953da 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java
@@ -13,6 +13,7 @@ import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
+import org.chromium.components.payments.JourneyLogger;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
@@ -58,21 +59,23 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
expectResultContains(new String[] {"Request cancelled"});
// CanMakePayment was queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_USED));
// The CanMakePayment effect on show should be recorded as being false and shown.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.EffetOnShow",
- PaymentRequestJourneyLogger.CMP_SHOW_DID_SHOW));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.EffetOnShow",
+ JourneyLogger.CMP_SHOW_DID_SHOW));
// There should be a record for an abort when CanMakePayment is false but the PR is shown to
// the user.
- assertEquals(
- 1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.FalseWithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_ABORTED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.FalseWithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_ABORTED));
}
/**
@@ -99,21 +102,23 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed);
// CanMakePayment was queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_USED));
// The CanMakePayment effect on show should be recorded as being false and shown.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.EffetOnShow",
- PaymentRequestJourneyLogger.CMP_SHOW_DID_SHOW));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.EffetOnShow",
+ JourneyLogger.CMP_SHOW_DID_SHOW));
// There should be a record for a completion when CanMakePayment is false but the PR is
// shown to the user.
- assertEquals(
- 1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.FalseWithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_COMPLETED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.FalseWithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_COMPLETED));
}
/**
@@ -143,21 +148,24 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
expectResultContains(new String[] {"Request cancelled"});
// CanMakePayment was queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_USED));
// The CanMakePayment effect on show should be recorded as being false and shown.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.EffetOnShow",
- PaymentRequestJourneyLogger.CMP_SHOW_DID_SHOW
- | PaymentRequestJourneyLogger.CMP_SHOW_COULD_MAKE_PAYMENT));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.EffetOnShow",
+ JourneyLogger.CMP_SHOW_DID_SHOW
+ | JourneyLogger.CMP_SHOW_COULD_MAKE_PAYMENT));
// There should be a record for an abort when CanMakePayment is false but the PR is shown to
// the user.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.TrueWithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_ABORTED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.TrueWithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_ABORTED));
}
/**
@@ -177,21 +185,24 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
clickAndWait(R.id.button_primary, mDismissed);
// CanMakePayment was queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_USED));
// The CanMakePayment effect on show should be recorded as being false and shown.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.EffetOnShow",
- PaymentRequestJourneyLogger.CMP_SHOW_DID_SHOW
- | PaymentRequestJourneyLogger.CMP_SHOW_COULD_MAKE_PAYMENT));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.EffetOnShow",
+ JourneyLogger.CMP_SHOW_DID_SHOW
+ | JourneyLogger.CMP_SHOW_COULD_MAKE_PAYMENT));
// There should be a record for an abort when CanMakePayment is false but the PR is shown to
// the user.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Used.TrueWithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_COMPLETED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Used.TrueWithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_COMPLETED));
}
/**
@@ -217,15 +228,17 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
expectResultContains(new String[] {"Request cancelled"});
// CanMakePayment was not queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_NOT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_NOT_USED));
// There should be a record for an abort when CanMakePayment is not called but the PR is
// shown to the user.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.NotUsed.WithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_ABORTED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.NotUsed.WithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_ABORTED));
}
/**
@@ -244,14 +257,16 @@ public class PaymentRequestCanMakePaymentMetricsTest extends PaymentRequestTestB
clickAndWait(R.id.button_primary, mDismissed);
// CanMakePayment was not queried.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.Usage",
- PaymentRequestJourneyLogger.CAN_MAKE_PAYMENT_NOT_USED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.Usage",
+ JourneyLogger.CAN_MAKE_PAYMENT_NOT_USED));
// There should be a record for a completion when CanMakePayment is not called but the PR is
// shown to the user.
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting(
- "PaymentRequest.CanMakePayment.NotUsed.WithShowEffectOnCompletion",
- PaymentRequestJourneyLogger.COMPLETION_STATUS_COMPLETED));
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CanMakePayment.NotUsed.WithShowEffectOnCompletion",
+ JourneyLogger.COMPLETION_STATUS_COMPLETED));
}
}

Powered by Google App Engine
This is Rietveld 408576698