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

Unified Diff: ui/views/mus/native_widget_mus_unittest.cc

Issue 1988283002: Implement and test aura::client::CaptureClient in views::NativeWidgetMus for plumbing (Set|Release)… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native_widget_mus7
Patch Set: Use inheritance for MusCaptureClient Created 4 years, 7 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 | « ui/views/mus/native_widget_mus.cc ('k') | ui/views/mus/platform_window_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+}
+
} // namespace views
« no previous file with comments | « ui/views/mus/native_widget_mus.cc ('k') | ui/views/mus/platform_window_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698