OLD | NEW |
1 // Copyright (c) 2011 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/file_path.h" | 9 #include "base/file_path.h" |
10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
11 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos) | 1109 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos) |
1110 << "Name " << app_name << " should contain id "<< extension_app->id(); | 1110 << "Name " << app_name << " should contain id "<< extension_app->id(); |
1111 } | 1111 } |
1112 #endif // !defined(OS_MACOSX) | 1112 #endif // !defined(OS_MACOSX) |
1113 | 1113 |
1114 // Makes sure the browser doesn't crash when | 1114 // Makes sure the browser doesn't crash when |
1115 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked. | 1115 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked. |
1116 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) { | 1116 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) { |
1117 // Can't test TYPE_PANEL as they are currently created differently (and can't | 1117 // Can't test TYPE_PANEL as they are currently created differently (and can't |
1118 // end up maximized). | 1118 // end up maximized). |
1119 Browser::Type types[] = | 1119 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
1120 { Browser::TYPE_TABBED, Browser::TYPE_POPUP, Browser::TYPE_SHELL }; | |
1121 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { | 1120 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
1122 Browser* max_browser = new Browser(types[i], browser()->profile()); | 1121 Browser* max_browser = new Browser(types[i], browser()->profile()); |
1123 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); | 1122 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); |
1124 max_browser->InitBrowserWindow(); | 1123 max_browser->InitBrowserWindow(); |
1125 AddBlankTabAndShow(max_browser); | 1124 AddBlankTabAndShow(max_browser); |
1126 } | 1125 } |
1127 } | 1126 } |
1128 | 1127 |
1129 // Aura doesn't support minimized window. crbug.com/104571. | 1128 // Aura doesn't support minimized window. crbug.com/104571. |
1130 #if defined(USE_AURA) | 1129 #if defined(USE_AURA) |
1131 #define MAYBE_StartMinimized DISABLED_StartMinimized | 1130 #define MAYBE_StartMinimized DISABLED_StartMinimized |
1132 #else | 1131 #else |
1133 #define MAYBE_StartMinimized StartMinimized | 1132 #define MAYBE_StartMinimized StartMinimized |
1134 #endif | 1133 #endif |
1135 // Makes sure the browser doesn't crash when | 1134 // Makes sure the browser doesn't crash when |
1136 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. | 1135 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. |
1137 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) { | 1136 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) { |
1138 // Can't test TYPE_PANEL as they are currently created differently (and can't | 1137 // Can't test TYPE_PANEL as they are currently created differently (and can't |
1139 // end up minimized). | 1138 // end up minimized). |
1140 Browser::Type types[] = | 1139 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
1141 { Browser::TYPE_TABBED, Browser::TYPE_POPUP, Browser::TYPE_SHELL }; | |
1142 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { | 1140 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
1143 Browser* min_browser = new Browser(types[i], browser()->profile()); | 1141 Browser* min_browser = new Browser(types[i], browser()->profile()); |
1144 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED); | 1142 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED); |
1145 min_browser->InitBrowserWindow(); | 1143 min_browser->InitBrowserWindow(); |
1146 AddBlankTabAndShow(min_browser); | 1144 AddBlankTabAndShow(min_browser); |
1147 } | 1145 } |
1148 } | 1146 } |
1149 | 1147 |
1150 // Makes sure the forward button is disabled immediately when navigating | 1148 // Makes sure the forward button is disabled immediately when navigating |
1151 // forward to a slow-to-commit page. | 1149 // forward to a slow-to-commit page. |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 | 1457 |
1460 // The normal browser should now have four. | 1458 // The normal browser should now have four. |
1461 EXPECT_EQ(4, browser()->tab_count()); | 1459 EXPECT_EQ(4, browser()->tab_count()); |
1462 | 1460 |
1463 // Close the additional browsers. | 1461 // Close the additional browsers. |
1464 popup_browser->CloseAllTabs(); | 1462 popup_browser->CloseAllTabs(); |
1465 app_browser->CloseAllTabs(); | 1463 app_browser->CloseAllTabs(); |
1466 app_popup_browser->CloseAllTabs(); | 1464 app_popup_browser->CloseAllTabs(); |
1467 } | 1465 } |
1468 #endif | 1466 #endif |
OLD | NEW |