commit | 15d60b1371a8e405891f25a3db2b2ae0a004b034 | [log] [tgz] |
---|---|---|
author | Charles Reis <[email protected]> | Fri Nov 03 17:43:47 2017 |
committer | Commit Bot <[email protected]> | Fri Nov 03 17:43:47 2017 |
tree | 897bfd4d461959f68ed6edd7127b4d8ae7f6f2dc | |
parent | 60ceadfbf73da2c341f0c4cf7e2a5766d4a55895 [diff] [blame] |
Rewrite flaky CancelBeforeUnloadResetsURL test and update fix. We can invalidate the URL in the address bar without waiting for the beforeunload ACK from the renderer, making the test easier to write. We're keeping the invalidation in DidCancelLoading after the ACK as well, since it's not clear whether that's safe to remove. Also, the test can be implemented in content/ rather than chrome/. BUG=739773 TEST=No behavior change, new test stays green. Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: I66450965b5a8ac517211194590f47044d6ab50d3 Reviewed-on: https://chromium-review.googlesource.com/750330 Reviewed-by: Nate Chapin <[email protected]> Reviewed-by: Scott Violet <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Commit-Queue: Charlie Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#513826}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 32d969bd..41839f8 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5696,6 +5696,9 @@ controller_.DiscardNonCommittedEntries(); } + // Update the URL display either way, to avoid showing a stale URL. + NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); + for (auto& observer : observers_) observer.BeforeUnloadDialogCancelled(); }