Chromium Code Reviews| Index: ui/views/mus/native_widget_mus_unittest.cc |
| diff --git a/ui/views/mus/native_widget_mus_unittest.cc b/ui/views/mus/native_widget_mus_unittest.cc |
| index e4b7fb34c633c1c40af04fa12c92f1e3325118c2..42cbc3c609926bcb107a4bc85fda8f29ce92d2a9 100644 |
| --- a/ui/views/mus/native_widget_mus_unittest.cc |
| +++ b/ui/views/mus/native_widget_mus_unittest.cc |
| @@ -436,4 +436,25 @@ TEST_F(NativeWidgetMusTest, EventAckedWithWindowDestruction) { |
| EXPECT_EQ(1, ack_callback_count()); |
| } |
| +TEST_F(NativeWidgetMusTest, SetAndReleaseCapture) { |
| + std::unique_ptr<Widget> widget(CreateWidget(nullptr)); |
| + widget->Show(); |
| + View* content = new View; |
| + widget->GetContentsView()->AddChildView(content); |
| + internal::NativeWidgetPrivate* widget_private = |
| + widget->native_widget_private(); |
| + mus::Window* mus_window = |
| + static_cast<NativeWidgetMus*>(widget_private)->window(); |
| + EXPECT_FALSE(widget_private->HasCapture()); |
| + EXPECT_FALSE(mus_window->HasCapture()); |
| + |
| + widget->SetCapture(content); |
| + EXPECT_TRUE(widget_private->HasCapture()); |
| + EXPECT_TRUE(mus_window->HasCapture()); |
| + |
| + widget->ReleaseCapture(); |
| + EXPECT_FALSE(widget_private->HasCapture()); |
| + EXPECT_FALSE(mus_window->HasCapture()); |
|
sadrul
2016/05/24 15:25:19
Hm, because the mus WS is launched just once for a
Mark Dittmer
2016/05/24 16:06:21
Alright. I'll see how the bots feel about this whe
|
| +} |
| + |
| } // namespace views |