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

Unified Diff: ash/mus/layout_manager_unittest.cc

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: add overrides Created 4 years 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/layout_manager.cc ('k') | ash/mus/move_event_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/layout_manager_unittest.cc
diff --git a/ash/mus/layout_manager_unittest.cc b/ash/mus/layout_manager_unittest.cc
deleted file mode 100644
index c7e83cccffbd4f83ba95bf5b0b55f1fc3770bf49..0000000000000000000000000000000000000000
--- a/ash/mus/layout_manager_unittest.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 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/mus/layout_manager.h"
-
-#include <memory>
-
-#include "base/macros.h"
-#include "services/ui/public/cpp/tests/test_window.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ash {
-namespace mus {
-
-class TestLayoutManager : public LayoutManager {
- public:
- explicit TestLayoutManager(ui::Window* window)
- : LayoutManager(window), layout_called_(false) {}
- ~TestLayoutManager() override {}
-
- bool GetAndResetLayoutCalled() {
- bool was_layout_called = layout_called_;
- layout_called_ = false;
- return was_layout_called;
- }
-
- private:
- // LayoutManager:
- void LayoutWindow(ui::Window* window) override { layout_called_ = true; }
-
- bool layout_called_;
-
- DISALLOW_COPY_AND_ASSIGN(TestLayoutManager);
-};
-
-// Tests that owning window can be destroyed before the layout manager.
-TEST(LayoutManagerTest, OwningWindowDestroyedFirst) {
- std::unique_ptr<ui::TestWindow> parent(new ui::TestWindow(1));
- ui::TestWindow child(2);
- TestLayoutManager layout_manager(parent.get());
- parent->AddChild(&child);
- EXPECT_TRUE(layout_manager.GetAndResetLayoutCalled());
- parent.reset();
- child.SetBounds(gfx::Rect(100, 200));
-}
-
-// Tests that the layout manager can be destroyed before the owning window.
-TEST(LayoutManagerTest, LayoutManagerDestroyedFirst) {
- ui::TestWindow parent(1);
- ui::TestWindow child(2);
- std::unique_ptr<TestLayoutManager> layout_manager(
- new TestLayoutManager(&parent));
- parent.AddChild(&child);
- EXPECT_TRUE(layout_manager->GetAndResetLayoutCalled());
-
- parent.SetBounds(gfx::Rect(100, 200));
- EXPECT_TRUE(layout_manager->GetAndResetLayoutCalled());
-
- layout_manager.reset();
- parent.SetBounds(gfx::Rect(200, 100));
-}
-
-} // namespace mus
-} // namespace ash
« no previous file with comments | « ash/mus/layout_manager.cc ('k') | ash/mus/move_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698