Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 2682313002: Introduce NavigationSimulator to use in unit tests (Closed)
Patch Set: Addressed comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index ed4dc615fe406f2b4f6501252e78da729ac9ba42..e9cb20983e0c94bfd343b693d330b7b89ecdf3ad 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -95,6 +95,21 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
bool started_from_context_menu);
~NavigationHandleImpl() override;
+ // Used to track the state the navigation is currently in.
+ enum State {
+ INITIAL = 0,
+ WILL_SEND_REQUEST,
+ DEFERRING_START,
+ WILL_REDIRECT_REQUEST,
+ DEFERRING_REDIRECT,
+ CANCELING,
+ WILL_PROCESS_RESPONSE,
+ DEFERRING_RESPONSE,
+ READY_TO_COMMIT,
+ DID_COMMIT,
+ DID_COMMIT_ERROR_PAGE,
+ };
+
// NavigationHandle implementation:
const GURL& GetURL() override;
SiteInstance* GetStartingSiteInstance() override;
@@ -151,6 +166,9 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
NavigationData* GetNavigationData() override;
+ // Used in tests.
+ State state_for_testing() const { return state_; }
+
// The NavigatorDelegate to notify/query for various navigation events.
// Normally this is the WebContents, except if this NavigationHandle was
// created during a navigation to an interstitial page. In this case it will
@@ -331,21 +349,6 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
private:
friend class NavigationHandleImplTest;
- // Used to track the state the navigation is currently in.
- enum State {
- INITIAL = 0,
- WILL_SEND_REQUEST,
- DEFERRING_START,
- WILL_REDIRECT_REQUEST,
- DEFERRING_REDIRECT,
- CANCELING,
- WILL_PROCESS_RESPONSE,
- DEFERRING_RESPONSE,
- READY_TO_COMMIT,
- DID_COMMIT,
- DID_COMMIT_ERROR_PAGE,
- };
-
NavigationHandleImpl(const GURL& url,
const std::vector<GURL>& redirect_chain,
FrameTreeNode* frame_tree_node,

Powered by Google App Engine
This is Rietveld 408576698