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

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

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « chrome/test/base/in_process_browser_test.h ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 void InProcessBrowserTest::QuitBrowsers() { 373 void InProcessBrowserTest::QuitBrowsers() {
374 if (BrowserList::empty()) 374 if (BrowserList::empty())
375 return; 375 return;
376 376
377 // Invoke AttemptExit on a running message loop. 377 // Invoke AttemptExit on a running message loop.
378 // AttemptExit exits the message loop after everything has been 378 // AttemptExit exits the message loop after everything has been
379 // shut down properly. 379 // shut down properly.
380 MessageLoopForUI::current()->PostTask(FROM_HERE, 380 MessageLoopForUI::current()->PostTask(FROM_HERE,
381 base::Bind(&browser::AttemptExit)); 381 base::Bind(&browser::AttemptExit));
382 ui_test_utils::RunMessageLoop(); 382 content::RunMessageLoop();
383 383
384 #if defined(OS_MACOSX) 384 #if defined(OS_MACOSX)
385 // browser::AttemptExit() will attempt to close all browsers by deleting 385 // browser::AttemptExit() will attempt to close all browsers by deleting
386 // their tab contents. The last tab contents being removed triggers closing of 386 // their tab contents. The last tab contents being removed triggers closing of
387 // the browser window. 387 // the browser window.
388 // 388 //
389 // On the Mac, this eventually reaches 389 // On the Mac, this eventually reaches
390 // -[BrowserWindowController windowWillClose:], which will post a deferred 390 // -[BrowserWindowController windowWillClose:], which will post a deferred
391 // -autorelease on itself to ultimately destroy the Browser object. The line 391 // -autorelease on itself to ultimately destroy the Browser object. The line
392 // below is necessary to pump these pending messages to ensure all Browsers 392 // below is necessary to pump these pending messages to ensure all Browsers
393 // get deleted. 393 // get deleted.
394 ui_test_utils::RunAllPendingInMessageLoop(); 394 ui_test_utils::RunAllPendingInMessageLoop();
395 delete autorelease_pool_; 395 delete autorelease_pool_;
396 autorelease_pool_ = NULL; 396 autorelease_pool_ = NULL;
397 #endif 397 #endif
398 } 398 }
OLDNEW
« no previous file with comments | « chrome/test/base/in_process_browser_test.h ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698