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

Unified Diff: ash/mus/wm/mru_window_tracker_unittest.cc

Issue 2411913003: Converts ash/wm/mru_window_tracker_unittest.cc to use AshTest (Closed)
Patch Set: comment Created 4 years, 2 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
« no previous file with comments | « ash/mus/property_util.cc ('k') | ash/wm/mru_window_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/wm/mru_window_tracker_unittest.cc
diff --git a/ash/mus/wm/mru_window_tracker_unittest.cc b/ash/mus/wm/mru_window_tracker_unittest.cc
deleted file mode 100644
index 4f443359df5f3f6463eedc0b4b1f9ef419bf735e..0000000000000000000000000000000000000000
--- a/ash/mus/wm/mru_window_tracker_unittest.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/wm/mru_window_tracker.h"
-
-#include "ash/common/shell_window_ids.h"
-#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_shell.h"
-#include "ash/mus/bridge/wm_window_mus.h"
-#include "ash/mus/test/wm_test_base.h"
-#include "ui/base/hit_test.h"
-
-namespace ash {
-
-class MruWindowTrackerTest : public mus::WmTestBase {
- public:
- MruWindowTrackerTest() {}
- ~MruWindowTrackerTest() override {}
-
- WmWindow* CreateTestWindow() {
- return mus::WmWindowMus::Get(
- mus::WmTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400)));
- }
-
- MruWindowTracker* mru_window_tracker() {
- return WmShell::Get()->mru_window_tracker();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MruWindowTrackerTest);
-};
-
-// Basic test that the activation order is tracked.
-TEST_F(MruWindowTrackerTest, Basic) {
- WmWindow* w1 = CreateTestWindow();
- WmWindow* w2 = CreateTestWindow();
- WmWindow* w3 = CreateTestWindow();
- w3->Activate();
- w2->Activate();
- w1->Activate();
-
- WmWindow::Windows window_list = mru_window_tracker()->BuildMruWindowList();
- EXPECT_EQ(w1, window_list[0]);
- EXPECT_EQ(w2, window_list[1]);
- EXPECT_EQ(w3, window_list[2]);
-}
-
-// Test that minimized windows are not treated specially.
-TEST_F(MruWindowTrackerTest, MinimizedWindowsAreLru) {
- WmWindow* w1 = CreateTestWindow();
- WmWindow* w2 = CreateTestWindow();
- WmWindow* w3 = CreateTestWindow();
- WmWindow* w4 = CreateTestWindow();
- WmWindow* w5 = CreateTestWindow();
- WmWindow* w6 = CreateTestWindow();
- w6->Activate();
- w5->Activate();
- w4->Activate();
- w3->Activate();
- w2->Activate();
- w1->Activate();
-
- w1->GetWindowState()->Minimize();
- w4->GetWindowState()->Minimize();
- w5->GetWindowState()->Minimize();
-
- WmWindow::Windows window_list = mru_window_tracker()->BuildMruWindowList();
- EXPECT_EQ(w1, window_list[0]);
- EXPECT_EQ(w2, window_list[1]);
- EXPECT_EQ(w3, window_list[2]);
- EXPECT_EQ(w4, window_list[3]);
- EXPECT_EQ(w5, window_list[4]);
- EXPECT_EQ(w6, window_list[5]);
-}
-
-// Tests that windows being dragged are only in the WindowList once.
-// Disabled, see http://crbug.com/618058.
-TEST_F(MruWindowTrackerTest, DISABLED_DraggedWindowsInListOnlyOnce) {
- WmWindow* w1 = CreateTestWindow();
- w1->Activate();
-
- // Start dragging the window.
- w1->GetWindowState()->CreateDragDetails(
- gfx::Point(), HTRIGHT, aura::client::WINDOW_MOVE_SOURCE_TOUCH);
-
- // During a drag the window is reparented by the Docked container.
- WmWindow* drag_container = w1->GetRootWindow()->GetChildByShellWindowId(
- kShellWindowId_DockedContainer);
- drag_container->AddChild(w1);
- EXPECT_TRUE(w1->GetWindowState()->is_dragged());
-
- // The dragged window should only be in the list once.
- WmWindow::Windows window_list =
- mru_window_tracker()->BuildWindowListIgnoreModal();
- EXPECT_EQ(1, std::count(window_list.begin(), window_list.end(), w1));
-}
-
-} // namespace ash
« no previous file with comments | « ash/mus/property_util.cc ('k') | ash/wm/mru_window_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698