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

Side by Side Diff: chrome/browser/ui/views/web_dialog_view_browsertest.cc

Issue 10540100: TabContentsWrapper -> TabContents, part 48. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
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 "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 #endif 105 #endif
106 106
107 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, MAYBE_SizeWindow) { 107 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, MAYBE_SizeWindow) {
108 test::TestWebDialogDelegate* delegate = 108 test::TestWebDialogDelegate* delegate =
109 new test::TestWebDialogDelegate( 109 new test::TestWebDialogDelegate(
110 GURL(chrome::kChromeUIChromeURLsURL)); 110 GURL(chrome::kChromeUIChromeURLsURL));
111 delegate->set_size(kInitialWidth, kInitialHeight); 111 delegate->set_size(kInitialWidth, kInitialHeight);
112 112
113 TestWebDialogView* view = 113 TestWebDialogView* view =
114 new TestWebDialogView(browser()->profile(), browser(), delegate); 114 new TestWebDialogView(browser()->profile(), browser(), delegate);
115 WebContents* web_contents = browser()->GetSelectedWebContents(); 115 WebContents* web_contents = browser()->GetActiveWebContents();
116 ASSERT_TRUE(web_contents != NULL); 116 ASSERT_TRUE(web_contents != NULL);
117 views::Widget::CreateWindowWithParent( 117 views::Widget::CreateWindowWithParent(
118 view, web_contents->GetView()->GetTopLevelNativeWindow()); 118 view, web_contents->GetView()->GetTopLevelNativeWindow());
119 view->GetWidget()->Show(); 119 view->GetWidget()->Show();
120 120
121 // TestWebDialogView should quit current message loop on size change. 121 // TestWebDialogView should quit current message loop on size change.
122 view->set_should_quit_on_size_change(true); 122 view->set_should_quit_on_size_change(true);
123 123
124 gfx::Rect bounds = view->GetWidget()->GetClientAreaScreenBounds(); 124 gfx::Rect bounds = view->GetWidget()->GetClientAreaScreenBounds();
125 125
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 EXPECT_LT(0, actual_bounds.height()); 185 EXPECT_LT(0, actual_bounds.height());
186 } 186 }
187 187
188 // This is timing out about 5~10% of runs. See crbug.com/86059. 188 // This is timing out about 5~10% of runs. See crbug.com/86059.
189 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, DISABLED_WebContentRendered) { 189 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, DISABLED_WebContentRendered) {
190 WebDialogDelegate* delegate = new test::TestWebDialogDelegate( 190 WebDialogDelegate* delegate = new test::TestWebDialogDelegate(
191 GURL(chrome::kChromeUIChromeURLsURL)); 191 GURL(chrome::kChromeUIChromeURLsURL));
192 192
193 TestWebDialogView* view = 193 TestWebDialogView* view =
194 new TestWebDialogView(browser()->profile(), browser(), delegate); 194 new TestWebDialogView(browser()->profile(), browser(), delegate);
195 WebContents* web_contents = browser()->GetSelectedWebContents(); 195 WebContents* web_contents = browser()->GetActiveWebContents();
196 ASSERT_TRUE(web_contents != NULL); 196 ASSERT_TRUE(web_contents != NULL);
197 views::Widget::CreateWindowWithParent( 197 views::Widget::CreateWindowWithParent(
198 view, web_contents->GetView()->GetTopLevelNativeWindow()); 198 view, web_contents->GetView()->GetTopLevelNativeWindow());
199 EXPECT_TRUE(view->initialized_); 199 EXPECT_TRUE(view->initialized_);
200 200
201 view->InitDialog(); 201 view->InitDialog();
202 view->GetWidget()->Show(); 202 view->GetWidget()->Show();
203 203
204 // TestWebDialogView::OnTabMainFrameRender() will Quit(). 204 // TestWebDialogView::OnTabMainFrameRender() will Quit().
205 MessageLoopForUI::current()->Run(); 205 MessageLoopForUI::current()->Run();
206 206
207 EXPECT_TRUE(view->painted()); 207 EXPECT_TRUE(view->painted());
208 208
209 view->GetWidget()->Close(); 209 view->GetWidget()->Close();
210 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698