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

Unified Diff: ui/views/window/dialog_delegate_unittest.cc

Issue 2861533003: Backfill some UI tests. (Closed)
Patch Set: minor edits Created 3 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
Index: ui/views/window/dialog_delegate_unittest.cc
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc
index ff365d4f98b2c78200ceb69eaf8c4e087a715e21..065d8e7709e2592a29b688db3a65b622d2277676 100644
--- a/ui/views/window/dialog_delegate_unittest.cc
+++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -284,6 +284,19 @@ TEST_F(DialogTest, HitTest_WithTitle) {
}
}
+TEST_F(DialogTest, HitTest_CloseButton) {
+ const NonClientView* view = dialog()->GetWidget()->non_client_view();
+ dialog()->set_show_close_button(true);
+ BubbleFrameView* frame = static_cast<BubbleFrameView*>(view->frame_view());
+ frame->ResetWindowControls();
+
+ const gfx::Rect close_button_bounds =
+ frame->GetCloseButtonForTest()->bounds();
+ EXPECT_EQ(HTCLOSE,
+ frame->NonClientHitTest(gfx::Point(close_button_bounds.x() + 4,
+ close_button_bounds.y() + 4)));
+}
+
TEST_F(DialogTest, BoundsAccommodateTitle) {
TestDialog* dialog2(new TestDialog());
dialog2->set_title(base::ASCIIToUTF16("Title"));

Powered by Google App Engine
This is Rietveld 408576698