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)) { |