New issue
Advanced search Search tips

Issue 890385 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug-Regression



Sign in to add a comment

NavigationTestCase/testRestoreHistoryToNTPAndNavigateForward fails with WKBasedNavigationManager

Project Member Reported by danyao@chromium.org, Sep 28

Issue description

NavigationTestCase/testRestoreHistoryToNTPAndNavigateForward fails with --enable-features=SlimNavigationManager flag.

This is a regression between db12d8e7e13fed17677f55e32dc5a26622f4e49c and 51865f3e78c5d0b7dbbee2d563e3cb1a4d7222c3.

Stacktrace:
NavigationTestCase/testRestoreHistoryToNTPAndNavigateForward:
  [0927/142026.877512:WARNING:embedded_test_server.cc(239)] Request not handled. Returning 404: /favicon.ico
  [0927/142028.899438:FATAL:tab.mm(351)] Check failed: self.navigationManager->CanGoForward().
  0   ios_chrome_web_egtests              0x0000000111cc441d base::debug::StackTrace::StackTrace(unsigned long) + 157
  1   ios_chrome_web_egtests              0x0000000111cc445d base::debug::StackTrace::StackTrace(unsigned long) + 29
  2   ios_chrome_web_egtests              0x0000000111997e9a base::debug::StackTrace::StackTrace() + 26
  3   ios_chrome_web_egtests              0x00000001119ddebd logging::LogMessage::~LogMessage() + 461
  4   ios_chrome_web_egtests              0x00000001119dbb65 logging::LogMessage::~LogMessage() + 21
  5   ios_chrome_web_egtests              0x0000000111854664 -[Tab goForward] + 292
  6   ios_chrome_web_egtests              0x000000011153be2d -[BrowserViewController goForward] + 93
  7   ios_chrome_web_egtests              0x000000011193f522 +[ChromeEarlGrey goForward] + 66
  8   ios_chrome_web_egtests              0x000000010f4cb370 -[NavigationTestCase testRestoreHistoryToNTPAndNavigateForward] + 4720
 
Components: UI>Browser>Navigation
This test is failing because PurgeCachedWebViewPages() returned before the navigation manager finished restoring session. So when NavigationManager::CanGoForward() is called, |is_restore_session_in_progress_| is still true.
I prototyped a fix by waiting for the native controller of NTP to show up before calling |goForward|: https://chromium-review.googlesource.com/c/chromium/src/+/1252850

This fixes the test which shows that this is indeed a timing issue. But it's not a great fix because the chrome_test_util::WaitForPageToFinishLoading() in PurgeCachedWebViewPages() should have been sufficient.

I'll look more.
I wonder if the load ever starts and finishes inside PurgeCachedWebViewPages?
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 2

This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone.

All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-72
Labels: Proj-WKBackForwardListTestFailures
Status: Started (was: Assigned)
Re Comment #4: Actually no. PurgeCachedWebViewPages() returns before loading starts with slim nav. I think because slim nav restores history via a web view load, the loading event starts (and stops) in the next run loop cycle. In comparison, the start loading event for LegacyNavigationManager happens in the same run loop cycle, because the load is a native load.

Perhaps we should always spin the run loop once in chrome_test_util::WaitForPageToFinishLoading().
Labels: -ReleaseBlock-Stable -M-72
Project Member

Comment 11 by bugdroid1@chromium.org, Nov 2

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

commit 90cb72b610ecd6467bc1f565b7bdfb8b76aa2826
Author: Danyao Wang <danyao@google.com>
Date: Fri Nov 02 23:27:38 2018

[Nav Experiment] Support async loading in PurgeCachedWebViewPages().

PurgeCachedWebViews() restores session history and wait for the first
navigation after restore to stop loading before returning. However, if
the first loading event happens asynchronously in the web view,
PurgeCachedWebViews() would return before session restore is finished.
This CL changes it to wait for the navigation finish event to handle
this situation.

This fixes NavigationTestCase//testRestoreHistoryToNTPAndNavigateForward
when #slim-navigation-manager is used.

Bug:  890385 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I86913ed64ac0c6982fae48b71f0561f071b4db30
Reviewed-on: https://chromium-review.googlesource.com/c/1252850
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605091}
[modify] https://crrev.com/90cb72b610ecd6467bc1f565b7bdfb8b76aa2826/ios/chrome/test/app/chrome_test_util.mm

Status: Fixed (was: Started)

Sign in to add a comment