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

Unified Diff: ash/wm/workspace_controller_unittest.cc

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: oshima + mfomitchev comments Created 3 years, 10 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_controller_unittest.cc
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index db4d5869762dff7e0340d9525b72602b0361871e..737668a9a3e1ed00d2e9ca0e3db153f151df4424 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -1343,42 +1343,6 @@ TEST_F(WorkspaceControllerTest, RestoreMinimizedSnappedWindow) {
EXPECT_EQ(snapped_bounds, window->bounds());
}
-namespace {
-
-// Used by DragMaximizedNonTrackedWindow to track how many times the window
-// hierarchy changes affecting the specified window.
-class DragMaximizedNonTrackedWindowObserver : public aura::WindowObserver {
- public:
- DragMaximizedNonTrackedWindowObserver(aura::Window* window)
- : change_count_(0), window_(window) {}
-
- // Number of times OnWindowHierarchyChanged() has been received.
- void clear_change_count() { change_count_ = 0; }
- int change_count() const { return change_count_; }
-
- // aura::WindowObserver overrides:
- // Counts number of times a window is reparented. Ignores reparenting into and
- // from a docked container which is expected when a tab is dragged.
- void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override {
- if (params.target != window_ ||
- (params.old_parent->id() == kShellWindowId_DefaultContainer &&
- params.new_parent->id() == kShellWindowId_DockedContainer) ||
- (params.old_parent->id() == kShellWindowId_DockedContainer &&
- params.new_parent->id() == kShellWindowId_DefaultContainer)) {
- return;
- }
- change_count_++;
- }
-
- private:
- int change_count_;
- aura::Window* window_;
-
- DISALLOW_COPY_AND_ASSIGN(DragMaximizedNonTrackedWindowObserver);
-};
-
-} // namespace
-
// Verifies that a new maximized window becomes visible after its activation
// is requested, even though it does not become activated because a system
// modal window is active.
@@ -1594,53 +1558,4 @@ TEST_F(WorkspaceControllerTest, WindowEdgeTouchHitTestPanel) {
}
}
-// Verifies events targeting just outside the window edges for docked windows.
-TEST_F(WorkspaceControllerTest, WindowEdgeHitTestDocked) {
- aura::test::TestWindowDelegate delegate;
- // Make window smaller than the minimum docked area so that the window edges
- // are exposed.
- delegate.set_maximum_size(gfx::Size(180, 200));
- std::unique_ptr<Window> window(aura::test::CreateTestWindowWithDelegate(
- &delegate, 123, gfx::Rect(20, 10, 100, 50), NULL));
- ParentWindowInPrimaryRootWindow(window.get());
- aura::Window* docked_container = Shell::GetContainer(
- window->GetRootWindow(), kShellWindowId_DockedContainer);
- docked_container->AddChild(window.get());
- window->Show();
- ui::EventTarget* root = window->GetRootWindow();
- ui::EventTargeter* targeter = root->GetEventTargeter();
- const gfx::Rect bounds = window->bounds();
- const int kNumPoints = 5;
- struct {
- const char* direction;
- gfx::Point location;
- bool is_target_hit;
- } points[kNumPoints] = {
- {"left", gfx::Point(bounds.x() - 2, bounds.y() + 10), true},
- {"top", gfx::Point(bounds.x() + 10, bounds.y() - 2), true},
- {"right", gfx::Point(bounds.right() + 2, bounds.y() + 10), true},
- {"bottom", gfx::Point(bounds.x() + 10, bounds.bottom() + 2), true},
- {"outside", gfx::Point(bounds.x() + 10, bounds.y() - 31), false},
- };
- for (int i = 0; i < kNumPoints; ++i) {
- SCOPED_TRACE(points[i].direction);
- const gfx::Point& location = points[i].location;
- ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, location, location,
- ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
- ui::EventTarget* target = targeter->FindTargetForEvent(root, &mouse);
- if (points[i].is_target_hit)
- EXPECT_EQ(window.get(), target);
- else
- EXPECT_NE(window.get(), target);
-
- ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, location, 0,
- ui::EventTimeForNow());
- target = targeter->FindTargetForEvent(root, &touch);
- if (points[i].is_target_hit)
- EXPECT_EQ(window.get(), target);
- else
- EXPECT_NE(window.get(), target);
- }
-}
-
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698