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

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

Issue 7748036: Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetSavedWindowPlacement consolidation, Test, and All case. 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
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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 // end up maximized). 808 // end up maximized).
809 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP }; 809 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP };
810 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { 810 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) {
811 Browser* max_browser = new Browser(types[i], browser()->profile()); 811 Browser* max_browser = new Browser(types[i], browser()->profile());
812 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); 812 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED);
813 max_browser->InitBrowserWindow(); 813 max_browser->InitBrowserWindow();
814 AddBlankTabAndShow(max_browser); 814 AddBlankTabAndShow(max_browser);
815 } 815 }
816 } 816 }
817 817
818 // Makes sure the browser doesn't crash when
819 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked.
820 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMinimized) {
821 // Can't test TYPE_PANEL as they are currently created differently (and can't
822 // end up minimized).
823 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP };
824 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) {
825 Browser* min_browser = new Browser(types[i], browser()->profile());
826 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED);
827 min_browser->InitBrowserWindow();
828 AddBlankTabAndShow(min_browser);
829 }
830 }
831
818 // TODO(ben): this test was never enabled. It has bit-rotted since being added. 832 // TODO(ben): this test was never enabled. It has bit-rotted since being added.
819 // It originally lived in browser_unittest.cc, but has been moved here to make 833 // It originally lived in browser_unittest.cc, but has been moved here to make
820 // room for real browser unit tests. 834 // room for real browser unit tests.
821 #if 0 835 #if 0
822 class BrowserTest2 : public InProcessBrowserTest { 836 class BrowserTest2 : public InProcessBrowserTest {
823 public: 837 public:
824 BrowserTest2() { 838 BrowserTest2() {
825 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); 839 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
826 // Avoid making external DNS lookups. In this test we don't need this 840 // Avoid making external DNS lookups. In this test we don't need this
827 // to succeed. 841 // to succeed.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 906
893 // The normal browser should now have four. 907 // The normal browser should now have four.
894 EXPECT_EQ(4, browser()->tab_count()); 908 EXPECT_EQ(4, browser()->tab_count());
895 909
896 // Close the additional browsers. 910 // Close the additional browsers.
897 popup_browser->CloseAllTabs(); 911 popup_browser->CloseAllTabs();
898 app_browser->CloseAllTabs(); 912 app_browser->CloseAllTabs();
899 app_popup_browser->CloseAllTabs(); 913 app_popup_browser->CloseAllTabs();
900 } 914 }
901 #endif 915 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698