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

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

Issue 251933005: [ChromeDriver] Support mobile emulation on desktop Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix implicit bool conversion warning Created 6 years, 7 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: chrome/test/chromedriver/chrome/devtools_http_client.cc
diff --git a/chrome/test/chromedriver/chrome/devtools_http_client.cc b/chrome/test/chromedriver/chrome/devtools_http_client.cc
index 2d380a8490ba2b4a581591b06d779e8b079ca2ff..99ff9456419251dd0862b50a23b57cdcd39edb00 100644
--- a/chrome/test/chromedriver/chrome/devtools_http_client.cc
+++ b/chrome/test/chromedriver/chrome/devtools_http_client.cc
@@ -13,6 +13,7 @@
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "chrome/test/chromedriver/chrome/device_metrics.h"
#include "chrome/test/chromedriver/chrome/devtools_client_impl.h"
#include "chrome/test/chromedriver/chrome/log.h"
#include "chrome/test/chromedriver/chrome/status.h"
@@ -67,12 +68,14 @@ const WebViewInfo* WebViewsInfo::GetForId(const std::string& id) const {
DevToolsHttpClient::DevToolsHttpClient(
const NetAddress& address,
scoped_refptr<URLRequestContextGetter> context_getter,
- const SyncWebSocketFactory& socket_factory)
+ const SyncWebSocketFactory& socket_factory,
+ scoped_ptr<DeviceMetrics> device_metrics)
: context_getter_(context_getter),
socket_factory_(socket_factory),
server_url_("http://" + address.ToString()),
web_socket_url_prefix_(base::StringPrintf(
- "ws://%s/devtools/page/", address.ToString().c_str())) {}
+ "ws://%s/devtools/page/", address.ToString().c_str())),
+ device_metrics_(device_metrics.Pass()) {}
DevToolsHttpClient::~DevToolsHttpClient() {}
@@ -196,6 +199,10 @@ const BrowserInfo* DevToolsHttpClient::browser_info() {
return &browser_info_;
}
+const DeviceMetrics* DevToolsHttpClient::device_metrics() {
+ return device_metrics_.get();
+}
+
Status DevToolsHttpClient::GetVersion(std::string* browser_version,
std::string* blink_version) {
std::string data;
@@ -248,7 +255,7 @@ Status DevToolsHttpClient::CloseFrontends(const std::string& for_client_id) {
*it,
base::Bind(&FakeCloseFrontends)));
scoped_ptr<WebViewImpl> web_view(
- new WebViewImpl(*it, &browser_info_, client.Pass()));
+ new WebViewImpl(*it, &browser_info_, client.Pass(), NULL));
status = web_view->ConnectIfNecessary();
// Ignore disconnected error, because the debugger might have closed when
« no previous file with comments | « chrome/test/chromedriver/chrome/devtools_http_client.h ('k') | chrome/test/chromedriver/chrome/mobile_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698