Chromium Code Reviews| Index: content/test/test_web_contents.cc |
| diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc |
| index d712e5ff8ff85bc3a4c1e113feaf015d6e6e7dfb..707c440a325ee393793e4c32a96b1ace432018fd 100644 |
| --- a/content/test/test_web_contents.cc |
| +++ b/content/test/test_web_contents.cc |
| @@ -26,6 +26,30 @@ |
| namespace content { |
| +namespace { |
| + |
| +bool UnsetLoadStateForTest(FrameTreeNode* node) { |
| + RenderFrameHostImpl* current_frame_host = |
| + node->render_manager()->current_frame_host(); |
| + DCHECK(current_frame_host); |
| + current_frame_host->ResetLoadingState(); |
| + |
| + RenderFrameHostImpl* pending_frame_host = |
| + node->render_manager()->pending_frame_host(); |
| + if (pending_frame_host) |
| + pending_frame_host->ResetLoadingState(); |
| + |
| + if (IsBrowserSideNavigationEnabled()) { |
|
carlosk
2016/01/15 17:24:04
nit: same as the other case.
clamy
2016/01/19 13:31:19
Done.
|
| + RenderFrameHostImpl* speculative_frame_host = |
| + node->render_manager()->speculative_frame_host(); |
| + if (speculative_frame_host) |
| + speculative_frame_host->ResetLoadingState(); |
| + } |
| + return true; |
| +} |
| + |
| +} |
| + |
| TestWebContents::TestWebContents(BrowserContext* browser_context) |
| : WebContentsImpl(browser_context), |
| delegate_view_override_(NULL), |
| @@ -189,7 +213,10 @@ void TestWebContents::NavigateAndCommit(const GURL& url) { |
| } |
| void TestWebContents::TestSetIsLoading(bool value) { |
| - SetIsLoading(value, true, nullptr); |
| + if (value) |
| + DidStartLoading(GetMainFrame()->frame_tree_node(), true); |
| + else |
| + frame_tree_.ForEach(base::Bind(&UnsetLoadStateForTest)); |
| } |
| void TestWebContents::CommitPendingNavigation() { |