Chromium Code Reviews| 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; |
| + } |
| +} |