Commit 37ad36f2 authored by nancy's avatar nancy Committed by Commit Bot

Fix All/HostedAppTest.* browser tests.

This CL modify the window pointer for Web apps, and use the top level
window pointer for Chrome only. For Web apps, still use the tab's
window pointer. This fix is used to fix All/HostedAppTest.* browser
tests, because that tests pull the Web apps to Chrome, which cause the
app id changed in AppService InstanceRegistry, so DCHECK crash:
https://ci.chromium.org/p/chromium/builders/try/linux-chromeos-rel/448712
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8894423355073665120/+/steps/non_viz_browser_tests__with_patch_/0/logs/Deterministic_failure:_All__x2f_HostedAppTest.CtrlClickLink__x2f_0__status_CRASH_/0

BUG=1011235

Change-Id: Id308f394c95196d507d164bb2fe5ac2fbeab406b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1957749
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724010}
parent 0a87896c
......@@ -169,7 +169,10 @@ aura::Window* AppServiceInstanceRegistryHelper::GetWindow(
content::WebContents* contents) {
std::string app_id = launcher_controller_helper_->GetAppID(contents);
aura::Window* window = contents->GetNativeView();
if (app_id.empty() || IsWebApp(app_id))
// If |app_id| is empty, it is a browser tab. Returns the toplevel window in
// this case.
if (app_id.empty())
window = window->GetToplevelWindow();
return window;
}
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