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

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 10411036: Separate BrowserWindow from Panel class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac unit_tests compile Created 8 years, 7 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 "chrome/browser/ui/panels/base_panel_browser_test.h" 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
6 6
7 #include "chrome/browser/ui/browser_list.h" 7 #include "chrome/browser/ui/browser_list.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/panels/native_panel.h" 18 #include "chrome/browser/ui/panels/native_panel.h"
19 #include "chrome/browser/ui/panels/panel_browser_window.h"
19 #include "chrome/browser/ui/panels/panel_manager.h" 20 #include "chrome/browser/ui/panels/panel_manager.h"
20 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" 21 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
22 #include "chrome/common/chrome_notification_types.h" 23 #include "chrome/common/chrome_notification_types.h"
23 #include "chrome/common/chrome_paths.h" 24 #include "chrome/common/chrome_paths.h"
24 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/extensions/extension_manifest_constants.h" 26 #include "chrome/common/extensions/extension_manifest_constants.h"
26 #include "chrome/common/string_ordinal.h" 27 #include "chrome/common/string_ordinal.h"
27 #include "chrome/test/base/ui_test_utils.h" 28 #include "chrome/test/base/ui_test_utils.h"
28 #include "content/public/browser/notification_service.h" 29 #include "content/public/browser/notification_service.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 332
332 if (!params.url.is_empty()) { 333 if (!params.url.is_empty()) {
333 ui_test_utils::WindowedNotificationObserver observer( 334 ui_test_utils::WindowedNotificationObserver observer(
334 content::NOTIFICATION_LOAD_STOP, 335 content::NOTIFICATION_LOAD_STOP,
335 content::NotificationService::AllSources()); 336 content::NotificationService::AllSources());
336 panel_browser->AddSelectedTabWithURL(params.url, 337 panel_browser->AddSelectedTabWithURL(params.url,
337 content::PAGE_TRANSITION_START_PAGE); 338 content::PAGE_TRANSITION_START_PAGE);
338 observer.Wait(); 339 observer.Wait();
339 } 340 }
340 341
341 Panel* panel = static_cast<Panel*>(panel_browser->window()); 342 PanelBrowserWindow* panel_browser_window =
343 static_cast<PanelBrowserWindow*>(panel_browser->window());
344 Panel* panel = panel_browser_window->panel();
342 345
343 if (!PanelManager::GetInstance()->auto_sizing_enabled() || 346 if (!PanelManager::GetInstance()->auto_sizing_enabled() ||
344 params.bounds.width() || params.bounds.height()) { 347 params.bounds.width() || params.bounds.height()) {
345 EXPECT_FALSE(panel->auto_resizable()); 348 EXPECT_FALSE(panel->auto_resizable());
346 } else { 349 } else {
347 EXPECT_TRUE(panel->auto_resizable()); 350 EXPECT_TRUE(panel->auto_resizable());
348 } 351 }
349 352
350 #if defined(OS_LINUX) 353 #if defined(OS_LINUX)
351 // On bots, we might have a simple window manager which always activates new 354 // On bots, we might have a simple window manager which always activates new
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } 503 }
501 504
502 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { 505 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) {
503 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); 506 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position);
504 } 507 }
505 508
506 std::string BasePanelBrowserTest::MakePanelName(int index) { 509 std::string BasePanelBrowserTest::MakePanelName(int index) {
507 std::string panel_name("Panel"); 510 std::string panel_name("Panel");
508 return panel_name + base::IntToString(index); 511 return panel_name + base::IntToString(index);
509 } 512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698