OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/ui/views/html_dialog_view.h" | 10 #include "chrome/browser/ui/views/html_dialog_view.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 #define MAYBE_SizeWindow DISABLED_SizeWindow | 124 #define MAYBE_SizeWindow DISABLED_SizeWindow |
125 #endif | 125 #endif |
126 | 126 |
127 IN_PROC_BROWSER_TEST_F(HtmlDialogBrowserTest, MAYBE_SizeWindow) { | 127 IN_PROC_BROWSER_TEST_F(HtmlDialogBrowserTest, MAYBE_SizeWindow) { |
128 HtmlDialogUIDelegate* delegate = new TestHtmlDialogUIDelegate(); | 128 HtmlDialogUIDelegate* delegate = new TestHtmlDialogUIDelegate(); |
129 | 129 |
130 HtmlDialogView* html_view = | 130 HtmlDialogView* html_view = |
131 new HtmlDialogView(browser()->profile(), delegate); | 131 new HtmlDialogView(browser()->profile(), delegate); |
132 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 132 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
133 ASSERT_TRUE(tab_contents != NULL); | 133 ASSERT_TRUE(tab_contents != NULL); |
134 views::Window::CreateChromeWindow(tab_contents->GetMessageBoxRootWindow(), | 134 views::Window::CreateChromeWindow(tab_contents->GetDialogRootWindow(), |
135 gfx::Rect(), html_view); | 135 gfx::Rect(), html_view); |
136 html_view->InitDialog(); | 136 html_view->InitDialog(); |
137 html_view->window()->Show(); | 137 html_view->window()->Show(); |
138 | 138 |
139 MessageLoopForUI::current()->AddObserver( | 139 MessageLoopForUI::current()->AddObserver( |
140 WindowChangedObserver::GetInstance()); | 140 WindowChangedObserver::GetInstance()); |
141 | 141 |
142 gfx::Rect bounds = html_view->GetWidget()->GetClientAreaScreenBounds(); | 142 gfx::Rect bounds = html_view->GetWidget()->GetClientAreaScreenBounds(); |
143 | 143 |
144 gfx::Rect set_bounds = bounds; | 144 gfx::Rect set_bounds = bounds; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 html_view->MoveContents(tab_contents, set_bounds); | 199 html_view->MoveContents(tab_contents, set_bounds); |
200 ui_test_utils::RunMessageLoop(); | 200 ui_test_utils::RunMessageLoop(); |
201 actual_bounds = html_view->GetWidget()->GetClientAreaScreenBounds(); | 201 actual_bounds = html_view->GetWidget()->GetClientAreaScreenBounds(); |
202 EXPECT_LT(0, actual_bounds.width()); | 202 EXPECT_LT(0, actual_bounds.width()); |
203 EXPECT_LT(0, actual_bounds.height()); | 203 EXPECT_LT(0, actual_bounds.height()); |
204 | 204 |
205 MessageLoopForUI::current()->RemoveObserver( | 205 MessageLoopForUI::current()->RemoveObserver( |
206 WindowChangedObserver::GetInstance()); | 206 WindowChangedObserver::GetInstance()); |
207 } | 207 } |
OLD | NEW |