OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 // end up maximized). | 967 // end up maximized). |
968 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; | 968 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
969 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { | 969 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
970 Browser* max_browser = new Browser(types[i], browser()->profile()); | 970 Browser* max_browser = new Browser(types[i], browser()->profile()); |
971 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); | 971 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); |
972 max_browser->InitBrowserWindow(); | 972 max_browser->InitBrowserWindow(); |
973 AddBlankTabAndShow(max_browser); | 973 AddBlankTabAndShow(max_browser); |
974 } | 974 } |
975 } | 975 } |
976 | 976 |
| 977 // Makes sure the browser doesn't crash when |
| 978 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. |
| 979 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMinimized) { |
| 980 // Can't test TYPE_PANEL as they are currently created differently (and can't |
| 981 // end up minimized). |
| 982 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; |
| 983 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { |
| 984 Browser* min_browser = new Browser(types[i], browser()->profile()); |
| 985 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED); |
| 986 min_browser->InitBrowserWindow(); |
| 987 AddBlankTabAndShow(min_browser); |
| 988 } |
| 989 } |
| 990 |
977 // TODO(ben): this test was never enabled. It has bit-rotted since being added. | 991 // TODO(ben): this test was never enabled. It has bit-rotted since being added. |
978 // It originally lived in browser_unittest.cc, but has been moved here to make | 992 // It originally lived in browser_unittest.cc, but has been moved here to make |
979 // room for real browser unit tests. | 993 // room for real browser unit tests. |
980 #if 0 | 994 #if 0 |
981 class BrowserTest2 : public InProcessBrowserTest { | 995 class BrowserTest2 : public InProcessBrowserTest { |
982 public: | 996 public: |
983 BrowserTest2() { | 997 BrowserTest2() { |
984 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); | 998 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); |
985 // Avoid making external DNS lookups. In this test we don't need this | 999 // Avoid making external DNS lookups. In this test we don't need this |
986 // to succeed. | 1000 // to succeed. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 | 1065 |
1052 // The normal browser should now have four. | 1066 // The normal browser should now have four. |
1053 EXPECT_EQ(4, browser()->tab_count()); | 1067 EXPECT_EQ(4, browser()->tab_count()); |
1054 | 1068 |
1055 // Close the additional browsers. | 1069 // Close the additional browsers. |
1056 popup_browser->CloseAllTabs(); | 1070 popup_browser->CloseAllTabs(); |
1057 app_browser->CloseAllTabs(); | 1071 app_browser->CloseAllTabs(); |
1058 app_popup_browser->CloseAllTabs(); | 1072 app_popup_browser->CloseAllTabs(); |
1059 } | 1073 } |
1060 #endif | 1074 #endif |
OLD | NEW |