PlzNavigate: Refactor unit test helper functions
This CL extracts unit test helper classes from navigator_impl_unittests so that
they can be used in other places. It also makes
TestWebContents::NavigateAndCommit work when browser side navigation is
enabled.
PlzNavigate: improve unit test helper functions
BUG=434383
Review URL: https://codereview.chromium.org/730553002
Cr-Commit-Position: refs/heads/master@{#304640}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index e142b3fd..8618e0f 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -82,11 +82,16 @@
const base::TimeTicks& renderer_before_unload_end_time) override;
void CancelNavigation(FrameTreeNode* frame_tree_node) override;
+ // PlzNavigate
+ // Returns the navigation request for a given node. Used in tests.
+ NavigationRequest* GetNavigationRequestForNodeForTesting(
+ FrameTreeNode* frame_tree_node);
+
private:
// Holds data used to track browser side navigation metrics.
struct NavigationMetricsData;
- friend class NavigatorTest;
+ friend class NavigatorTestWithBrowserSideNavigation;
~NavigatorImpl() override;
// Navigates to the given entry, which must be the pending entry. Private