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

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 7790010: Revert 98679 - Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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:
Deleted: svn:mergeinfo
OLDNEW
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
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
991 // TODO(ben): this test was never enabled. It has bit-rotted since being added. 977 // TODO(ben): this test was never enabled. It has bit-rotted since being added.
992 // It originally lived in browser_unittest.cc, but has been moved here to make 978 // It originally lived in browser_unittest.cc, but has been moved here to make
993 // room for real browser unit tests. 979 // room for real browser unit tests.
994 #if 0 980 #if 0
995 class BrowserTest2 : public InProcessBrowserTest { 981 class BrowserTest2 : public InProcessBrowserTest {
996 public: 982 public:
997 BrowserTest2() { 983 BrowserTest2() {
998 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); 984 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
999 // Avoid making external DNS lookups. In this test we don't need this 985 // Avoid making external DNS lookups. In this test we don't need this
1000 // to succeed. 986 // to succeed.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 1051
1066 // The normal browser should now have four. 1052 // The normal browser should now have four.
1067 EXPECT_EQ(4, browser()->tab_count()); 1053 EXPECT_EQ(4, browser()->tab_count());
1068 1054
1069 // Close the additional browsers. 1055 // Close the additional browsers.
1070 popup_browser->CloseAllTabs(); 1056 popup_browser->CloseAllTabs();
1071 app_browser->CloseAllTabs(); 1057 app_browser->CloseAllTabs();
1072 app_popup_browser->CloseAllTabs(); 1058 app_popup_browser->CloseAllTabs();
1073 } 1059 }
1074 #endif 1060 #endif
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698