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

Unified Diff: content/test/test_web_contents.cc

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/test/test_web_contents.cc
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index d712e5ff8ff85bc3a4c1e113feaf015d6e6e7dfb..3719dd2489749c79a3b3f4795b03dfbd75010ce1 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()) {
+ 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,11 @@ void TestWebContents::NavigateAndCommit(const GURL& url) {
}
void TestWebContents::TestSetIsLoading(bool value) {
- SetIsLoading(value, true, nullptr);
+ if (value)
nasko 2016/01/15 01:19:16 The else clause has {}, the if clause should too.
clamy 2016/01/15 16:47:44 Done.
+ DidStartLoading(GetMainFrame()->frame_tree_node(), true);
+ else {
+ frame_tree_.ForEach(base::Bind(&UnsetLoadStateForTest));
+ }
}
void TestWebContents::CommitPendingNavigation() {

Powered by Google App Engine
This is Rietveld 408576698