New issue
Advanced search Search tips

Issue 874637 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug-Regression
M70

Blocking:
issue 807428



Sign in to add a comment

PaymentRequestMiscellaneousEGTest fails with slim-navigation-manager

Project Member Reported by danyao@chromium.org, Aug 15

Issue description

Failing test with --enable-features=SlimNavigationManager:

PaymentRequestMiscellaneousEGTest/testMultipleRequests
 
Failure message:
../../ios/chrome/browser/ui/payments/payment_request_misc_egtest.mm:43: error: -[PaymentRequestMiscellaneousEGTest testMultipleRequests] : Exception: AssertionFailedException
Exception Name: AssertionFailedException
Exception Reason: ((5U) == ((payment_requests.size()))) failed
Exception Details: Cannot create multiple PaymentRequest objects.

This test loads https://components/test/data/payments/payment_request_multiple_requests.html and expects to get multiple JavaScript messages from the web view that should trigger PaymentRequestCache::AddPaymentRequest().

When slim-navigation-manager is used, somehow there is a window ID mismatch in CRWWebController's |respondToWKScriptMessage|. This causes the JavaScript messages from the web view to be ignored. So payment_requests.size() is 0 when it's expected to be 5.

Relevant code from CRWWebController:

if (base::SysNSStringToUTF8([_windowIDJSManager windowID]) != windowID) {
  DLOG(WARNING) << "Message from JS ignored due to non-matching windowID: " <<
      [_windowIDJSManager windowID]
          << " != " << base::SysUTF8ToNSString(windowID);
  return NO;
}
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e6c24877edcb59c340d0e18f84e4edda13bd99bc

commit e6c24877edcb59c340d0e18f84e4edda13bd99bc
Author: Danyao Wang <danyao@chromium.org>
Date: Mon Aug 20 13:23:23 2018

[Nav Experiment] Skip window ID injection for placeholder URLs.

gCrWeb is not injected for placeholder URLs, so CRWJSWindowIDManager
ends up repeatedly injecting window ID for NTPs, which interferes with
injected JavaScript for the next web page.

This fixes PaymentRequestMiscellaneousEGTest/testMultipleRequests. It
was failing because the payment request messages were ignored due to
mismatched window ID.

Bug:  874637 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I9a4f95d8f2f767c27a0c8dd953bb0d9914b6c0ed
Reviewed-on: https://chromium-review.googlesource.com/1179221
Reviewed-by: Eugene But <eugenebut@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584421}
[modify] https://crrev.com/e6c24877edcb59c340d0e18f84e4edda13bd99bc/ios/web/web_state/ui/crw_web_controller.mm

Status: Fixed (was: Assigned)

Sign in to add a comment