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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 616133002: Make RenderFrame(Host) own a RenderWidget(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-applying same patch Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/browser/frame_host/cross_site_transferring_request.h" 8 #include "content/browser/frame_host/cross_site_transferring_request.h"
9 #include "content/browser/frame_host/interstitial_page_impl.h" 9 #include "content/browser/frame_host/interstitial_page_impl.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 const GURL url("http://www.google.com"); 574 const GURL url("http://www.google.com");
575 controller().LoadURL( 575 controller().LoadURL(
576 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); 576 url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
577 contents()->TestDidNavigate(orig_rfh, 1, url, ui::PAGE_TRANSITION_TYPED); 577 contents()->TestDidNavigate(orig_rfh, 1, url, ui::PAGE_TRANSITION_TYPED);
578 578
579 EXPECT_FALSE(contents()->cross_navigation_pending()); 579 EXPECT_FALSE(contents()->cross_navigation_pending());
580 EXPECT_EQ(orig_rfh->GetRenderViewHost(), contents()->GetRenderViewHost()); 580 EXPECT_EQ(orig_rfh->GetRenderViewHost(), contents()->GetRenderViewHost());
581 581
582 // Simulate a renderer crash. 582 // Simulate a renderer crash.
583 orig_rfh->GetRenderViewHost()->set_render_view_created(false); 583 orig_rfh->GetRenderViewHost()->set_render_view_created(false);
584 orig_rfh->set_render_frame_created(false); 584 orig_rfh->SetRenderFrameCreated(false);
585 585
586 // Navigate to new site. We should not go into PENDING. 586 // Navigate to new site. We should not go into PENDING.
587 const GURL url2("http://www.yahoo.com"); 587 const GURL url2("http://www.yahoo.com");
588 controller().LoadURL( 588 controller().LoadURL(
589 url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); 589 url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
590 TestRenderFrameHost* new_rfh = contents()->GetMainFrame(); 590 TestRenderFrameHost* new_rfh = contents()->GetMainFrame();
591 EXPECT_FALSE(contents()->cross_navigation_pending()); 591 EXPECT_FALSE(contents()->cross_navigation_pending());
592 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); 592 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL);
593 EXPECT_NE(orig_rfh, new_rfh); 593 EXPECT_NE(orig_rfh, new_rfh);
594 EXPECT_EQ(orig_rvh_delete_count, 1); 594 EXPECT_EQ(orig_rvh_delete_count, 1);
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 2980
2981 // Destroy the remote player. No power save blockers should remain. 2981 // Destroy the remote player. No power save blockers should remain.
2982 rfh->OnMessageReceived( 2982 rfh->OnMessageReceived(
2983 FrameHostMsg_MediaPausedNotification(0, kPlayerRemoteId)); 2983 FrameHostMsg_MediaPausedNotification(0, kPlayerRemoteId));
2984 EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing()); 2984 EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing());
2985 EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing()); 2985 EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing());
2986 } 2986 }
2987 #endif 2987 #endif
2988 2988
2989 } // namespace content 2989 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698