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

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

Issue 2125123002: [chromedriver] Add page loading strategy to capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clearer naming, checks for valid strategies earlier in parsing Created 4 years, 5 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
Index: chrome/test/chromedriver/chrome/page_load_strategy.cc
diff --git a/chrome/test/chromedriver/chrome/page_load_strategy.cc b/chrome/test/chromedriver/chrome/page_load_strategy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b6cb7e477ddddcdd8f781b136b73c5d91ba896ca
--- /dev/null
+++ b/chrome/test/chromedriver/chrome/page_load_strategy.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/chromedriver/chrome/page_load_strategy.h"
+
+#include "base/logging.h"
+#include "chrome/test/chromedriver/chrome/navigation_tracker.h"
+#include "chrome/test/chromedriver/chrome/non_blocking_navigation_tracker.h"
+
+const char PageLoadStrategy::kNormal[] = "normal";
+const char PageLoadStrategy::kNone[] = "none";
+const char PageLoadStrategy::kEager[] = "eager";
+
+PageLoadStrategy* PageLoadStrategy::Create(
+ std::string strategy,
+ DevToolsClient* client,
+ const BrowserInfo* browser_info,
+ const JavaScriptDialogManager* dialog_manager) {
+ if (strategy == kNone) {
+ return new NonBlockingNavigationTracker();
+ } else if (strategy == kNormal) {
+ return new NavigationTracker(client, browser_info, dialog_manager);
+ } else {
+ NOTREACHED() <<
+ "value of 'strategy' is validated when capability is parsed";
samuong 2016/07/29 23:33:45 just say: "invalid strategy '" << strategy << "'"
evajiang 2016/08/01 16:35:46 Done.
+ return nullptr;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698