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

Unified Diff: chromecast/shell/browser/cast_browser_main_parts.cc

Issue 518773003: Chromecast: end-to-end browser test based on content::BrowserTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cast-browser-process
Patch Set: rebase Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/shell/browser/cast_browser_main_parts.cc
diff --git a/chromecast/shell/browser/cast_browser_main_parts.cc b/chromecast/shell/browser/cast_browser_main_parts.cc
index 24e134277b477b8128e37ded0cabdebb53aa728b..c7f19028f08f1680d94aa50ea0e9adbb5f98b0d4 100644
--- a/chromecast/shell/browser/cast_browser_main_parts.cc
+++ b/chromecast/shell/browser/cast_browser_main_parts.cc
@@ -56,6 +56,7 @@ CastBrowserMainParts::CastBrowserMainParts(
URLRequestContextFactory* url_request_context_factory)
: BrowserMainParts(),
cast_browser_process_(new CastBrowserProcess()),
+ parameters_(parameters),
url_request_context_factory_(url_request_context_factory) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
AddDefaultCommandLineSwitches(command_line);
@@ -104,7 +105,13 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
}
bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
- base::MessageLoopForUI::current()->Run();
+ // If parameters_.ui_task is not NULL, we are running browser tests. In this
+ // case, the browser's main message loop will not run.
+ if (parameters_.ui_task) {
+ parameters_.ui_task->Run();
+ } else {
+ base::MessageLoopForUI::current()->Run();
+ }
return true;
}
« no previous file with comments | « chromecast/shell/browser/cast_browser_main_parts.h ('k') | chromecast/shell/browser/cast_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698