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

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

Issue 330113002: Fixing flaky overscroll and touch exploration mode browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 6 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
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/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
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 // The RenderView for WebContents is created as a result of the navigation
399 // to the New Tab page. The creation involves sending a resize message to
400 // the renderer process. Here we wait for the resize ack to be received,
401 // since tests may not expect to start in a "waiting for resize" state.
402 // E.g. currently WindowEventDispatcher has code to hold touch and mouse
403 // move events until resize is complete (crbug.com/384342)
404 content::WaitForResizeComplete(web_contents);
397 } 405 }
398 406
399 #if !defined(OS_ANDROID) && !defined(OS_IOS) 407 #if !defined(OS_ANDROID) && !defined(OS_IOS)
400 // Do not use the real StorageMonitor for tests, which introduces another 408 // Do not use the real StorageMonitor for tests, which introduces another
401 // source of variability and potential slowness. 409 // source of variability and potential slowness.
402 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateForBrowserTests()); 410 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateForBrowserTests());
403 #endif 411 #endif
404 412
405 #if defined(OS_MACOSX) 413 #if defined(OS_MACOSX)
406 // On Mac, without the following autorelease pool, code which is directly 414 // On Mac, without the following autorelease pool, code which is directly
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // On the Mac, this eventually reaches 479 // On the Mac, this eventually reaches
472 // -[BrowserWindowController windowWillClose:], which will post a deferred 480 // -[BrowserWindowController windowWillClose:], which will post a deferred
473 // -autorelease on itself to ultimately destroy the Browser object. The line 481 // -autorelease on itself to ultimately destroy the Browser object. The line
474 // below is necessary to pump these pending messages to ensure all Browsers 482 // below is necessary to pump these pending messages to ensure all Browsers
475 // get deleted. 483 // get deleted.
476 content::RunAllPendingInMessageLoop(); 484 content::RunAllPendingInMessageLoop();
477 delete autorelease_pool_; 485 delete autorelease_pool_;
478 autorelease_pool_ = NULL; 486 autorelease_pool_ = NULL;
479 #endif 487 #endif
480 } 488 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698