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

[Nav Experiment] Fix PaymentRequestJourneyLoggerEGTest expectations.

Current expectations assume a buggy behavior of LegacyNavigationManager,
which doesn't create a pending item on reload (crbug.com/676129). The
test initiates a navigation to the same page to abort the payment
request. This navigation is incorrectly classified as renderer-initiated
by LegacyNavigationManager, which causes the abort reason for payment
request to be incorrectly logged as EVENT_OTHER_ABORTED.

WKBasedNavigationManager fixes this bug, so the test should now check
EVENT_USER_ABORTED.

Bug: 874628
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I74997df64464f196cfcfb34f21b0252d2f2f6e3e
Reviewed-on: https://chromium-review.googlesource.com/1176470
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583648}
parent c7f43ffd
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "ios/chrome/test/app/histogram_test_util.h" #import "ios/chrome/test/app/histogram_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/web/public/web_client.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -777,8 +778,19 @@ using payments::JourneyLogger; ...@@ -777,8 +778,19 @@ using payments::JourneyLogger;
buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @""); buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @""); // TODO(crbug.com/676129): LegacyNavigationManager has a bug that doesn't
// create a pending item when reloading the page. This is incorrectly causing
// the second navigation above to be considered a renderer-initiated
// navigation, and the abort reason is incorrectly logged as
// EVENT_OTHER_ABORTED.
if (!web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
} else {
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
}
GREYAssertTrue( GREYAssertTrue(
buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @""); buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @"");
GREYAssertTrue( GREYAssertTrue(
...@@ -828,8 +840,18 @@ using payments::JourneyLogger; ...@@ -828,8 +840,18 @@ using payments::JourneyLogger;
buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @""); buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @""); // TODO(crbug.com/676129): LegacyNavigationManager has a bug that doesn't
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @""); // create a pending item when reloading the page. This is incorrectly causing
// the second navigation above to be considered a renderer-initiated
// navigation, and the abort reason is incorrectly logged as
// EVENT_OTHER_ABORTED.
if (!web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
} else {
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
}
GREYAssertFalse( GREYAssertFalse(
buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @""); buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @"");
GREYAssertFalse( GREYAssertFalse(
...@@ -880,8 +902,18 @@ using payments::JourneyLogger; ...@@ -880,8 +902,18 @@ using payments::JourneyLogger;
buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @""); buckets[0].min & JourneyLogger::EVENT_RECEIVED_INSTRUMENT_DETAILS, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_SKIPPED_SHOW, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @""); GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_COMPLETED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @""); // TODO(crbug.com/676129): LegacyNavigationManager has a bug that doesn't
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @""); // create a pending item when reloading the page. This is incorrectly causing
// the second navigation above to be considered a renderer-initiated
// navigation, and the abort reason is incorrectly logged as
// EVENT_OTHER_ABORTED.
if (!web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
} else {
GREYAssertTrue(buckets[0].min & JourneyLogger::EVENT_USER_ABORTED, @"");
GREYAssertFalse(buckets[0].min & JourneyLogger::EVENT_OTHER_ABORTED, @"");
}
GREYAssertFalse( GREYAssertFalse(
buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @""); buckets[0].min & JourneyLogger::EVENT_HAD_INITIAL_FORM_OF_PAYMENT, @"");
GREYAssertFalse( GREYAssertFalse(
......
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