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

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

Issue 2125123002: [chromedriver] Add page loading strategy to capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed unittests, renamed py tests Created 4 years, 4 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/capabilities.h ('k') | chrome/test/chromedriver/chrome/chrome.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/capabilities.cc
diff --git a/chrome/test/chromedriver/capabilities.cc b/chrome/test/chromedriver/capabilities.cc
index 820cf7d4d4a0ffc9562e84d7414ae43381216c03..5ad8a490c6639ba1259a3f1127028ed953c3d5ae 100644
--- a/chrome/test/chromedriver/capabilities.cc
+++ b/chrome/test/chromedriver/capabilities.cc
@@ -20,6 +20,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/test/chromedriver/chrome/mobile_device.h"
+#include "chrome/test/chromedriver/chrome/page_load_strategy.h"
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/logging.h"
@@ -179,6 +180,16 @@ Status ParseMobileEmulation(const base::Value& option,
return Status(kOk);
}
+Status ParsePageLoadStrategy(const base::Value& option,
+ Capabilities* capabilities) {
+ if (!option.GetAsString(&capabilities->page_load_strategy))
+ return Status(kUnknownError, "must be a string");
+ if (capabilities->page_load_strategy == PageLoadStrategy::kNormal ||
+ capabilities->page_load_strategy == PageLoadStrategy::kNone)
+ return Status(kOk);
+ return Status(kUnknownError, "page load strategy unsupported");
+}
+
Status ParseSwitches(const base::Value& option,
Capabilities* capabilities) {
const base::ListValue* switches_list = NULL;
@@ -587,6 +598,7 @@ Capabilities::Capabilities()
: android_use_running_app(false),
detach(false),
force_devtools_screenshot(false),
+ page_load_strategy(PageLoadStrategy::kNormal),
network_emulation_enabled(false) {}
Capabilities::~Capabilities() {}
@@ -604,6 +616,7 @@ Status Capabilities::Parse(const base::DictionaryValue& desired_caps) {
parser_map["chromeOptions"] = base::Bind(&ParseChromeOptions);
parser_map["loggingPrefs"] = base::Bind(&ParseLoggingPrefs);
parser_map["proxy"] = base::Bind(&ParseProxy);
+ parser_map["pageLoadStrategy"] = base::Bind(&ParsePageLoadStrategy);
// Network emulation requires device mode, which is only enabled when
// mobile emulation is on.
if (desired_caps.GetDictionary("chromeOptions.mobileEmulation", nullptr)) {
« no previous file with comments | « chrome/test/chromedriver/capabilities.h ('k') | chrome/test/chromedriver/chrome/chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698