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

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

Issue 15772009: [chromedriver] Fix race where we might not wait for page load after navigating. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/navigation_tracker.cc ('k') | no next file » | 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 4a25e090256ca11cd7f53e7fc7bce6861e101f51..023e111790c8bf01d84e2b91f5b968dcdb6b3e47 100644
--- a/chrome/test/chromedriver/chrome/web_view_impl.cc
+++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -8,6 +8,7 @@
#include "base/files/file_path.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/threading/platform_thread.h"
#include "base/time.h"
@@ -111,6 +112,10 @@ DevToolsClient* WebViewImpl::GetDevToolsClient() {
}
Status WebViewImpl::Load(const std::string& url) {
+ // Javascript URLs will cause a hang while waiting for the page to stop
+ // loading, so just disallow.
+ if (StartsWithASCII(url, "javascript:", false))
+ return Status(kUnknownError, "unsupported protocol");
base::DictionaryValue params;
params.SetString("url", url);
return client_->SendCommand("Page.navigate", params);
« no previous file with comments | « chrome/test/chromedriver/chrome/navigation_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698