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

Side by Side Diff: chrome/test/base/in_process_browser_test.cc

Issue 9968078: Honor window size for chrome.windows.create when parent window is maximized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extraneous logging Created 8 years, 8 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) 2012 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 "chrome/test/base/in_process_browser_test.h" 5 #include "chrome/test/base/in_process_browser_test.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/stack_trace.h" 10 #include "base/debug/stack_trace.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 Browser* InProcessBrowserTest::CreateIncognitoBrowser() { 237 Browser* InProcessBrowserTest::CreateIncognitoBrowser() {
238 // Create a new browser with using the incognito profile. 238 // Create a new browser with using the incognito profile.
239 Browser* incognito = 239 Browser* incognito =
240 Browser::Create(browser()->profile()->GetOffTheRecordProfile()); 240 Browser::Create(browser()->profile()->GetOffTheRecordProfile());
241 AddBlankTabAndShow(incognito); 241 AddBlankTabAndShow(incognito);
242 return incognito; 242 return incognito;
243 } 243 }
244 244
245 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { 245 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) {
246 Browser* browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); 246 Browser* browser = Browser::CreateWithParams(
247 Browser::CreateParams(Browser::TYPE_POPUP, profile));
247 AddBlankTabAndShow(browser); 248 AddBlankTabAndShow(browser);
248 return browser; 249 return browser;
249 } 250 }
250 251
251 Browser* InProcessBrowserTest::CreateBrowserForApp( 252 Browser* InProcessBrowserTest::CreateBrowserForApp(
252 const std::string& app_name, 253 const std::string& app_name,
253 Profile* profile) { 254 Profile* profile) {
254 Browser* browser = Browser::CreateForApp( 255 Browser* browser = Browser::CreateWithParams(
255 Browser::TYPE_POPUP, 256 Browser::CreateParams::CreateForApp(
256 app_name, 257 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile));
257 gfx::Rect(),
258 profile);
259 AddBlankTabAndShow(browser); 258 AddBlankTabAndShow(browser);
260 return browser; 259 return browser;
261 } 260 }
262 261
263 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { 262 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) {
264 ui_test_utils::WindowedNotificationObserver observer( 263 ui_test_utils::WindowedNotificationObserver observer(
265 content::NOTIFICATION_LOAD_STOP, 264 content::NOTIFICATION_LOAD_STOP,
266 content::NotificationService::AllSources()); 265 content::NotificationService::AllSources());
267 browser->AddSelectedTabWithURL( 266 browser->AddSelectedTabWithURL(
268 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); 267 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 if (BrowserList::size() == 0) 344 if (BrowserList::size() == 0)
346 return; 345 return;
347 346
348 // Invoke CloseAllBrowsersAndMayExit on a running message loop. 347 // Invoke CloseAllBrowsersAndMayExit on a running message loop.
349 // CloseAllBrowsersAndMayExit exits the message loop after everything has been 348 // CloseAllBrowsersAndMayExit exits the message loop after everything has been
350 // shut down properly. 349 // shut down properly.
351 MessageLoopForUI::current()->PostTask(FROM_HERE, 350 MessageLoopForUI::current()->PostTask(FROM_HERE,
352 base::Bind(&BrowserList::AttemptExit)); 351 base::Bind(&BrowserList::AttemptExit));
353 ui_test_utils::RunMessageLoop(); 352 ui_test_utils::RunMessageLoop();
354 } 353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698