OLD | NEW |
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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 const BrowserList* active_browser_list = | 386 const BrowserList* active_browser_list = |
387 BrowserList::GetInstance(active_desktop); | 387 BrowserList::GetInstance(active_desktop); |
388 if (!active_browser_list->empty()) { | 388 if (!active_browser_list->empty()) { |
389 browser_ = active_browser_list->get(0); | 389 browser_ = active_browser_list->get(0); |
390 #if defined(USE_ASH) | 390 #if defined(USE_ASH) |
391 // There are cases where windows get created maximized by default. | 391 // There are cases where windows get created maximized by default. |
392 if (browser_->window()->IsMaximized()) | 392 if (browser_->window()->IsMaximized()) |
393 browser_->window()->Restore(); | 393 browser_->window()->Restore(); |
394 #endif | 394 #endif |
395 content::WaitForLoadStop( | 395 content::WebContents* web_contents = |
396 browser_->tab_strip_model()->GetActiveWebContents()); | 396 browser_->tab_strip_model()->GetActiveWebContents(); |
| 397 content::WaitForLoadStop(web_contents); |
| 398 content::WaitForResizeComplete(web_contents); |
397 } | 399 } |
398 | 400 |
399 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 401 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
400 // Do not use the real StorageMonitor for tests, which introduces another | 402 // Do not use the real StorageMonitor for tests, which introduces another |
401 // source of variability and potential slowness. | 403 // source of variability and potential slowness. |
402 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateForBrowserTests()); | 404 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateForBrowserTests()); |
403 #endif | 405 #endif |
404 | 406 |
405 #if defined(OS_MACOSX) | 407 #if defined(OS_MACOSX) |
406 // On Mac, without the following autorelease pool, code which is directly | 408 // On Mac, without the following autorelease pool, code which is directly |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 // On the Mac, this eventually reaches | 473 // On the Mac, this eventually reaches |
472 // -[BrowserWindowController windowWillClose:], which will post a deferred | 474 // -[BrowserWindowController windowWillClose:], which will post a deferred |
473 // -autorelease on itself to ultimately destroy the Browser object. The line | 475 // -autorelease on itself to ultimately destroy the Browser object. The line |
474 // below is necessary to pump these pending messages to ensure all Browsers | 476 // below is necessary to pump these pending messages to ensure all Browsers |
475 // get deleted. | 477 // get deleted. |
476 content::RunAllPendingInMessageLoop(); | 478 content::RunAllPendingInMessageLoop(); |
477 delete autorelease_pool_; | 479 delete autorelease_pool_; |
478 autorelease_pool_ = NULL; | 480 autorelease_pool_ = NULL; |
479 #endif | 481 #endif |
480 } | 482 } |
OLD | NEW |