Commit 786e5527 authored by Olivier Robin's avatar Olivier Robin Committed by Chromium LUCI CQ

Fix WebStateTest.CallLoadURLWithParamsDuringSessionRestore test

It is possible that the committed URL is still the placeholder
URL in case of a restoration of when loading an offline page.
In that case, the domain check must extract the real URL from the
placeholder.

Bug: 1067733
Change-Id: Ieceaa41bc83ce519c2ef1920c3ff59d2e4f15ea3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2632964
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845117}
parent db967c59
...@@ -977,8 +977,13 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*); ...@@ -977,8 +977,13 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
GURL documentOrigin = newURL.GetOrigin(); GURL documentOrigin = newURL.GetOrigin();
web::NavigationItem* committedItem = web::NavigationItem* committedItem =
self.webStateImpl->GetNavigationManager()->GetLastCommittedItem(); self.webStateImpl->GetNavigationManager()->GetLastCommittedItem();
GURL committedOrigin = GURL committedURL =
committedItem ? committedItem->GetURL().GetOrigin() : GURL::EmptyGURL(); committedItem ? committedItem->GetURL() : GURL::EmptyGURL();
if (!base::FeatureList::IsEnabled(web::features::kUseJSForErrorPage) &&
IsPlaceholderUrl(committedURL)) {
committedURL = ExtractUrlFromPlaceholderUrl(committedURL);
}
GURL committedOrigin = committedURL.GetOrigin();
DCHECK_EQ(documentOrigin, committedOrigin) DCHECK_EQ(documentOrigin, committedOrigin)
<< "Old and new URL detection system have a mismatch"; << "Old and new URL detection system have a mismatch";
......
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