OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/test/histogram_tester.h" | 8 #include "base/test/histogram_tester.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/cross_site_transferring_request.h" | 10 #include "content/browser/frame_host/cross_site_transferring_request.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 void set_should_create_webui(bool should_create_webui) { | 255 void set_should_create_webui(bool should_create_webui) { |
256 factory_.set_should_create_webui(should_create_webui); | 256 factory_.set_should_create_webui(should_create_webui); |
257 } | 257 } |
258 | 258 |
259 void NavigateActiveAndCommit(const GURL& url) { | 259 void NavigateActiveAndCommit(const GURL& url) { |
260 // Note: we navigate the active RenderFrameHost because previous navigations | 260 // Note: we navigate the active RenderFrameHost because previous navigations |
261 // won't have committed yet, so NavigateAndCommit does the wrong thing | 261 // won't have committed yet, so NavigateAndCommit does the wrong thing |
262 // for us. | 262 // for us. |
263 controller().LoadURL( | 263 controller().LoadURL( |
264 url, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 264 url, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
265 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
266 | 265 |
267 // Simulate the BeforeUnload_ACK that is received from the current renderer | 266 // Simulate the BeforeUnload_ACK that is received from the current renderer |
268 // for a cross-site navigation. | 267 // for a cross-site navigation. |
269 // PlzNavigate: it is necessary to call PrepareForCommit before getting the | 268 // PlzNavigate: it is necessary to call PrepareForCommit before getting the |
270 // main and the pending frame because when we are trying to navigate to a | 269 // main and the pending frame because when we are trying to navigate to a |
271 // WebUI from a new tab, a RenderFrameHost is created to display it that is | 270 // WebUI from a new tab, a RenderFrameHost is created to display it that is |
272 // committed immediately (since it is a new tab). Therefore the main frame | 271 // committed immediately (since it is a new tab). Therefore the main frame |
273 // is replaced without a pending frame being created, and we don't get the | 272 // is replaced without a pending frame being created, and we don't get the |
274 // right values for the RFH to navigate: we try to use the old one that has | 273 // right values for the RFH to navigate: we try to use the old one that has |
275 // been deleted in the meantime. | 274 // been deleted in the meantime. |
276 contents()->GetMainFrame()->PrepareForCommit(); | 275 contents()->GetMainFrame()->PrepareForCommit(); |
277 | 276 |
278 TestRenderFrameHost* old_rfh = contents()->GetMainFrame(); | 277 TestRenderFrameHost* old_rfh = contents()->GetMainFrame(); |
279 TestRenderFrameHost* active_rfh = contents()->GetPendingMainFrame() | 278 TestRenderFrameHost* active_rfh = contents()->GetPendingMainFrame() |
280 ? contents()->GetPendingMainFrame() | 279 ? contents()->GetPendingMainFrame() |
281 : old_rfh; | 280 : old_rfh; |
282 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, old_rfh->rfh_state()); | 281 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, old_rfh->rfh_state()); |
283 | 282 |
284 // Commit the navigation with a new page ID. | 283 // Commit the navigation with a new page ID. |
285 int32 max_page_id = contents()->GetMaxPageIDForSiteInstance( | 284 int32 max_page_id = contents()->GetMaxPageIDForSiteInstance( |
286 active_rfh->GetSiteInstance()); | 285 active_rfh->GetSiteInstance()); |
287 | 286 |
288 // Use an observer to avoid accessing a deleted renderer later on when the | 287 // Use an observer to avoid accessing a deleted renderer later on when the |
289 // state is being checked. | 288 // state is being checked. |
290 RenderFrameHostDeletedObserver rfh_observer(old_rfh); | 289 RenderFrameHostDeletedObserver rfh_observer(old_rfh); |
291 RenderViewHostDeletedObserver rvh_observer(old_rfh->GetRenderViewHost()); | 290 RenderViewHostDeletedObserver rvh_observer(old_rfh->GetRenderViewHost()); |
292 active_rfh->SendNavigate(max_page_id + 1, entry_id, true, url); | 291 active_rfh->SendNavigate(max_page_id + 1, url); |
293 | 292 |
294 // Make sure that we start to run the unload handler at the time of commit. | 293 // Make sure that we start to run the unload handler at the time of commit. |
295 bool expecting_rfh_shutdown = false; | 294 bool expecting_rfh_shutdown = false; |
296 if (old_rfh != active_rfh && !rfh_observer.deleted()) { | 295 if (old_rfh != active_rfh && !rfh_observer.deleted()) { |
297 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, | 296 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, |
298 old_rfh->rfh_state()); | 297 old_rfh->rfh_state()); |
299 if (!old_rfh->GetSiteInstance()->active_frame_count()) { | 298 if (!old_rfh->GetSiteInstance()->active_frame_count()) { |
300 expecting_rfh_shutdown = true; | 299 expecting_rfh_shutdown = true; |
301 EXPECT_TRUE( | 300 EXPECT_TRUE( |
302 old_rfh->frame_tree_node()->render_manager()->IsPendingDeletion( | 301 old_rfh->frame_tree_node()->render_manager()->IsPendingDeletion( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const GURL kChromeURL("chrome://foo"); | 344 const GURL kChromeURL("chrome://foo"); |
346 const GURL kDestUrl("http://www.google.com/"); | 345 const GURL kDestUrl("http://www.google.com/"); |
347 | 346 |
348 // Navigate our first tab to a chrome url and then to the destination. | 347 // Navigate our first tab to a chrome url and then to the destination. |
349 NavigateActiveAndCommit(kChromeURL); | 348 NavigateActiveAndCommit(kChromeURL); |
350 TestRenderFrameHost* ntp_rfh = contents()->GetMainFrame(); | 349 TestRenderFrameHost* ntp_rfh = contents()->GetMainFrame(); |
351 | 350 |
352 // Navigate to a cross-site URL. | 351 // Navigate to a cross-site URL. |
353 contents()->GetController().LoadURL( | 352 contents()->GetController().LoadURL( |
354 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 353 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
355 int entry_id = contents()->GetController().GetPendingEntry()->GetUniqueID(); | |
356 contents()->GetMainFrame()->PrepareForCommit(); | 354 contents()->GetMainFrame()->PrepareForCommit(); |
357 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 355 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
358 | 356 |
359 // Manually increase the number of active frames in the | 357 // Manually increase the number of active frames in the |
360 // SiteInstance that ntp_rfh belongs to, to prevent it from being | 358 // SiteInstance that ntp_rfh belongs to, to prevent it from being |
361 // destroyed when it gets swapped out. | 359 // destroyed when it gets swapped out. |
362 ntp_rfh->GetSiteInstance()->increment_active_frame_count(); | 360 ntp_rfh->GetSiteInstance()->increment_active_frame_count(); |
363 | 361 |
364 TestRenderFrameHost* dest_rfh = contents()->GetPendingMainFrame(); | 362 TestRenderFrameHost* dest_rfh = contents()->GetPendingMainFrame(); |
365 CHECK(dest_rfh); | 363 CHECK(dest_rfh); |
366 EXPECT_NE(ntp_rfh, dest_rfh); | 364 EXPECT_NE(ntp_rfh, dest_rfh); |
367 | 365 |
368 // BeforeUnload finishes. | 366 // BeforeUnload finishes. |
369 ntp_rfh->SendBeforeUnloadACK(true); | 367 ntp_rfh->SendBeforeUnloadACK(true); |
370 | 368 |
371 dest_rfh->SendNavigate(101, entry_id, true, kDestUrl); | 369 dest_rfh->SendNavigate(101, kDestUrl); |
372 ntp_rfh->OnSwappedOut(); | 370 ntp_rfh->OnSwappedOut(); |
373 | 371 |
374 EXPECT_TRUE(ntp_rfh->is_swapped_out()); | 372 EXPECT_TRUE(ntp_rfh->is_swapped_out()); |
375 return ntp_rfh; | 373 return ntp_rfh; |
376 } | 374 } |
377 | 375 |
378 // Returns the RenderFrameHost that should be used in the navigation to | 376 // Returns the RenderFrameHost that should be used in the navigation to |
379 // |entry|. | 377 // |entry|. |
380 RenderFrameHostImpl* NavigateToEntry( | 378 RenderFrameHostImpl* NavigateToEntry( |
381 RenderFrameHostManager* manager, | 379 RenderFrameHostManager* manager, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 428 |
431 // Make a second tab. | 429 // Make a second tab. |
432 scoped_ptr<TestWebContents> contents2( | 430 scoped_ptr<TestWebContents> contents2( |
433 TestWebContents::Create(browser_context(), NULL)); | 431 TestWebContents::Create(browser_context(), NULL)); |
434 | 432 |
435 // Load the two URLs in the second tab. Note that the first navigation creates | 433 // Load the two URLs in the second tab. Note that the first navigation creates |
436 // a RFH that's not pending (since there is no cross-site transition), so | 434 // a RFH that's not pending (since there is no cross-site transition), so |
437 // we use the committed one. | 435 // we use the committed one. |
438 contents2->GetController().LoadURL( | 436 contents2->GetController().LoadURL( |
439 kChromeUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 437 kChromeUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
440 int entry_id = contents2->GetController().GetPendingEntry()->GetUniqueID(); | |
441 contents2->GetMainFrame()->PrepareForCommit(); | 438 contents2->GetMainFrame()->PrepareForCommit(); |
442 TestRenderFrameHost* ntp_rfh2 = contents2->GetMainFrame(); | 439 TestRenderFrameHost* ntp_rfh2 = contents2->GetMainFrame(); |
443 EXPECT_FALSE(contents2->CrossProcessNavigationPending()); | 440 EXPECT_FALSE(contents2->CrossProcessNavigationPending()); |
444 ntp_rfh2->SendNavigate(100, entry_id, true, kChromeUrl); | 441 ntp_rfh2->SendNavigate(100, kChromeUrl); |
445 | 442 |
446 // The second one is the opposite, creating a cross-site transition and | 443 // The second one is the opposite, creating a cross-site transition and |
447 // requiring a beforeunload ack. | 444 // requiring a beforeunload ack. |
448 contents2->GetController().LoadURL( | 445 contents2->GetController().LoadURL( |
449 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 446 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
450 entry_id = contents2->GetController().GetPendingEntry()->GetUniqueID(); | |
451 contents2->GetMainFrame()->PrepareForCommit(); | 447 contents2->GetMainFrame()->PrepareForCommit(); |
452 EXPECT_TRUE(contents2->CrossProcessNavigationPending()); | 448 EXPECT_TRUE(contents2->CrossProcessNavigationPending()); |
453 TestRenderFrameHost* dest_rfh2 = contents2->GetPendingMainFrame(); | 449 TestRenderFrameHost* dest_rfh2 = contents2->GetPendingMainFrame(); |
454 ASSERT_TRUE(dest_rfh2); | 450 ASSERT_TRUE(dest_rfh2); |
455 | 451 |
456 dest_rfh2->SendNavigate(101, entry_id, true, kDestUrl); | 452 dest_rfh2->SendNavigate(101, kDestUrl); |
457 | 453 |
458 // The two RFH's should be different in every way. | 454 // The two RFH's should be different in every way. |
459 EXPECT_NE(contents()->GetMainFrame()->GetProcess(), dest_rfh2->GetProcess()); | 455 EXPECT_NE(contents()->GetMainFrame()->GetProcess(), dest_rfh2->GetProcess()); |
460 EXPECT_NE(contents()->GetMainFrame()->GetSiteInstance(), | 456 EXPECT_NE(contents()->GetMainFrame()->GetSiteInstance(), |
461 dest_rfh2->GetSiteInstance()); | 457 dest_rfh2->GetSiteInstance()); |
462 EXPECT_FALSE(dest_rfh2->GetSiteInstance()->IsRelatedSiteInstance( | 458 EXPECT_FALSE(dest_rfh2->GetSiteInstance()->IsRelatedSiteInstance( |
463 contents()->GetMainFrame()->GetSiteInstance())); | 459 contents()->GetMainFrame()->GetSiteInstance())); |
464 | 460 |
465 // Navigate both to the new tab page, and verify that they share a | 461 // Navigate both to the new tab page, and verify that they share a |
466 // RenderProcessHost (not a SiteInstance). | 462 // RenderProcessHost (not a SiteInstance). |
467 NavigateActiveAndCommit(kChromeUrl); | 463 NavigateActiveAndCommit(kChromeUrl); |
468 EXPECT_FALSE(contents()->GetPendingMainFrame()); | 464 EXPECT_FALSE(contents()->GetPendingMainFrame()); |
469 | 465 |
470 contents2->GetController().LoadURL( | 466 contents2->GetController().LoadURL( |
471 kChromeUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 467 kChromeUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
472 entry_id = contents2->GetController().GetPendingEntry()->GetUniqueID(); | |
473 contents2->GetMainFrame()->PrepareForCommit(); | 468 contents2->GetMainFrame()->PrepareForCommit(); |
474 contents2->GetPendingMainFrame()->SendNavigate(102, entry_id, true, | 469 contents2->GetPendingMainFrame()->SendNavigate(102, kChromeUrl); |
475 kChromeUrl); | |
476 | 470 |
477 EXPECT_NE(contents()->GetMainFrame()->GetSiteInstance(), | 471 EXPECT_NE(contents()->GetMainFrame()->GetSiteInstance(), |
478 contents2->GetMainFrame()->GetSiteInstance()); | 472 contents2->GetMainFrame()->GetSiteInstance()); |
479 EXPECT_EQ(contents()->GetMainFrame()->GetSiteInstance()->GetProcess(), | 473 EXPECT_EQ(contents()->GetMainFrame()->GetSiteInstance()->GetProcess(), |
480 contents2->GetMainFrame()->GetSiteInstance()->GetProcess()); | 474 contents2->GetMainFrame()->GetSiteInstance()->GetProcess()); |
481 } | 475 } |
482 | 476 |
483 // Ensure that the browser ignores most IPC messages that arrive from a | 477 // Ensure that the browser ignores most IPC messages that arrive from a |
484 // RenderViewHost that has been swapped out. We do not want to take | 478 // RenderViewHost that has been swapped out. We do not want to take |
485 // action on requests from a non-active renderer. The main exception is | 479 // action on requests from a non-active renderer. The main exception is |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 EXPECT_TRUE(observer.favicon_received()); | 590 EXPECT_TRUE(observer.favicon_received()); |
597 } | 591 } |
598 | 592 |
599 // Create one more frame in the same SiteInstance where |rfh1| exists so that | 593 // Create one more frame in the same SiteInstance where |rfh1| exists so that |
600 // it doesn't get deleted on navigation to another site. | 594 // it doesn't get deleted on navigation to another site. |
601 rfh1->GetSiteInstance()->increment_active_frame_count(); | 595 rfh1->GetSiteInstance()->increment_active_frame_count(); |
602 | 596 |
603 // Navigate to a cross-site URL and commit the new page. | 597 // Navigate to a cross-site URL and commit the new page. |
604 controller().LoadURL( | 598 controller().LoadURL( |
605 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 599 kDestUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
606 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
607 contents()->GetMainFrame()->PrepareForCommit(); | 600 contents()->GetMainFrame()->PrepareForCommit(); |
608 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); | 601 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); |
609 contents()->TestDidNavigate(rfh2, 1, entry_id, true, kDestUrl, | 602 contents()->TestDidNavigate(rfh2, 1, kDestUrl, ui::PAGE_TRANSITION_TYPED); |
610 ui::PAGE_TRANSITION_TYPED); | |
611 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); | 603 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); |
612 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); | 604 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); |
613 | 605 |
614 // The new RVH should be able to update its favicons. | 606 // The new RVH should be able to update its favicons. |
615 { | 607 { |
616 PluginFaviconMessageObserver observer(contents()); | 608 PluginFaviconMessageObserver observer(contents()); |
617 EXPECT_TRUE(rfh2->GetRenderViewHost()->OnMessageReceived( | 609 EXPECT_TRUE(rfh2->GetRenderViewHost()->OnMessageReceived( |
618 ViewHostMsg_UpdateFaviconURL(rfh2->GetRenderViewHost()->GetRoutingID(), | 610 ViewHostMsg_UpdateFaviconURL(rfh2->GetRenderViewHost()->GetRoutingID(), |
619 icons))); | 611 icons))); |
620 EXPECT_TRUE(observer.favicon_received()); | 612 EXPECT_TRUE(observer.favicon_received()); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 // the second navigation. We have to avoid this in order to exercise the | 846 // the second navigation. We have to avoid this in order to exercise the |
855 // target code path. | 847 // target code path. |
856 NavigateActiveAndCommit(kChromeUrl); | 848 NavigateActiveAndCommit(kChromeUrl); |
857 | 849 |
858 // Navigate. Note that "view source" URLs are implemented by putting the RFH | 850 // Navigate. Note that "view source" URLs are implemented by putting the RFH |
859 // into a view-source mode and then navigating to the inner URL, so that's why | 851 // into a view-source mode and then navigating to the inner URL, so that's why |
860 // the bare URL is what's committed and returned by the last committed entry's | 852 // the bare URL is what's committed and returned by the last committed entry's |
861 // GetURL() call. | 853 // GetURL() call. |
862 controller().LoadURL( | 854 controller().LoadURL( |
863 kViewSourceUrl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 855 kViewSourceUrl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
864 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
865 | 856 |
866 // Simulate response from RenderFrame for DispatchBeforeUnload. | 857 // Simulate response from RenderFrame for DispatchBeforeUnload. |
867 contents()->GetMainFrame()->PrepareForCommit(); | 858 contents()->GetMainFrame()->PrepareForCommit(); |
868 ASSERT_TRUE(contents()->GetPendingMainFrame()) | 859 ASSERT_TRUE(contents()->GetPendingMainFrame()) |
869 << "Expected new pending RenderFrameHost to be created."; | 860 << "Expected new pending RenderFrameHost to be created."; |
870 RenderFrameHost* last_rfh = contents()->GetPendingMainFrame(); | 861 RenderFrameHost* last_rfh = contents()->GetPendingMainFrame(); |
871 int32 new_id = | 862 int32 new_id = |
872 contents()->GetMaxPageIDForSiteInstance(last_rfh->GetSiteInstance()) + 1; | 863 contents()->GetMaxPageIDForSiteInstance(last_rfh->GetSiteInstance()) + 1; |
873 contents()->GetPendingMainFrame()->SendNavigate(new_id, entry_id, true, kUrl); | 864 contents()->GetPendingMainFrame()->SendNavigate(new_id, kUrl); |
874 | 865 |
875 EXPECT_EQ(1, controller().GetLastCommittedEntryIndex()); | 866 EXPECT_EQ(1, controller().GetLastCommittedEntryIndex()); |
876 NavigationEntry* last_committed = controller().GetLastCommittedEntry(); | 867 NavigationEntry* last_committed = controller().GetLastCommittedEntry(); |
877 ASSERT_NE(nullptr, last_committed); | 868 ASSERT_NE(nullptr, last_committed); |
878 EXPECT_EQ(kUrl, last_committed->GetURL()); | 869 EXPECT_EQ(kUrl, last_committed->GetURL()); |
879 EXPECT_EQ(kViewSourceUrl, last_committed->GetVirtualURL()); | 870 EXPECT_EQ(kViewSourceUrl, last_committed->GetVirtualURL()); |
880 EXPECT_FALSE(controller().GetPendingEntry()); | 871 EXPECT_FALSE(controller().GetPendingEntry()); |
881 // Because we're using TestWebContents and TestRenderViewHost in this | 872 // Because we're using TestWebContents and TestRenderViewHost in this |
882 // unittest, no one calls WebContentsImpl::RenderViewCreated(). So, we see no | 873 // unittest, no one calls WebContentsImpl::RenderViewCreated(). So, we see no |
883 // EnableViewSourceMode message, here. | 874 // EnableViewSourceMode message, here. |
884 | 875 |
885 // Clear queued messages before load. | 876 // Clear queued messages before load. |
886 process()->sink().ClearMessages(); | 877 process()->sink().ClearMessages(); |
887 | 878 |
888 // Navigate, again. | 879 // Navigate, again. |
889 controller().LoadURL( | 880 controller().LoadURL( |
890 kViewSourceUrl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 881 kViewSourceUrl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
891 entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
892 contents()->GetMainFrame()->PrepareForCommit(); | 882 contents()->GetMainFrame()->PrepareForCommit(); |
893 | 883 |
894 // The same RenderViewHost should be reused. | 884 // The same RenderViewHost should be reused. |
895 EXPECT_FALSE(contents()->GetPendingMainFrame()); | 885 EXPECT_FALSE(contents()->GetPendingMainFrame()); |
896 EXPECT_EQ(last_rfh, contents()->GetMainFrame()); | 886 EXPECT_EQ(last_rfh, contents()->GetMainFrame()); |
897 | 887 |
898 // The renderer sends a commit. | 888 // The renderer sends a commit. |
899 contents()->GetMainFrame()->SendNavigateWithTransition( | 889 contents()->GetMainFrame()->SendNavigate(new_id, kUrl); |
900 new_id, entry_id, false, kUrl, ui::PAGE_TRANSITION_TYPED); | |
901 EXPECT_EQ(1, controller().GetLastCommittedEntryIndex()); | 890 EXPECT_EQ(1, controller().GetLastCommittedEntryIndex()); |
902 EXPECT_FALSE(controller().GetPendingEntry()); | 891 EXPECT_FALSE(controller().GetPendingEntry()); |
903 | 892 |
904 // New message should be sent out to make sure to enter view-source mode. | 893 // New message should be sent out to make sure to enter view-source mode. |
905 EXPECT_TRUE(process()->sink().GetUniqueMessageMatching( | 894 EXPECT_TRUE(process()->sink().GetUniqueMessageMatching( |
906 ViewMsg_EnableViewSourceMode::ID)); | 895 ViewMsg_EnableViewSourceMode::ID)); |
907 } | 896 } |
908 | 897 |
909 // Tests the Init function by checking the initial RenderViewHost. | 898 // Tests the Init function by checking the initial RenderViewHost. |
910 TEST_F(RenderFrameHostManagerTest, Init) { | 899 TEST_F(RenderFrameHostManagerTest, Init) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 contents()->GetMainFrame()->PrepareForCommit(); | 1180 contents()->GetMainFrame()->PrepareForCommit(); |
1192 // We should have a new pending RFH. | 1181 // We should have a new pending RFH. |
1193 // Note that in this case, the navigation has not committed, so evil_rfh will | 1182 // Note that in this case, the navigation has not committed, so evil_rfh will |
1194 // not be deleted yet. | 1183 // not be deleted yet. |
1195 EXPECT_NE(evil_rfh, contents()->GetPendingMainFrame()); | 1184 EXPECT_NE(evil_rfh, contents()->GetPendingMainFrame()); |
1196 EXPECT_NE(evil_rfh->GetRenderViewHost(), | 1185 EXPECT_NE(evil_rfh->GetRenderViewHost(), |
1197 contents()->GetPendingMainFrame()->GetRenderViewHost()); | 1186 contents()->GetPendingMainFrame()->GetRenderViewHost()); |
1198 | 1187 |
1199 // Before that RFH has committed, the evil page reloads itself. | 1188 // Before that RFH has committed, the evil page reloads itself. |
1200 FrameHostMsg_DidCommitProvisionalLoad_Params params; | 1189 FrameHostMsg_DidCommitProvisionalLoad_Params params; |
1201 params.page_id = 0; | 1190 params.page_id = 1; |
1202 params.nav_entry_id = 0; | |
1203 params.did_create_new_entry = false; | |
1204 params.url = kUrl2; | 1191 params.url = kUrl2; |
1205 params.transition = ui::PAGE_TRANSITION_CLIENT_REDIRECT; | 1192 params.transition = ui::PAGE_TRANSITION_CLIENT_REDIRECT; |
1206 params.should_update_history = false; | 1193 params.should_update_history = false; |
1207 params.gesture = NavigationGestureAuto; | 1194 params.gesture = NavigationGestureAuto; |
1208 params.was_within_same_page = false; | 1195 params.was_within_same_page = false; |
1209 params.is_post = false; | 1196 params.is_post = false; |
1210 params.page_state = PageState::CreateFromURL(kUrl2); | 1197 params.page_state = PageState::CreateFromURL(kUrl2); |
1211 | 1198 |
1212 contents()->GetFrameTree()->root()->navigator()->DidNavigate(evil_rfh, | 1199 contents()->GetFrameTree()->root()->navigator()->DidNavigate(evil_rfh, |
1213 params); | 1200 params); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 // Now go back, but suppose the SwapOut_ACK isn't received. This shouldn't | 1260 // Now go back, but suppose the SwapOut_ACK isn't received. This shouldn't |
1274 // happen, but we have seen it when going back quickly across many entries | 1261 // happen, but we have seen it when going back quickly across many entries |
1275 // (http://crbug.com/93427). | 1262 // (http://crbug.com/93427). |
1276 contents()->GetController().GoBack(); | 1263 contents()->GetController().GoBack(); |
1277 EXPECT_TRUE(rfh2->IsWaitingForBeforeUnloadACK()); | 1264 EXPECT_TRUE(rfh2->IsWaitingForBeforeUnloadACK()); |
1278 contents()->GetMainFrame()->PrepareForCommit(); | 1265 contents()->GetMainFrame()->PrepareForCommit(); |
1279 EXPECT_FALSE(rfh2->IsWaitingForBeforeUnloadACK()); | 1266 EXPECT_FALSE(rfh2->IsWaitingForBeforeUnloadACK()); |
1280 | 1267 |
1281 // The back navigation commits. | 1268 // The back navigation commits. |
1282 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); | 1269 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); |
1283 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetUniqueID(), false, | 1270 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetURL()); |
1284 entry1->GetURL()); | |
1285 EXPECT_TRUE(rfh2->IsWaitingForUnloadACK()); | 1271 EXPECT_TRUE(rfh2->IsWaitingForUnloadACK()); |
1286 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh2->rfh_state()); | 1272 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh2->rfh_state()); |
1287 | 1273 |
1288 // We should be able to navigate forward. | 1274 // We should be able to navigate forward. |
1289 contents()->GetController().GoForward(); | 1275 contents()->GetController().GoForward(); |
1290 contents()->GetMainFrame()->PrepareForCommit(); | 1276 contents()->GetMainFrame()->PrepareForCommit(); |
1291 const NavigationEntry* entry2 = contents()->GetController().GetPendingEntry(); | 1277 const NavigationEntry* entry2 = contents()->GetController().GetPendingEntry(); |
1292 rfh2->SendNavigate(entry2->GetPageID(), entry2->GetUniqueID(), false, | 1278 rfh2->SendNavigate(entry2->GetPageID(), entry2->GetURL()); |
1293 entry2->GetURL()); | |
1294 EXPECT_EQ(rfh2, main_test_rfh()); | 1279 EXPECT_EQ(rfh2, main_test_rfh()); |
1295 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); | 1280 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); |
1296 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); | 1281 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); |
1297 rfh1->OnSwappedOut(); | 1282 rfh1->OnSwappedOut(); |
1298 EXPECT_TRUE(rfh1->is_swapped_out()); | 1283 EXPECT_TRUE(rfh1->is_swapped_out()); |
1299 EXPECT_EQ(RenderFrameHostImpl::STATE_SWAPPED_OUT, rfh1->rfh_state()); | 1284 EXPECT_EQ(RenderFrameHostImpl::STATE_SWAPPED_OUT, rfh1->rfh_state()); |
1300 } | 1285 } |
1301 | 1286 |
1302 // Test that we create swapped out RFHs for the opener chain when navigating an | 1287 // Test that we create swapped out RFHs for the opener chain when navigating an |
1303 // opened tab cross-process. This allows us to support certain cross-process | 1288 // opened tab cross-process. This allows us to support certain cross-process |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 contents()->GetMainFrame()->PrepareForCommit(); | 1447 contents()->GetMainFrame()->PrepareForCommit(); |
1463 | 1448 |
1464 // Disown the opener from rfh2. | 1449 // Disown the opener from rfh2. |
1465 rfh2->DidDisownOpener(); | 1450 rfh2->DidDisownOpener(); |
1466 | 1451 |
1467 // Ensure the opener is cleared. | 1452 // Ensure the opener is cleared. |
1468 EXPECT_FALSE(contents()->HasOpener()); | 1453 EXPECT_FALSE(contents()->HasOpener()); |
1469 | 1454 |
1470 // The back navigation commits. | 1455 // The back navigation commits. |
1471 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); | 1456 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); |
1472 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetUniqueID(), false, | 1457 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetURL()); |
1473 entry1->GetURL()); | |
1474 | 1458 |
1475 // Ensure the opener is still cleared. | 1459 // Ensure the opener is still cleared. |
1476 EXPECT_FALSE(contents()->HasOpener()); | 1460 EXPECT_FALSE(contents()->HasOpener()); |
1477 } | 1461 } |
1478 | 1462 |
1479 // Test that a page can disown the opener just after a cross-process navigation | 1463 // Test that a page can disown the opener just after a cross-process navigation |
1480 // commits. | 1464 // commits. |
1481 TEST_F(RenderFrameHostManagerTest, DisownOpenerAfterNavigation) { | 1465 TEST_F(RenderFrameHostManagerTest, DisownOpenerAfterNavigation) { |
1482 const GURL kUrl1("http://www.google.com/"); | 1466 const GURL kUrl1("http://www.google.com/"); |
1483 const GURL kUrl2("http://www.chromium.org/"); | 1467 const GURL kUrl2("http://www.chromium.org/"); |
(...skipping 12 matching lines...) Expand all Loading... |
1496 // BrowsingInstance). | 1480 // BrowsingInstance). |
1497 contents()->NavigateAndCommit(kUrl2); | 1481 contents()->NavigateAndCommit(kUrl2); |
1498 TestRenderFrameHost* rfh2 = main_test_rfh(); | 1482 TestRenderFrameHost* rfh2 = main_test_rfh(); |
1499 EXPECT_NE(rfh1->GetSiteInstance(), rfh2->GetSiteInstance()); | 1483 EXPECT_NE(rfh1->GetSiteInstance(), rfh2->GetSiteInstance()); |
1500 | 1484 |
1501 // Commit a back navigation before the DidDisownOpener message arrives. | 1485 // Commit a back navigation before the DidDisownOpener message arrives. |
1502 // rfh1 will be kept alive because of the opener tab. | 1486 // rfh1 will be kept alive because of the opener tab. |
1503 contents()->GetController().GoBack(); | 1487 contents()->GetController().GoBack(); |
1504 contents()->GetMainFrame()->PrepareForCommit(); | 1488 contents()->GetMainFrame()->PrepareForCommit(); |
1505 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); | 1489 const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry(); |
1506 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetUniqueID(), false, | 1490 rfh1->SendNavigate(entry1->GetPageID(), entry1->GetURL()); |
1507 entry1->GetURL()); | |
1508 | 1491 |
1509 // Disown the opener from rfh2. | 1492 // Disown the opener from rfh2. |
1510 rfh2->DidDisownOpener(); | 1493 rfh2->DidDisownOpener(); |
1511 EXPECT_FALSE(contents()->HasOpener()); | 1494 EXPECT_FALSE(contents()->HasOpener()); |
1512 } | 1495 } |
1513 | 1496 |
1514 // Test that we clean up swapped out RenderViewHosts when a process hosting | 1497 // Test that we clean up swapped out RenderViewHosts when a process hosting |
1515 // those associated RenderViews crashes. http://crbug.com/258993 | 1498 // those associated RenderViews crashes. http://crbug.com/258993 |
1516 TEST_F(RenderFrameHostManagerTest, CleanUpSwappedOutRVHOnProcessCrash) { | 1499 TEST_F(RenderFrameHostManagerTest, CleanUpSwappedOutRVHOnProcessCrash) { |
1517 const GURL kUrl1("http://www.google.com/"); | 1500 const GURL kUrl1("http://www.google.com/"); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 | 1754 |
1772 // Navigate to the first page. | 1755 // Navigate to the first page. |
1773 contents()->NavigateAndCommit(kUrl1); | 1756 contents()->NavigateAndCommit(kUrl1); |
1774 TestRenderFrameHost* rfh1 = contents()->GetMainFrame(); | 1757 TestRenderFrameHost* rfh1 = contents()->GetMainFrame(); |
1775 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); | 1758 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); |
1776 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1759 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1777 | 1760 |
1778 // Navigate to new site, simulating onbeforeunload approval. | 1761 // Navigate to new site, simulating onbeforeunload approval. |
1779 controller().LoadURL( | 1762 controller().LoadURL( |
1780 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 1763 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
1781 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
1782 contents()->GetMainFrame()->PrepareForCommit(); | 1764 contents()->GetMainFrame()->PrepareForCommit(); |
1783 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 1765 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
1784 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1766 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1785 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); | 1767 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); |
1786 | 1768 |
1787 // Simulate the swap out ack, unexpectedly early (before commit). It should | 1769 // Simulate the swap out ack, unexpectedly early (before commit). It should |
1788 // have no effect. | 1770 // have no effect. |
1789 rfh1->OnSwappedOut(); | 1771 rfh1->OnSwappedOut(); |
1790 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 1772 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
1791 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1773 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1792 | 1774 |
1793 // The new page commits. | 1775 // The new page commits. |
1794 contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2, | 1776 contents()->TestDidNavigate(rfh2, 1, kUrl2, ui::PAGE_TRANSITION_TYPED); |
1795 ui::PAGE_TRANSITION_TYPED); | |
1796 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); | 1777 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); |
1797 EXPECT_EQ(rfh2, contents()->GetMainFrame()); | 1778 EXPECT_EQ(rfh2, contents()->GetMainFrame()); |
1798 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); | 1779 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); |
1799 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); | 1780 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); |
1800 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); | 1781 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); |
1801 EXPECT_TRUE( | 1782 EXPECT_TRUE( |
1802 rfh1->frame_tree_node()->render_manager()->IsPendingDeletion(rfh1)); | 1783 rfh1->frame_tree_node()->render_manager()->IsPendingDeletion(rfh1)); |
1803 | 1784 |
1804 // Simulate the swap out ack. | 1785 // Simulate the swap out ack. |
1805 rfh1->OnSwappedOut(); | 1786 rfh1->OnSwappedOut(); |
(...skipping 15 matching lines...) Expand all Loading... |
1821 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); | 1802 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); |
1822 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1803 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1823 | 1804 |
1824 // Increment the number of active frames in SiteInstanceImpl so that rfh1 is | 1805 // Increment the number of active frames in SiteInstanceImpl so that rfh1 is |
1825 // not deleted on swap out. | 1806 // not deleted on swap out. |
1826 rfh1->GetSiteInstance()->increment_active_frame_count(); | 1807 rfh1->GetSiteInstance()->increment_active_frame_count(); |
1827 | 1808 |
1828 // Navigate to new site, simulating onbeforeunload approval. | 1809 // Navigate to new site, simulating onbeforeunload approval. |
1829 controller().LoadURL( | 1810 controller().LoadURL( |
1830 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 1811 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
1831 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
1832 contents()->GetMainFrame()->PrepareForCommit(); | 1812 contents()->GetMainFrame()->PrepareForCommit(); |
1833 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 1813 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
1834 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1814 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1835 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); | 1815 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); |
1836 | 1816 |
1837 // The new page commits. | 1817 // The new page commits. |
1838 contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2, | 1818 contents()->TestDidNavigate(rfh2, 1, kUrl2, ui::PAGE_TRANSITION_TYPED); |
1839 ui::PAGE_TRANSITION_TYPED); | |
1840 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); | 1819 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); |
1841 EXPECT_EQ(rfh2, contents()->GetMainFrame()); | 1820 EXPECT_EQ(rfh2, contents()->GetMainFrame()); |
1842 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); | 1821 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); |
1843 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); | 1822 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); |
1844 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); | 1823 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); |
1845 | 1824 |
1846 // Simulate the swap out ack. | 1825 // Simulate the swap out ack. |
1847 rfh1->OnSwappedOut(); | 1826 rfh1->OnSwappedOut(); |
1848 | 1827 |
1849 // rfh1 should be swapped out. | 1828 // rfh1 should be swapped out. |
(...skipping 16 matching lines...) Expand all Loading... |
1866 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); | 1845 RenderFrameHostDeletedObserver rfh_deleted_observer(rfh1); |
1867 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); | 1846 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
1868 | 1847 |
1869 // Increment the number of active frames in SiteInstanceImpl so that rfh1 is | 1848 // Increment the number of active frames in SiteInstanceImpl so that rfh1 is |
1870 // not deleted on swap out. | 1849 // not deleted on swap out. |
1871 rfh1->GetSiteInstance()->increment_active_frame_count(); | 1850 rfh1->GetSiteInstance()->increment_active_frame_count(); |
1872 | 1851 |
1873 // Navigate to new site, simulating onbeforeunload approval. | 1852 // Navigate to new site, simulating onbeforeunload approval. |
1874 controller().LoadURL( | 1853 controller().LoadURL( |
1875 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 1854 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
1876 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | |
1877 rfh1->PrepareForCommit(); | 1855 rfh1->PrepareForCommit(); |
1878 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 1856 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
1879 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); | 1857 TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); |
1880 | 1858 |
1881 // The new page commits. | 1859 // The new page commits. |
1882 contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2, | 1860 contents()->TestDidNavigate(rfh2, 1, kUrl2, ui::PAGE_TRANSITION_TYPED); |
1883 ui::PAGE_TRANSITION_TYPED); | |
1884 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); | 1861 EXPECT_FALSE(contents()->CrossProcessNavigationPending()); |
1885 EXPECT_EQ(rfh2, contents()->GetMainFrame()); | 1862 EXPECT_EQ(rfh2, contents()->GetMainFrame()); |
1886 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); | 1863 EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); |
1887 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); | 1864 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh2->rfh_state()); |
1888 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); | 1865 EXPECT_EQ(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT, rfh1->rfh_state()); |
1889 | 1866 |
1890 // Simulate the swap out ack. | 1867 // Simulate the swap out ack. |
1891 rfh1->OnSwappedOut(); | 1868 rfh1->OnSwappedOut(); |
1892 | 1869 |
1893 // rfh1 should be swapped out. | 1870 // rfh1 should be swapped out. |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2103 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); |
2127 contents2->NavigateAndCommit(kUrl3); | 2104 contents2->NavigateAndCommit(kUrl3); |
2128 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2105 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); |
2129 EXPECT_NE(nullptr, | 2106 EXPECT_NE(nullptr, |
2130 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); | 2107 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); |
2131 EXPECT_EQ(nullptr, | 2108 EXPECT_EQ(nullptr, |
2132 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); | 2109 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); |
2133 } | 2110 } |
2134 | 2111 |
2135 } // namespace content | 2112 } // namespace content |
OLD | NEW |