OLD | NEW |
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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
15 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 15 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
16 | 16 |
17 #if defined(TOOLKIT_USES_GTK) | |
18 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | |
19 #endif | |
20 | |
21 using content::OpenURLParams; | 17 using content::OpenURLParams; |
22 using content::Referrer; | 18 using content::Referrer; |
23 | 19 |
24 namespace chromeos { | 20 namespace chromeos { |
25 | 21 |
26 class PanelTest : public InProcessBrowserTest { | 22 class PanelTest : public InProcessBrowserTest { |
27 public: | 23 public: |
28 PanelTest() { | 24 PanelTest() { |
29 EnableDOMAutomation(); | 25 EnableDOMAutomation(); |
30 } | 26 } |
(...skipping 30 matching lines...) Expand all Loading... |
61 Browser* new_browser = NULL; | 57 Browser* new_browser = NULL; |
62 for (BrowserList::const_iterator i = BrowserList::begin(); | 58 for (BrowserList::const_iterator i = BrowserList::begin(); |
63 i != BrowserList::end() && !new_browser; ++i) { | 59 i != BrowserList::end() && !new_browser; ++i) { |
64 if (*i != browser()) | 60 if (*i != browser()) |
65 new_browser = *i; | 61 new_browser = *i; |
66 } | 62 } |
67 | 63 |
68 ASSERT_TRUE(new_browser); | 64 ASSERT_TRUE(new_browser); |
69 EXPECT_TRUE(new_browser->is_type_popup()); | 65 EXPECT_TRUE(new_browser->is_type_popup()); |
70 EXPECT_FALSE(new_browser->is_app()); | 66 EXPECT_FALSE(new_browser->is_app()); |
71 | |
72 #if defined(TOOLKIT_USES_GTK) | |
73 // This window type tells the cros window manager to treat the window | |
74 // as a panel. | |
75 EXPECT_EQ( | |
76 WM_IPC_WINDOW_CHROME_PANEL_CONTENT, | |
77 WmIpc::instance()->GetWindowType( | |
78 GTK_WIDGET(new_browser->window()->GetNativeHandle()), NULL)); | |
79 #endif | |
80 } | 67 } |
81 | 68 |
82 #if defined(USE_AURA) | 69 #if defined(USE_AURA) |
83 // crbug.com/105129. | 70 // crbug.com/105129. |
84 #define MAYBE_PanelOpenLarge DISABLED_PanelOpenLarge | 71 #define MAYBE_PanelOpenLarge DISABLED_PanelOpenLarge |
85 #else | 72 #else |
86 #define MAYBE_PanelOpenLarge PanelOpenLarge | 73 #define MAYBE_PanelOpenLarge PanelOpenLarge |
87 #endif | 74 #endif |
88 | 75 |
89 // Large popups should open as new tab. | 76 // Large popups should open as new tab. |
(...skipping 25 matching lines...) Expand all Loading... |
115 if (*i != browser()) | 102 if (*i != browser()) |
116 new_browser = *i; | 103 new_browser = *i; |
117 } | 104 } |
118 EXPECT_FALSE(new_browser); | 105 EXPECT_FALSE(new_browser); |
119 | 106 |
120 // Should find a new tab. | 107 // Should find a new tab. |
121 EXPECT_EQ(old_tab_count + 1, browser()->tab_count()); | 108 EXPECT_EQ(old_tab_count + 1, browser()->tab_count()); |
122 } | 109 } |
123 | 110 |
124 } // namespace chromeos | 111 } // namespace chromeos |
OLD | NEW |