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

Side by Side Diff: ui/views/window/dialog_delegate_unittest.cc

Issue 1849703004: Handle bubble title resizing (growth) by reworking title layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more change Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "ui/base/hit_test.h" 9 #include "ui/base/hit_test.h"
10 #include "ui/events/event_processor.h" 10 #include "ui/events/event_processor.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 { border + 10, HTSYSMENU }, 195 { border + 10, HTSYSMENU },
196 { border + 20, HTCLIENT }, 196 { border + 20, HTCLIENT },
197 { border + 50, HTCLIENT }, 197 { border + 50, HTCLIENT },
198 { border + 60, HTCLIENT }, 198 { border + 60, HTCLIENT },
199 { 1000, HTNOWHERE }, 199 { 1000, HTNOWHERE },
200 }; 200 };
201 201
202 for (size_t i = 0; i < arraysize(cases); ++i) { 202 for (size_t i = 0; i < arraysize(cases); ++i) {
203 gfx::Point point(cases[i].point, cases[i].point); 203 gfx::Point point(cases[i].point, cases[i].point);
204 EXPECT_EQ(cases[i].hit, frame->NonClientHitTest(point)) 204 EXPECT_EQ(cases[i].hit, frame->NonClientHitTest(point))
205 << " with border: " << border << ", at point " << cases[i].point; 205 << " case " << i << " with border: " << border << ", at point "
206 << cases[i].point;
206 } 207 }
207 } 208 }
208 209
209 TEST_F(DialogTest, HitTest_WithTitle) { 210 TEST_F(DialogTest, HitTest_WithTitle) {
210 // Ensure that BubbleFrameView hit-tests as expected when the title is shown. 211 // Ensure that BubbleFrameView hit-tests as expected when the title is shown.
211 const NonClientView* view = dialog()->GetWidget()->non_client_view(); 212 const NonClientView* view = dialog()->GetWidget()->non_client_view();
212 dialog()->set_title(base::ASCIIToUTF16("Title")); 213 dialog()->set_title(base::ASCIIToUTF16("Title"));
213 dialog()->GetWidget()->UpdateWindowTitle(); 214 dialog()->GetWidget()->UpdateWindowTitle();
214 BubbleFrameView* frame = static_cast<BubbleFrameView*>(view->frame_view()); 215 BubbleFrameView* frame = static_cast<BubbleFrameView*>(view->frame_view());
215 const int border = frame->bubble_border()->GetBorderThickness(); 216 const int border = frame->bubble_border()->GetBorderThickness();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 dialog2->TearDown(); 254 dialog2->TearDown();
254 } 255 }
255 256
256 // Tests default focus is assigned correctly when showing a new dialog. 257 // Tests default focus is assigned correctly when showing a new dialog.
257 TEST_F(DialogTest, InitialFocus) { 258 TEST_F(DialogTest, InitialFocus) {
258 EXPECT_TRUE(dialog()->input()->HasFocus()); 259 EXPECT_TRUE(dialog()->input()->HasFocus());
259 EXPECT_EQ(dialog()->input(), dialog()->GetFocusManager()->GetFocusedView()); 260 EXPECT_EQ(dialog()->input(), dialog()->GetFocusManager()->GetFocusedView());
260 } 261 }
261 262
262 } // namespace views 263 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698