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

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

Issue 2287583002: mash: Fix crash when closing system tray menu (Closed)
Patch Set: Created 4 years, 4 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/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/wm/container_finder_unittest.cc
diff --git a/ash/mus/wm/container_finder_unittest.cc b/ash/mus/wm/container_finder_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fb0ec9cfda5e54d9c3f5a2572c0136bfe7eccf8d
--- /dev/null
+++ b/ash/mus/wm/container_finder_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 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/container_finder.h"
+
+#include "ash/common/shell_window_ids.h"
+#include "ash/common/wm_window.h"
+#include "ash/mus/bridge/wm_window_mus.h"
+#include "ash/mus/test/wm_test_base.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace ash {
+
+using ContainerFinderTest = mus::WmTestBase;
James Cook 2016/08/26 17:49:13 I did the same thing as MruWindowTrackerTest and c
+
+TEST_F(ContainerFinderTest, GetContainerForWindow) {
+ // Create a normal window in the default container.
+ WmWindow* window =
+ mus::WmWindowMus::Get(CreateTestWindow(gfx::Rect(1, 2, 3, 4)));
+
+ // The window itself is not a container.
+ EXPECT_EQ(kShellWindowId_Invalid, window->GetShellWindowId());
+
+ // Container lookup finds the default container.
+ WmWindow* container = wm::GetContainerForWindow(window);
+ ASSERT_TRUE(container);
+ EXPECT_EQ(kShellWindowId_DefaultContainer, container->GetShellWindowId());
+}
+
+} // namespace ash
« no previous file with comments | « ash/mus/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698