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

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

Issue 1669453002: [chromedriver] Apply page load timeout to slow cross-process navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pure virtual Created 4 years, 8 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/alert_commands.cc ('k') | chrome/test/chromedriver/chrome/devtools_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
index fb7fd07452a604748c9d4606804139f2434e5d62..30ab4213fba69ec2234e1035e1c0dfc75b7be6f8 100644
--- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
+++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc
@@ -21,6 +21,7 @@
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/web_view_impl.h"
#include "chrome/test/chromedriver/net/port_server.h"
+#include "chrome/test/chromedriver/net/timeout.h"
#if defined(OS_POSIX)
#include <errno.h>
@@ -102,12 +103,12 @@ ChromeDesktopImpl::~ChromeDesktopImpl() {
Status ChromeDesktopImpl::WaitForPageToLoad(
const std::string& url,
- const base::TimeDelta& timeout,
+ const base::TimeDelta& timeout_raw,
std::unique_ptr<WebView>* web_view) {
- base::TimeTicks deadline = base::TimeTicks::Now() + timeout;
+ Timeout timeout(timeout_raw);
std::string id;
WebViewInfo::Type type = WebViewInfo::Type::kPage;
- while (base::TimeTicks::Now() < deadline) {
+ while (timeout.GetRemainingTime() > base::TimeDelta()) {
WebViewsInfo views_info;
Status status = devtools_http_client_->GetWebViewsInfo(&views_info);
if (status.IsError())
@@ -145,7 +146,7 @@ Status ChromeDesktopImpl::WaitForPageToLoad(
return status;
status = web_view_tmp->WaitForPendingNavigations(
- std::string(), deadline - base::TimeTicks::Now(), false);
+ std::string(), timeout, false);
if (status.IsOk())
*web_view = std::move(web_view_tmp);
return status;
« no previous file with comments | « chrome/test/chromedriver/alert_commands.cc ('k') | chrome/test/chromedriver/chrome/devtools_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698