New issue
Advanced search Search tips

Issue 906906 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 18
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 905430



Sign in to add a comment

SingleProcessMash: LockScreenAppStateTest failing

Project Member Reported by est...@chromium.org, Nov 20

Issue description

After a couple fixes for other issues (lack of InputDeviceManager), the test fails with the following output, which seems to indicate the web content's aura::Window is created with Env::GetInstance(), whereas the app window that's hosting it is created with the shell's aura_env().


[255703:255703:1119/185138.896609:608836943760:FATAL:window.cc(393)] Check failed: env_ == child->env_ (0x9cf672f2680 vs. 0x9cf67247b80)All windows in a hierarchy must share the  same Env.
#0 0x7f7ac457b12f base::debug::StackTrace::StackTrace()
#1 0x7f7ac44aa86b logging::LogMessage::~LogMessage()
#2 0x7f7ac086fbb0 aura::Window::AddChild()
#3 0x7f7ac4817058 views::internal::NativeWidgetPrivate::ReparentNativeView()
#4 0x7f7ac4807abf views::NativeViewHostAura::AttachNativeView()
#5 0x7f7ac47a8c7d views::NativeViewHost::Attach()
#6 0x7f7abdd0e499 views::WebView::AttachWebContents()
#7 0x7f7abdd0de1c views::WebView::SetWebContents()
#8 0x7f7ac47e6048 views::View::PropagateAddNotifications()
#9 0x7f7ac47e50b8 views::View::AddChildViewAt()
#10 0x7f7ac47fb8c4 views::ClientView::ViewHierarchyChanged()
#11 0x7f7ac47e6048 views::View::PropagateAddNotifications()
#12 0x7f7ac47e50b8 views::View::AddChildViewAt()
#13 0x7f7ac48029cd views::NonClientView::ViewHierarchyChanged()
#14 0x7f7ac47e6048 views::View::PropagateAddNotifications()
#15 0x7f7ac47e50b8 views::View::AddChildViewAt()
#16 0x7f7ac47f1dea views::internal::RootView::SetContentsView()
#17 0x7f7ac47f553b views::Widget::Init()
#18 0x559ae0c645fd ChromeNativeAppWindowViews::InitializeDefaultWindow()
#19 0x559ae0c653d2 ChromeNativeAppWindowViews::InitializeWindow()
#20 0x559ae0c27752 ChromeNativeAppWindowViewsAuraAsh::InitializeWindow()
#21 0x559ae0e2c27b native_app_window::NativeAppWindowViews::Init()
#22 0x559ae0b50d53 ChromeAppWindowClient::CreateNativeAppWindowImpl()
#23 0x559ade41d49d extensions::AppWindow::Init()
#24 0x559addf19750 (anonymous namespace)::TestAppWindow::Initialize()
#25 0x559addf18e90 LockScreenAppStateTest_AppWindowRegistration_Test::TestBody()
#26 0x559ade2f8611 testing::Test::Run()
#27 0x559ade2f925f testing::TestInfo::Run()
#28 0x559ade2f9787 testing::TestCase::Run()
#29 0x559ade305af7 testing::internal::UnitTestImpl::RunAllTests()
#30 0x559ade30566d testing::UnitTest::Run()
#31 0x559adf2e8661 base::TestSuite::Run()
#32 0x559adf2ea79d base::(anonymous namespace)::LaunchUnitTestsInternal()
#33 0x559adf2ea601 base::LaunchUnitTests()
#34 0x559adf2dda0f main
#35 0x7f7ab77a42b1 __libc_start_main
#36 0x559adc4b5afa _start
 
Labels: -Pri-3 Proj-Mash-SingleProcess Pri-2
AshTestViewsDelegate is setting the context to Shell::GetRootWindowForNewWindows(), from which the env is taken, and that doesn't match Env::GetInstance().

Also of note: BrowserViewTest crashes. The commonality is that both unit tests exercise production code that creates a Widget (as opposed to creating the widget directly in the test).
Blocking: 905430
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 30

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

commit 7591cbc49bf6e29303c6560d42ed53cb9423b9bb
Author: Evan Stade <estade@chromium.org>
Date: Fri Nov 30 06:54:29 2018

Bring up more unit_tests for single process Mash.

BrowserWithTestWindowTest now creates a MusClient, which is important for its native widget factory.

AshTestViewsDelegate doesn't set the context on context/parentless widgets for Mash, since DesktopNativeWidgetAura doesn't require that and it interferes with getting the correct aura::Env. Using Shell's Env is problematic because the aura::Window for a WebContents wants to use aura::Env::GetInstance, which differs from the shell's Env.

WebContentsViewAura uses the Env of its context for the aura::Window it creates, if there is a context.

Also, spot fixes for:
1. LockScreenAppStateTest
2. ChromeLauncherControllerTest
3. ImmersiveModeControllerAshTest (some of these pass, a couple still
   fail, but none should crash)
4. TabStripTest
5. BookmarkBarViewTest

Bug:  906906 , 905430 
Change-Id: I19ce303a0cad91262c1a393379ecd5c9d2bf75fb
Reviewed-on: https://chromium-review.googlesource.com/c/1351884
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612587}
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/ash/test/ash_test_views_delegate.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/browser/chromeos/lock_screen_apps/state_controller_unittest.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/browser/ui/views/tabs/tab_strip_unittest.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/test/base/browser_with_test_window_test.cc
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/chrome/test/base/browser_with_test_window_test.h
[modify] https://crrev.com/7591cbc49bf6e29303c6560d42ed53cb9423b9bb/content/browser/web_contents/web_contents_view_aura.cc

I haven't seen this issue while testing  issue 914823 , I think the CL above may have fixed it so this can be closed now?

Status: Fixed (was: Assigned)

Sign in to add a comment