#include "content/public/test/navigation_simulator.h"
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/test_simple_task_runner.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/test_navigation_throttle.h"
#include "content/public/test/test_navigation_throttle_inserter.h"
#include "content/test/task_runner_deferring_throttle.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
class NavigationSimulatorTest : public RenderViewHostImplTestHarness { … };
class CancellingNavigationSimulatorTest
: public RenderViewHostImplTestHarness,
public WebContentsObserver,
public testing::WithParamInterface<
std::tuple<std::optional<TestNavigationThrottle::ThrottleMethod>,
TestNavigationThrottle::ResultSynchrony>> { … };
class MethodCheckingNavigationSimulatorTest : public NavigationSimulatorTest,
public WebContentsObserver { … };
class ResponseHeadersCheckingNavigationSimulatorTest
: public NavigationSimulatorTest,
public WebContentsObserver { … };
TEST_F(NavigationSimulatorTest, EmptyURL) { … }
TEST_F(NavigationSimulatorTest, AutoAdvanceOff) { … }
TEST_F(MethodCheckingNavigationSimulatorTest, SetMethodPostWithRedirect) { … }
TEST_F(MethodCheckingNavigationSimulatorTest, SetMethodPost) { … }
TEST_F(ResponseHeadersCheckingNavigationSimulatorTest, CheckResponseHeaders) { … }
TEST_P(CancellingNavigationSimulatorTest, Cancel) { … }
INSTANTIATE_TEST_SUITE_P(…);
NavigationSimulatorTestCancelFail;
TEST_P(NavigationSimulatorTestCancelFail, Fail) { … }
INSTANTIATE_TEST_SUITE_P(…);
NavigationSimulatorTestCancelFailErrAborted;
TEST_P(NavigationSimulatorTestCancelFailErrAborted, Fail) { … }
INSTANTIATE_TEST_SUITE_P(…);
}