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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed Nasko's nits Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after
3460 EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); 3460 EXPECT_EQ(url, controller.GetPendingEntry()->GetURL());
3461 EXPECT_FALSE(controller.GetPendingEntry()->is_renderer_initiated()); 3461 EXPECT_FALSE(controller.GetPendingEntry()->is_renderer_initiated());
3462 EXPECT_TRUE(controller.IsInitialNavigation()); 3462 EXPECT_TRUE(controller.IsInitialNavigation());
3463 EXPECT_FALSE(contents()->HasAccessedInitialDocument()); 3463 EXPECT_FALSE(contents()->HasAccessedInitialDocument());
3464 3464
3465 // There should be no title yet. 3465 // There should be no title yet.
3466 EXPECT_TRUE(contents()->GetTitle().empty()); 3466 EXPECT_TRUE(contents()->GetTitle().empty());
3467 3467
3468 // Suppose it aborts before committing, if it's a 204 or download or due to a 3468 // Suppose it aborts before committing, if it's a 204 or download or due to a
3469 // stop or a new navigation from the user. The URL should remain visible. 3469 // stop or a new navigation from the user. The URL should remain visible.
3470 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; 3470 if (IsBrowserSideNavigationEnabled()) {
3471 params.error_code = net::ERR_ABORTED; 3471 static_cast<NavigatorImpl*>(main_test_rfh()->frame_tree_node()->navigator())
3472 params.error_description = base::string16(); 3472 ->CancelNavigation(main_test_rfh()->frame_tree_node());
3473 params.url = url; 3473 } else {
3474 params.showing_repost_interstitial = false; 3474 FrameHostMsg_DidFailProvisionalLoadWithError_Params params;
3475 main_test_rfh()->OnMessageReceived( 3475 params.error_code = net::ERR_ABORTED;
3476 FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); 3476 params.error_description = base::string16();
3477 contents()->SetIsLoading(false, true, NULL); 3477 params.url = url;
3478 params.showing_repost_interstitial = false;
3479 main_test_rfh()->OnMessageReceived(
3480 FrameHostMsg_DidFailProvisionalLoadWithError(0, params));
3481 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidStopLoading(0));
3482 }
3478 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); 3483 EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL());
3479 3484
3480 // If something else later modifies the contents of the about:blank page, then 3485 // If something else later modifies the contents of the about:blank page, then
3481 // we must revert to showing about:blank to avoid a URL spoof. 3486 // we must revert to showing about:blank to avoid a URL spoof.
3482 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0)); 3487 main_test_rfh()->OnMessageReceived(FrameHostMsg_DidAccessInitialDocument(0));
3483 EXPECT_TRUE(contents()->HasAccessedInitialDocument()); 3488 EXPECT_TRUE(contents()->HasAccessedInitialDocument());
3484 EXPECT_FALSE(controller.GetVisibleEntry()); 3489 EXPECT_FALSE(controller.GetVisibleEntry());
3485 EXPECT_FALSE(controller.GetPendingEntry()); 3490 EXPECT_FALSE(controller.GetPendingEntry());
3486 3491
3487 notifications.Reset(); 3492 notifications.Reset();
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
5118 EXPECT_EQ(default_ssl_status.connection_status, 5123 EXPECT_EQ(default_ssl_status.connection_status,
5119 details.ssl_status.connection_status); 5124 details.ssl_status.connection_status);
5120 EXPECT_EQ(default_ssl_status.content_status, 5125 EXPECT_EQ(default_ssl_status.content_status,
5121 details.ssl_status.content_status); 5126 details.ssl_status.content_status);
5122 EXPECT_EQ(0u, details.ssl_status.signed_certificate_timestamp_ids.size()); 5127 EXPECT_EQ(0u, details.ssl_status.signed_certificate_timestamp_ids.size());
5123 5128
5124 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); 5129 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count());
5125 } 5130 }
5126 5131
5127 } // namespace content 5132 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_controller_delegate.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698