#include "content/browser/renderer_host/back_forward_cache_subframe_navigation_throttle.h"
#include "base/test/bind.h"
#include "content/public/test/test_navigation_throttle.h"
#include "content/test/navigation_simulator_impl.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
IsNull;
NotNull;
}
class BackForwardCacheSubframeNavigationThrottleTestBase
: public RenderViewHostImplTestHarness,
public WebContentsObserver { … };
class BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest
: public BackForwardCacheSubframeNavigationThrottleTestBase { … };
TEST_F(BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
CreateThrottleForSubframe) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
DoesNotCreateThrottleForMainFrame) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
DeferIfInBackForwardCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
DoesNotDeferIfNotInBackForwardCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
ResumeNavigationWhenNavigatedBackIfSubframeNavigationWasDeferred) { … }
TEST_F(
BackForwardCacheSubframeNavigationThrottleWithoutUrlLoaderTest,
DoesNotResumeNavigationWhenNavigatedBackIfSubframeNavigationWasNotDeferred) { … }
class BackForwardCacheSubframeNavigationThrottleTest
: public BackForwardCacheSubframeNavigationThrottleTestBase { … };
TEST_F(BackForwardCacheSubframeNavigationThrottleTest,
DeferInWillStartRequestIfInBFCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleTest,
DoesNotDeferInWillStartRequestIfNotInBFCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleTest,
DoesNotDeferInWillProcessResponseIfNotInBFCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleTest,
DoesNotDeferInWillRedirectRequestIfNotInBFCache) { … }
TEST_F(BackForwardCacheSubframeNavigationThrottleTest,
DoesNotDeferInWillFailRequestIfNotInBFCache) { … }
class BackForwardCacheSubframeNavigationThrottleAndNavigateBackTest
: public BackForwardCacheSubframeNavigationThrottleTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(BackForwardCacheSubframeNavigationThrottleAndNavigateBackTest,
NavigateBackToBFCachedPage) { … }
}