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

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: 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/chrome/page_load_strategy.h ('k') | chrome/test/chromedriver/chrome/stub_chrome.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..081e410b30b82a5980d63044425818b83bc7c383
--- /dev/null
+++ b/chrome/test/chromedriver/chrome/page_load_strategy.cc
@@ -0,0 +1,28 @@
+// 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() << "invalid strategy '" << strategy << "'";
+ return nullptr;
+ }
+}
« no previous file with comments | « chrome/test/chromedriver/chrome/page_load_strategy.h ('k') | chrome/test/chromedriver/chrome/stub_chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698