Commit 974e90b0 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Fix and enable ash browser test

BrowserNonClientFrameViewAshTest.HeaderVisibilityInOverviewAndSplitview

This test was disabled due to flake (classic Ash), which I can't repro
now. But while it was disabled, it quit passing because some updates
to the test broke it, and because the home launcher now means that
tablet mode affects the visibility of caption buttons. This fixes the
test for all configurations including multi process Mash.

Bug: 818170
Change-Id: Ia0a029f52872b84f6ce6d37c1e433719c243eb56
Reviewed-on: https://chromium-review.googlesource.com/c/1327529Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609831}
parent 7af43291
......@@ -16,11 +16,14 @@ interface ShellTestApi {
// controller. In tablet mode, enables the virtual keyboard.
EnableVirtualKeyboard() => ();
// Tells the SplitViewController to snap the given window to the left.
// The client name is used to find the client's WindowTree.
SnapWindowInSplitView(string client_name, uint64 window_id) => ();
// Tells the SplitViewController to snap the given window to the left or
// right. The client name is used to find the client's WindowTree.
SnapWindowInSplitView(string client_name, uint64 window_id, bool left) => ();
// Fullscreens the active window, as if the user had pressed the hardware
// fullscreen button.
ToggleFullscreen() => ();
// Enters or exits overview mode.
ToggleOverviewMode() => ();
};
......@@ -11,6 +11,7 @@
#include "ash/shell.h"
#include "ash/system/power/backlights_forced_off_setter.h"
#include "ash/system/power/power_button_controller.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/splitview/split_view_controller.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/ws/window_service_owner.h"
......@@ -88,6 +89,7 @@ void ShellTestApi::EnableVirtualKeyboard(EnableVirtualKeyboardCallback cb) {
void ShellTestApi::SnapWindowInSplitView(const std::string& client_name,
ws::Id window_id,
bool left,
SnapWindowInSplitViewCallback cb) {
auto* window_service = shell_->window_service_owner()->window_service();
aura::Window* window = nullptr;
......@@ -98,8 +100,9 @@ void ShellTestApi::SnapWindowInSplitView(const std::string& client_name,
}
}
DCHECK(window);
shell_->split_view_controller()->SnapWindow(window,
ash::SplitViewController::LEFT);
shell_->split_view_controller()->SnapWindow(
window,
left ? ash::SplitViewController::LEFT : ash::SplitViewController::RIGHT);
shell_->split_view_controller()->FlushForTesting();
std::move(cb).Run();
}
......@@ -109,4 +112,9 @@ void ShellTestApi::ToggleFullscreen(ToggleFullscreenCallback cb) {
std::move(cb).Run();
}
void ShellTestApi::ToggleOverviewMode(ToggleOverviewModeCallback cb) {
shell_->window_selector_controller()->ToggleOverview();
std::move(cb).Run();
}
} // namespace ash
......@@ -57,8 +57,10 @@ class ShellTestApi : public mojom::ShellTestApi {
void EnableVirtualKeyboard(EnableVirtualKeyboardCallback cb) override;
void SnapWindowInSplitView(const std::string& client_name,
ws::Id window_id,
bool left,
SnapWindowInSplitViewCallback cb) override;
void ToggleFullscreen(ToggleFullscreenCallback cb) override;
void ToggleOverviewMode(ToggleOverviewModeCallback cb) override;
private:
Shell* shell_; // not owned
......
......@@ -6,7 +6,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/interfaces/constants.mojom.h"
#include "ash/shell.h"
#include "ash/shell.h" // mash-ok
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
......
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