bool SimulateKeyPress(ui::KeyboardCode key) {
return ui_test_utils::SendKeyPressToWindowSync(
- GetFirstShellWindow()->GetNativeWindow(),
- key,
- false,
- false,
- false,
- false);
+ GetFirstAppWindow()->GetNativeWindow(),
+ key,
+ false,
+ false,
+ false,
+ false);
}
// This method will wait until the application is able to ack a key event.
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
- GetFirstShellWindow()->GetNativeWindow()));
+ GetFirstAppWindow()->GetNativeWindow()));
// When receiving the reply, the application will try to go fullscreen using
// the Window API but there is no synchronous way to know if that actually
// succeeded. Also, failure will not be notified. A failure case will only be
// known with a timeout.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
launched_listener.Reply("window");
// Same idea as above but for leaving fullscreen. Fullscreen mode should be
// left when ESC is received.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
ASSERT_TRUE(SimulateKeyPress(ui::VKEY_ESCAPE));
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
- GetFirstShellWindow()->GetNativeWindow()));
+ GetFirstAppWindow()->GetNativeWindow()));
launched_listener.Reply("dom");
// actually succeeded. Also, failure will not be notified. A failure case will
// only be known with a timeout.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
WaitUntilKeyFocus();
ASSERT_TRUE(SimulateKeyPress(ui::VKEY_A));
// Same idea as above but for leaving fullscreen. Fullscreen mode should be
// left when ESC is received.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
ASSERT_TRUE(SimulateKeyPress(ui::VKEY_ESCAPE));
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
- GetFirstShellWindow()->GetNativeWindow()));
+ GetFirstAppWindow()->GetNativeWindow()));
// When receiving the reply, the application will try to go fullscreen using
// the Window API but there is no synchronous way to know if that actually
// succeeded. Also, failure will not be notified. A failure case will only be
// known with a timeout.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
launched_listener.Reply("window");
// However, by nature, we can not guarantee that and given that we do test
// that nothing happens, we might end up with random-success when the feature
// is broken.
- EXPECT_TRUE(GetFirstShellWindow()->GetBaseWindow()->IsFullscreen());
+ EXPECT_TRUE(GetFirstAppWindow()->GetBaseWindow()->IsFullscreen());
}
IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest,
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
- GetFirstShellWindow()->GetNativeWindow()));
+ GetFirstAppWindow()->GetNativeWindow()));
launched_listener.Reply("dom");
// actually succeeded. Also, failure will not be notified. A failure case will
// only be known with a timeout.
{
- FullscreenChangeWaiter fs_changed(GetFirstShellWindow()->GetBaseWindow());
+ FullscreenChangeWaiter fs_changed(GetFirstAppWindow()->GetBaseWindow());
WaitUntilKeyFocus();
ASSERT_TRUE(SimulateKeyPress(ui::VKEY_A));
// However, by nature, we can not guarantee that and given that we do test
// that nothing happens, we might end up with random-success when the feature
// is broken.
- EXPECT_TRUE(GetFirstShellWindow()->GetBaseWindow()->IsFullscreen());
+ EXPECT_TRUE(GetFirstAppWindow()->GetBaseWindow()->IsFullscreen());
}
// This test does not work on Linux Aura because ShowInactive() is not