| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 // The browser's app name should include the extension's id. | 1162 // The browser's app name should include the extension's id. |
| 1163 std::string app_name = new_browser->app_name_; | 1163 std::string app_name = new_browser->app_name_; |
| 1164 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos) | 1164 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos) |
| 1165 << "Name " << app_name << " should contain id "<< extension_app->id(); | 1165 << "Name " << app_name << " should contain id "<< extension_app->id(); |
| 1166 } | 1166 } |
| 1167 #endif // !defined(OS_MACOSX) | 1167 #endif // !defined(OS_MACOSX) |
| 1168 | 1168 |
| 1169 // Makes sure the browser doesn't crash when | 1169 // Makes sure the browser doesn't crash when |
| 1170 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked. | 1170 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked. |
| 1171 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) { | 1171 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) { |
| 1172 // Can't test TYPE_PANEL as they are currently created differently (and can't | |
| 1173 // end up maximized). | |
| 1174 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; | 1172 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
| 1175 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { | 1173 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
| 1176 Browser::CreateParams params(types[i], browser()->profile(), | 1174 Browser::CreateParams params(types[i], browser()->profile(), |
| 1177 browser()->host_desktop_type()); | 1175 browser()->host_desktop_type()); |
| 1178 params.initial_show_state = ui::SHOW_STATE_MAXIMIZED; | 1176 params.initial_show_state = ui::SHOW_STATE_MAXIMIZED; |
| 1179 AddBlankTabAndShow(new Browser(params)); | 1177 AddBlankTabAndShow(new Browser(params)); |
| 1180 } | 1178 } |
| 1181 } | 1179 } |
| 1182 | 1180 |
| 1183 // Aura doesn't support minimized window. crbug.com/104571. | 1181 // Aura doesn't support minimized window. crbug.com/104571. |
| 1184 #if defined(USE_AURA) | 1182 #if defined(USE_AURA) |
| 1185 #define MAYBE_StartMinimized DISABLED_StartMinimized | 1183 #define MAYBE_StartMinimized DISABLED_StartMinimized |
| 1186 #else | 1184 #else |
| 1187 #define MAYBE_StartMinimized StartMinimized | 1185 #define MAYBE_StartMinimized StartMinimized |
| 1188 #endif | 1186 #endif |
| 1189 // Makes sure the browser doesn't crash when | 1187 // Makes sure the browser doesn't crash when |
| 1190 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. | 1188 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. |
| 1191 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) { | 1189 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) { |
| 1192 // Can't test TYPE_PANEL as they are currently created differently (and can't | |
| 1193 // end up minimized). | |
| 1194 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; | 1190 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
| 1195 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { | 1191 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
| 1196 Browser::CreateParams params(types[i], browser()->profile(), | 1192 Browser::CreateParams params(types[i], browser()->profile(), |
| 1197 browser()->host_desktop_type()); | 1193 browser()->host_desktop_type()); |
| 1198 params.initial_show_state = ui::SHOW_STATE_MINIMIZED; | 1194 params.initial_show_state = ui::SHOW_STATE_MINIMIZED; |
| 1199 AddBlankTabAndShow(new Browser(params)); | 1195 AddBlankTabAndShow(new Browser(params)); |
| 1200 } | 1196 } |
| 1201 } | 1197 } |
| 1202 | 1198 |
| 1203 // Makes sure the forward button is disabled immediately when navigating | 1199 // Makes sure the forward button is disabled immediately when navigating |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2099 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2104 } | 2100 } |
| 2105 | 2101 |
| 2106 // Shift-middle-clicks open in a foreground tab. | 2102 // Shift-middle-clicks open in a foreground tab. |
| 2107 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { | 2103 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { |
| 2108 int modifiers = WebKit::WebInputEvent::ShiftKey; | 2104 int modifiers = WebKit::WebInputEvent::ShiftKey; |
| 2109 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 2105 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
| 2110 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2106 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2111 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2107 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2112 } | 2108 } |
| OLD | NEW |