Index: components/mus/public/cpp/tests/window_unittest.cc |
diff --git a/components/mus/public/cpp/tests/window_unittest.cc b/components/mus/public/cpp/tests/window_unittest.cc |
index 5b706582457a70c1a15678e5e5644bd7acf08163..4b4e998ac8978da5b7e67cfb4f570190e3696735 100644 |
--- a/components/mus/public/cpp/tests/window_unittest.cc |
+++ b/components/mus/public/cpp/tests/window_unittest.cc |
@@ -1132,4 +1132,14 @@ TEST_F(WindowTest, StackUponCreation) { |
EXPECT_EQ("1 3 2", ChildWindowIDsAsString(parent.get())); |
} |
+// Tests that a window does not have capture until it is explicitly set. |
+TEST_F(WindowTest, SetCapture) { |
+ TestWindow w; |
+ ASSERT_FALSE(w.has_capture()); |
+ w.SetCapture(); |
+ EXPECT_TRUE(w.has_capture()); |
+ w.ReleaseCapture(); |
+ EXPECT_FALSE(w.has_capture()); |
+} |
+ |
} // namespace mus |