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

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: build fix :( Created 6 years, 4 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 3f7b358349eab5b9963073d880ef7d9f71bff842..c3525a9c6005faee0145ccc8cba0d4952687aab3 100644
--- a/chromecast/shell/browser/cast_browser_main_parts.cc
+++ b/chromecast/shell/browser/cast_browser_main_parts.cc
@@ -51,6 +51,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);
@@ -92,7 +93,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;
}

Powered by Google App Engine
This is Rietveld 408576698