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

Side by Side Diff: components/constrained_window/constrained_window_views_unittest.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 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 | « chrome/test/base/browser_with_test_window_test.cc ('k') | ui/views/BUILD.gn » ('j') | 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 "components/constrained_window/constrained_window_views.h" 5 #include "components/constrained_window/constrained_window_views.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // original size. 213 // original size.
214 max_dialog_size.Enlarge(100, 100); 214 max_dialog_size.Enlarge(100, 100);
215 dialog_host()->set_max_dialog_size(max_dialog_size); 215 dialog_host()->set_max_dialog_size(max_dialog_size);
216 UpdateWebContentsModalDialogPosition(dialog(), dialog_host()); 216 UpdateWebContentsModalDialogPosition(dialog(), dialog_host());
217 EXPECT_EQ(full_dialog_size.ToString(), GetDialogSize().ToString()); 217 EXPECT_EQ(full_dialog_size.ToString(), GetDialogSize().ToString());
218 } 218 }
219 219
220 // Ensure CreateBrowserModalDialogViews() works correctly with a null parent. 220 // Ensure CreateBrowserModalDialogViews() works correctly with a null parent.
221 TEST_F(ConstrainedWindowViewsTest, NullModalParent) { 221 TEST_F(ConstrainedWindowViewsTest, NullModalParent) {
222 // Use desktop widgets (except on ChromeOS) for extra coverage. 222 // Use desktop widgets (except on ChromeOS) for extra coverage.
223 views_delegate()->set_use_desktop_native_widgets(true); 223 test_views_delegate()->set_use_desktop_native_widgets(true);
224 224
225 SetConstrainedWindowViewsClient( 225 SetConstrainedWindowViewsClient(
226 base::MakeUnique<TestConstrainedWindowViewsClient>()); 226 base::MakeUnique<TestConstrainedWindowViewsClient>());
227 DialogContents* contents = new DialogContents; 227 DialogContents* contents = new DialogContents;
228 contents->set_modal_type(ui::MODAL_TYPE_WINDOW); 228 contents->set_modal_type(ui::MODAL_TYPE_WINDOW);
229 views::Widget* widget = CreateBrowserModalDialogViews(contents, nullptr); 229 views::Widget* widget = CreateBrowserModalDialogViews(contents, nullptr);
230 widget->Show(); 230 widget->Show();
231 EXPECT_TRUE(widget->IsVisible()); 231 EXPECT_TRUE(widget->IsVisible());
232 widget->CloseNow(); 232 widget->CloseNow();
233 } 233 }
(...skipping 26 matching lines...) Expand all
260 // Now reposition the modal dialog into the display. 260 // Now reposition the modal dialog into the display.
261 UpdateWebContentsModalDialogPosition(dialog(), dialog_host()); 261 UpdateWebContentsModalDialogPosition(dialog(), dialog_host());
262 262
263 const gfx::Rect dialog_bounds = dialog()->GetRootView()->GetBoundsInScreen(); 263 const gfx::Rect dialog_bounds = dialog()->GetRootView()->GetBoundsInScreen();
264 264
265 // The dialog should now be fully on the display. 265 // The dialog should now be fully on the display.
266 EXPECT_TRUE(extents.Contains(dialog_bounds)); 266 EXPECT_TRUE(extents.Contains(dialog_bounds));
267 } 267 }
268 268
269 } // namespace constrained_window 269 } // namespace constrained_window
OLDNEW
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698