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

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

Issue 12066003: Remove TabStripModel wrapper use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 7 years, 10 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"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_tabstrip.h" 13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 14 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
15 #include "chrome/common/url_constants.h" 15 #include "chrome/common/url_constants.h"
16 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/ui_test_utils.h" 17 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
19 #include "content/public/browser/render_widget_host_view.h" 19 #include "content/public/browser/render_widget_host_view.h"
20 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
21 #include "content/public/browser/web_contents_view.h" 21 #include "content/public/browser/web_contents_view.h"
22 #include "testing/gmock/include/gmock/gmock.h" 22 #include "testing/gmock/include/gmock/gmock.h"
23 #include "testing/gtest/include/gtest/gtest.h" 23 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #endif 96 #endif
97 97
98 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, MAYBE_SizeWindow) { 98 IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, MAYBE_SizeWindow) {
99 ui::test::TestWebDialogDelegate* delegate = 99 ui::test::TestWebDialogDelegate* delegate =
100 new ui::test::TestWebDialogDelegate( 100 new ui::test::TestWebDialogDelegate(
101 GURL(chrome::kChromeUIChromeURLsURL)); 101 GURL(chrome::kChromeUIChromeURLsURL));
102 delegate->set_size(kInitialWidth, kInitialHeight); 102 delegate->set_size(kInitialWidth, kInitialHeight);
103 103
104 TestWebDialogView* view = 104 TestWebDialogView* view =
105 new TestWebDialogView(browser()->profile(), delegate); 105 new TestWebDialogView(browser()->profile(), delegate);
106 WebContents* web_contents = chrome::GetActiveWebContents(browser()); 106 WebContents* web_contents =
107 browser()->tab_strip_model()->GetActiveWebContents();
107 ASSERT_TRUE(web_contents != NULL); 108 ASSERT_TRUE(web_contents != NULL);
108 views::Widget::CreateWindowWithParent( 109 views::Widget::CreateWindowWithParent(
109 view, web_contents->GetView()->GetTopLevelNativeWindow()); 110 view, web_contents->GetView()->GetTopLevelNativeWindow());
110 view->GetWidget()->Show(); 111 view->GetWidget()->Show();
111 112
112 // TestWebDialogView should quit current message loop on size change. 113 // TestWebDialogView should quit current message loop on size change.
113 view->set_should_quit_on_size_change(true); 114 view->set_should_quit_on_size_change(true);
114 115
115 gfx::Rect bounds = view->GetWidget()->GetClientAreaBoundsInScreen(); 116 gfx::Rect bounds = view->GetWidget()->GetClientAreaBoundsInScreen();
116 117
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Check to make sure we can't get to 0x0 169 // Check to make sure we can't get to 0x0
169 set_bounds.set_width(0); 170 set_bounds.set_width(0);
170 set_bounds.set_height(0); 171 set_bounds.set_height(0);
171 172
172 view->MoveContents(web_contents, set_bounds); 173 view->MoveContents(web_contents, set_bounds);
173 content::RunMessageLoop(); // TestWebDialogView will quit. 174 content::RunMessageLoop(); // TestWebDialogView will quit.
174 actual_bounds = view->GetWidget()->GetClientAreaBoundsInScreen(); 175 actual_bounds = view->GetWidget()->GetClientAreaBoundsInScreen();
175 EXPECT_LT(0, actual_bounds.width()); 176 EXPECT_LT(0, actual_bounds.width());
176 EXPECT_LT(0, actual_bounds.height()); 177 EXPECT_LT(0, actual_bounds.height());
177 } 178 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc ('k') | chrome/browser/unload_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698