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

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

Issue 8985008: Don't use browser windows for platform app shell windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add view type, handle window closing. Created 9 years 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/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)
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos) 1086 EXPECT_NE(app_name.find(extension_app->id()), std::string::npos)
1087 << "Name " << app_name << " should contain id "<< extension_app->id(); 1087 << "Name " << app_name << " should contain id "<< extension_app->id();
1088 } 1088 }
1089 #endif // !defined(OS_MACOSX) 1089 #endif // !defined(OS_MACOSX)
1090 1090
1091 // Makes sure the browser doesn't crash when 1091 // Makes sure the browser doesn't crash when
1092 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked. 1092 // set_show_state(ui::SHOW_STATE_MAXIMIZED) has been invoked.
1093 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) { 1093 IN_PROC_BROWSER_TEST_F(BrowserTest, StartMaximized) {
1094 // Can't test TYPE_PANEL as they are currently created differently (and can't 1094 // Can't test TYPE_PANEL as they are currently created differently (and can't
1095 // end up maximized). 1095 // end up maximized).
1096 Browser::Type types[] = 1096 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP };
1097 { Browser::TYPE_TABBED, Browser::TYPE_POPUP, Browser::TYPE_SHELL };
1098 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { 1097 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) {
1099 Browser* max_browser = new Browser(types[i], browser()->profile()); 1098 Browser* max_browser = new Browser(types[i], browser()->profile());
1100 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED); 1099 max_browser->set_show_state(ui::SHOW_STATE_MAXIMIZED);
1101 max_browser->InitBrowserWindow(); 1100 max_browser->InitBrowserWindow();
1102 AddBlankTabAndShow(max_browser); 1101 AddBlankTabAndShow(max_browser);
1103 } 1102 }
1104 } 1103 }
1105 1104
1106 // Aura doesn't support minimized window. crbug.com/104571. 1105 // Aura doesn't support minimized window. crbug.com/104571.
1107 #if defined(USE_AURA) 1106 #if defined(USE_AURA)
1108 #define MAYBE_StartMinimized DISABLED_StartMinimized 1107 #define MAYBE_StartMinimized DISABLED_StartMinimized
1109 #else 1108 #else
1110 #define MAYBE_StartMinimized StartMinimized 1109 #define MAYBE_StartMinimized StartMinimized
1111 #endif 1110 #endif
1112 // Makes sure the browser doesn't crash when 1111 // Makes sure the browser doesn't crash when
1113 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked. 1112 // set_show_state(ui::SHOW_STATE_MINIMIZED) has been invoked.
1114 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) { 1113 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_StartMinimized) {
1115 // Can't test TYPE_PANEL as they are currently created differently (and can't 1114 // Can't test TYPE_PANEL as they are currently created differently (and can't
1116 // end up minimized). 1115 // end up minimized).
1117 Browser::Type types[] = 1116 Browser::Type types[] = { Browser::TYPE_TABBED, Browser::TYPE_POPUP };
1118 { Browser::TYPE_TABBED, Browser::TYPE_POPUP, Browser::TYPE_SHELL };
1119 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) { 1117 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(types); ++i) {
1120 Browser* min_browser = new Browser(types[i], browser()->profile()); 1118 Browser* min_browser = new Browser(types[i], browser()->profile());
1121 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED); 1119 min_browser->set_show_state(ui::SHOW_STATE_MINIMIZED);
1122 min_browser->InitBrowserWindow(); 1120 min_browser->InitBrowserWindow();
1123 AddBlankTabAndShow(min_browser); 1121 AddBlankTabAndShow(min_browser);
1124 } 1122 }
1125 } 1123 }
1126 1124
1127 // Makes sure the forward button is disabled immediately when navigating 1125 // Makes sure the forward button is disabled immediately when navigating
1128 // forward to a slow-to-commit page. 1126 // forward to a slow-to-commit page.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 1391
1394 // The normal browser should now have four. 1392 // The normal browser should now have four.
1395 EXPECT_EQ(4, browser()->tab_count()); 1393 EXPECT_EQ(4, browser()->tab_count());
1396 1394
1397 // Close the additional browsers. 1395 // Close the additional browsers.
1398 popup_browser->CloseAllTabs(); 1396 popup_browser->CloseAllTabs();
1399 app_browser->CloseAllTabs(); 1397 app_browser->CloseAllTabs();
1400 app_popup_browser->CloseAllTabs(); 1398 app_popup_browser->CloseAllTabs();
1401 } 1399 }
1402 #endif 1400 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698