Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 337193002: WorkspaceLayoutManager backdrop should fill entire region. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index 651f1f8cd1a49ebe8a9693638e09fb7b3fb87ccb..050a02954d9b0455863b45aa2bcd38b7180ff37a 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -4,6 +4,8 @@
#include "ash/wm/workspace/workspace_layout_manager.h"
+#include <string>
jonross 2014/06/16 18:50:58 cpplint
+
#include "ash/display/display_layout.h"
#include "ash/display/display_manager.h"
#include "ash/root_window_controller.h"
@@ -39,7 +41,7 @@ namespace {
class MaximizeDelegateView : public views::WidgetDelegateView {
public:
- MaximizeDelegateView(const gfx::Rect& initial_bounds)
+ explicit MaximizeDelegateView(const gfx::Rect& initial_bounds)
jonross 2014/06/16 18:50:58 cpplint
: initial_bounds_(initial_bounds) {
}
virtual ~MaximizeDelegateView() {}
@@ -942,6 +944,34 @@ TEST_F(WorkspaceLayoutManagerBackdropTest, VerifyBackdropAndItsStacking) {
window3.get()));
}
+// Tests that when hidding the shelf, that the backdrop resizes to fill the
+// entire workspace area.
+TEST_F(WorkspaceLayoutManagerBackdropTest, ShelfVisibilityChangesBounds) {
+ // Set to the size of the display to cause sizing issues with the shelf
flackr 2014/06/17 14:01:08 The comment isn't clear, to cause what sizing issu
jonross 2014/06/17 14:05:58 This is reproducible with just shelf changes. Howe
flackr 2014/06/17 14:13:25 Can you check what those issues are? I'd prefer to
jonross 2014/06/17 14:24:31 The other tests pass with line 795 gone. Whatever
+ default_container()->SetBounds(gfx::Rect(0, 0, 800, 600));
+ ShelfLayoutManager* shelf_layout_manager =
+ Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
+ ShowTopWindowBackdrop(true);
+ RunAllPendingInMessageLoop();
+
+ gfx::Rect initial_bounds = default_container()->children()[0]->bounds();
+ shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ shelf_layout_manager->UpdateVisibilityState();
+
+ // When the shelf is re-shown WorkspaceLayoutManager shrinks all children
+ // including the backdrop.
+ shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ shelf_layout_manager->UpdateVisibilityState();
+ gfx::Rect reduced_bounds = default_container()->children()[0]->bounds();
+ EXPECT_LT(reduced_bounds.height(), initial_bounds.height());
+
+ shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ shelf_layout_manager->UpdateVisibilityState();
+
+ EXPECT_GT(default_container()->children()[0]->bounds().height(),
+ reduced_bounds.height());
+}
+
class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
public:
WorkspaceLayoutManagerKeyboardTest() {}
@@ -983,14 +1013,14 @@ class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
private:
gfx::Insets restore_work_area_insets_;
gfx::Rect keyboard_bounds_;
- WorkspaceLayoutManager *layout_manager_;
+ WorkspaceLayoutManager* layout_manager_;
jonross 2014/06/16 18:50:58 cpplint
DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest);
};
class FakeTextInputClient : public ui::DummyTextInputClient {
public:
- FakeTextInputClient(gfx::NativeWindow window) : window_(window) {}
+ explicit FakeTextInputClient(gfx::NativeWindow window) : window_(window) {}
jonross 2014/06/16 18:50:58 cpplint
virtual ~FakeTextInputClient() {}
virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698