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

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

Issue 10828289: Revert 151353 - Panels refactor: Support browserless panels on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
Property Changes:
Added: svn:mergeinfo
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/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/download/download_service.h" 7 #include "chrome/browser/download/download_service.h"
8 #include "chrome/browser/download/download_service_factory.h" 8 #include "chrome/browser/download/download_service_factory.h"
9 #include "chrome/browser/net/url_request_mock_util.h" 9 #include "chrome/browser/net/url_request_mock_util.h"
10 #include "chrome/browser/prefs/browser_prefs.h" 10 #include "chrome/browser/prefs/browser_prefs.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 13 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
14 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" 14 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
15 #include "chrome/browser/ui/browser_commands.h" 15 #include "chrome/browser/ui/browser_commands.h"
16 #include "chrome/browser/ui/browser_finder.h" 16 #include "chrome/browser/ui/browser_finder.h"
17 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
18 #include "chrome/browser/ui/browser_tabstrip.h" 18 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/find_bar/find_bar.h" 20 #include "chrome/browser/ui/find_bar/find_bar.h"
21 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 21 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
22 #include "chrome/browser/ui/panels/base_panel_browser_test.h" 22 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
23 #include "chrome/browser/ui/panels/docked_panel_strip.h" 23 #include "chrome/browser/ui/panels/docked_panel_strip.h"
24 #include "chrome/browser/ui/panels/native_panel.h" 24 #include "chrome/browser/ui/panels/native_panel.h"
25 #include "chrome/browser/ui/panels/panel.h" 25 #include "chrome/browser/ui/panels/panel.h"
26 #include "chrome/browser/ui/panels/panel_manager.h" 26 #include "chrome/browser/ui/panels/panel_manager.h"
27 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h"
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
29 #include "chrome/browser/web_applications/web_app.h" 28 #include "chrome/browser/web_applications/web_app.h"
30 #include "chrome/common/chrome_notification_types.h" 29 #include "chrome/common/chrome_notification_types.h"
31 #include "chrome/common/extensions/extension_manifest_constants.h" 30 #include "chrome/common/extensions/extension_manifest_constants.h"
32 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
34 #include "chrome/test/base/ui_test_utils.h" 33 #include "chrome/test/base/ui_test_utils.h"
35 #include "content/public/browser/download_manager.h" 34 #include "content/public/browser/download_manager.h"
36 #include "content/public/browser/native_web_keyboard_event.h" 35 #include "content/public/browser/native_web_keyboard_event.h"
37 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/web_contents.h" 37 #include "content/public/browser/web_contents.h"
39 #include "content/public/common/url_constants.h" 38 #include "content/public/common/url_constants.h"
40 #include "content/public/test/browser_test_utils.h" 39 #include "content/public/test/browser_test_utils.h"
41 #include "content/test/net/url_request_mock_http_job.h" 40 #include "content/test/net/url_request_mock_http_job.h"
42 #include "net/base/net_util.h" 41 #include "net/base/net_util.h"
43 #include "testing/gtest/include/gtest/gtest.h" 42 #include "testing/gtest/include/gtest/gtest.h"
44 #include "ui/gfx/screen.h" 43 #include "ui/gfx/screen.h"
45 44
45 // Refactor has only been done for Win and Mac panels so far.
46 #if defined(OS_WIN) || defined(OS_MACOSX)
47
46 using content::BrowserContext; 48 using content::BrowserContext;
47 using content::BrowserThread; 49 using content::BrowserThread;
48 using content::DownloadItem; 50 using content::DownloadItem;
49 using content::DownloadManager; 51 using content::DownloadManager;
50 using content::WebContents; 52 using content::WebContents;
51 using extensions::Extension; 53 using extensions::Extension;
52 54
53 class PanelBrowserTest : public BasePanelBrowserTest { 55 class PanelBrowserTest : public BasePanelBrowserTest {
54 public: 56 public:
55 PanelBrowserTest() : BasePanelBrowserTest() { 57 PanelBrowserTest() : BasePanelBrowserTest() {
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 WaitForExpansionStateChanged(panel, Panel::MINIMIZED); 1268 WaitForExpansionStateChanged(panel, Panel::MINIMIZED);
1267 1269
1268 panel->Close(); 1270 panel->Close();
1269 } 1271 }
1270 1272
1271 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FocusLostOnMinimize) { 1273 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FocusLostOnMinimize) {
1272 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); 1274 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE);
1273 Panel* panel = CreatePanelWithParams(params); 1275 Panel* panel = CreatePanelWithParams(params);
1274 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); 1276 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state());
1275 1277
1276 PanelActiveStateObserver signal(panel, false); 1278 panel->SetExpansionState(Panel::MINIMIZED);
1277 panel->Minimize(); 1279 MessageLoop::current()->RunAllPending();
1278 signal.Wait(); 1280 WaitForPanelActiveState(panel, SHOW_AS_INACTIVE);
1279 panel->Close(); 1281 panel->Close();
1280 } 1282 }
1281 1283
1282 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateInactiveSwitchToActive) { 1284 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateInactiveSwitchToActive) {
1283 // Compiz will not activate initially inactive window. 1285 // Compiz will not activate initially inactive window.
1284 if (SkipTestIfCompizWM()) 1286 if (SkipTestIfCompizWM())
1285 return; 1287 return;
1286 1288
1287 CreatePanelParams params("Initially Inactive", gfx::Rect(), SHOW_AS_INACTIVE); 1289 CreatePanelParams params("Initially Inactive", gfx::Rect(), SHOW_AS_INACTIVE);
1288 Panel* panel = CreatePanelWithParams(params); 1290 Panel* panel = CreatePanelWithParams(params);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 content::NativeWebKeyboardEvent key_event(key_msg); 1586 content::NativeWebKeyboardEvent key_event(key_msg);
1585 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; 1587 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey;
1586 #else 1588 #else
1587 content::NativeWebKeyboardEvent key_event; 1589 content::NativeWebKeyboardEvent key_event;
1588 #endif 1590 #endif
1589 panel->HandleKeyboardEvent(key_event); 1591 panel->HandleKeyboardEvent(key_event);
1590 signal.Wait(); 1592 signal.Wait();
1591 EXPECT_EQ(0, panel_manager->num_panels()); 1593 EXPECT_EQ(0, panel_manager->num_panels());
1592 } 1594 }
1593 1595
1596 #endif // OS_WIN || OS_MACOSX
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698