#include "chrome/test/chromedriver/chrome/navigation_tracker.h"
#include <unordered_map>
#include "base/debug/stack_trace.h"
#include "base/logging.h"
#include "base/sequence_checker_impl.h"
#include "base/strings/string_util.h"
#include "base/uuid.h"
#include "chrome/test/chromedriver/chrome/devtools_client.h"
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/net/timeout.h"
namespace {
const char kTargetClosedMessage[] = …;
Status MakeNavigationCheckFailedStatus(Status command_status) { … }
std::unordered_map<std::string, int> error_codes({ … });
const char kNetErrorStart[] = …;
bool IsNetworkError(const std::string& error_text) { … }
class ObjectGroup { … };
}
NavigationTracker::NavigationTracker(
DevToolsClient* client,
WebView* web_view,
const bool is_eager)
: … { … }
NavigationTracker::NavigationTracker(
DevToolsClient* client,
LoadingState known_state,
WebView* web_view,
const bool is_eager)
: … { … }
NavigationTracker::~NavigationTracker() = default;
void NavigationTracker::SetFrame(const std::string& new_frame_id) { … }
Status NavigationTracker::IsPendingNavigation(const Timeout* timeout,
bool* is_pending) { … }
Status NavigationTracker::CheckFunctionExists(const Timeout* timeout,
bool* exists) { … }
void NavigationTracker::set_timed_out(bool timed_out) { … }
bool NavigationTracker::IsNonBlocking() const { … }
Status NavigationTracker::OnConnected(DevToolsClient* client) { … }
Status NavigationTracker::OnEvent(DevToolsClient* client,
const std::string& method,
const base::Value::Dict& params) { … }
Status NavigationTracker::OnCommandSuccess(DevToolsClient* client,
const std::string& method,
const base::Value::Dict* result,
const Timeout& command_timeout) { … }
Status NavigationTracker::UpdateCurrentLoadingState() { … }
NavigationTracker::LoadingState NavigationTracker::GetLoadingState() const { … }
bool NavigationTracker::HasCurrentFrame() const { … }
void NavigationTracker::SetCurrentFrameInvalid() { … }
void NavigationTracker::InitCurrentFrame(LoadingState state) { … }
void NavigationTracker::ClearFrameStates() { … }