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

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

Issue 15393005: [chromedriver] Remove unnecessary round trips to Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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
« no previous file with comments | « chrome/test/chromedriver/chrome/web_view_impl.h ('k') | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/web_view_impl.cc
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.cc b/chrome/test/chromedriver/chrome/web_view_impl.cc
index 3a137842284a3938847142b6a7d72031034757a9..4a25e090256ca11cd7f53e7fc7bce6861e101f51 100644
--- a/chrome/test/chromedriver/chrome/web_view_impl.cc
+++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -106,6 +106,10 @@ Status WebViewImpl::ConnectIfNecessary() {
return client_->ConnectIfNecessary();
}
+DevToolsClient* WebViewImpl::GetDevToolsClient() {
+ return client_.get();
+}
+
Status WebViewImpl::Load(const std::string& url) {
base::DictionaryValue params;
params.SetString("url", url);
@@ -250,43 +254,19 @@ Status WebViewImpl::DeleteCookie(const std::string& name,
}
Status WebViewImpl::WaitForPendingNavigations(const std::string& frame_id) {
- std::string full_frame_id(frame_id);
- if (full_frame_id.empty()) {
- Status status = GetMainFrame(&full_frame_id);
- if (status.IsError())
- return status;
- }
log_->AddEntry(Log::kLog, "waiting for pending navigations");
Status status = client_->HandleEventsUntil(
base::Bind(&WebViewImpl::IsNotPendingNavigation, base::Unretained(this),
- full_frame_id));
+ frame_id));
log_->AddEntry(Log::kLog, "done waiting for pending navigations");
return status;
}
Status WebViewImpl::IsPendingNavigation(const std::string& frame_id,
bool* is_pending) {
- std::string full_frame_id(frame_id);
- if (full_frame_id.empty()) {
- Status status = GetMainFrame(&full_frame_id);
- if (status.IsError())
- return status;
- }
return navigation_tracker_->IsPendingNavigation(frame_id, is_pending);
}
-Status WebViewImpl::GetMainFrame(std::string* out_frame) {
- base::DictionaryValue params;
- scoped_ptr<base::DictionaryValue> result;
- Status status = client_->SendCommandAndGetResult(
- "Page.getResourceTree", params, &result);
- if (status.IsError())
- return status;
- if (!result->GetString("frameTree.frame.id", out_frame))
- return Status(kUnknownError, "missing 'frameTree.frame.id' in response");
- return Status(kOk);
-}
-
JavaScriptDialogManager* WebViewImpl::GetJavaScriptDialogManager() {
return dialog_manager_.get();
}
« no previous file with comments | « chrome/test/chromedriver/chrome/web_view_impl.h ('k') | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698