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

Unified Diff: chrome/test/chromedriver/chrome_launcher_impl.cc

Issue 11415205: [chromedriver] Implement connecting to devtools and loading a page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years 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
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher_impl.h ('k') | chrome/test/chromedriver/chromedriver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome_launcher_impl.cc
diff --git a/chrome/test/chromedriver/chrome_launcher_impl.cc b/chrome/test/chromedriver/chrome_launcher_impl.cc
index 3e124fbfd6c59372ce4be42bb7d5edd0241ac4a3..ee484ab3840eb8f84ca557aaf15dc29a1fd54d1e 100644
--- a/chrome/test/chromedriver/chrome_launcher_impl.cc
+++ b/chrome/test/chromedriver/chrome_launcher_impl.cc
@@ -10,12 +10,15 @@
#include "base/file_path.h"
#include "base/process.h"
#include "base/process_util.h"
+#include "base/string_number_conversions.h"
#include "chrome/test/chromedriver/chrome.h"
#include "chrome/test/chromedriver/chrome_finder.h"
#include "chrome/test/chromedriver/chrome_impl.h"
+#include "chrome/test/chromedriver/net/url_request_context_getter.h"
#include "chrome/test/chromedriver/status.h"
-ChromeLauncherImpl::ChromeLauncherImpl() {}
+ChromeLauncherImpl::ChromeLauncherImpl(URLRequestContextGetter* context_getter)
+ : context_getter_(context_getter) {}
ChromeLauncherImpl::~ChromeLauncherImpl() {}
@@ -28,7 +31,10 @@ Status ChromeLauncherImpl::Launch(
return Status(kUnknownError, "cannot find Chrome binary");
}
+ int port = 33081;
CommandLine command(program);
+ command.AppendSwitchASCII("remote-debugging-port", base::IntToString(port));
+ command.AppendSwitch("no-first-run");
command.AppendSwitch("enable-logging");
command.AppendSwitchASCII("logging-level", "1");
base::ScopedTempDir user_data_dir;
@@ -41,7 +47,11 @@ Status ChromeLauncherImpl::Launch(
base::ProcessHandle process;
if (!base::LaunchProcess(command, options, &process))
return Status(kUnknownError, "chrome failed to start");
- chrome->reset(new ChromeImpl(process, &user_data_dir));
-
+ scoped_ptr<ChromeImpl> chrome_impl(new ChromeImpl(
+ process, context_getter_, &user_data_dir, port));
+ Status status = chrome_impl->Init();
+ if (status.IsError())
+ return status;
+ chrome->reset(chrome_impl.release());
return Status(kOk);
}
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher_impl.h ('k') | chrome/test/chromedriver/chromedriver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698