| 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/values.h" | 5 #include "base/values.h" |
| 6 #include "content/browser/frame_host/navigation_entry_impl.h" | 6 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 7 #include "content/browser/web_contents/web_contents_impl.h" | 7 #include "content/browser/web_contents/web_contents_impl.h" |
| 8 #include "content/public/browser/load_notification_details.h" | 8 #include "content/public/browser/load_notification_details.h" |
| 9 #include "content/public/browser/navigation_controller.h" | 9 #include "content/public/browser/navigation_controller.h" |
| 10 #include "content/public/browser/notification_details.h" | 10 #include "content/public/browser/notification_details.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // RenderWidgetHostView adopt this new size. | 294 // RenderWidgetHostView adopt this new size. |
| 295 new_size.Enlarge(size_insets.width(), size_insets.height()); | 295 new_size.Enlarge(size_insets.width(), size_insets.height()); |
| 296 EXPECT_EQ(new_size, | 296 EXPECT_EQ(new_size, |
| 297 shell()->web_contents()->GetRenderWidgetHostView()->GetViewBounds(). | 297 shell()->web_contents()->GetRenderWidgetHostView()->GetViewBounds(). |
| 298 size()); | 298 size()); |
| 299 EXPECT_EQ(new_size, shell()->web_contents()->GetView()->GetContainerSize()); | 299 EXPECT_EQ(new_size, shell()->web_contents()->GetView()->GetContainerSize()); |
| 300 } | 300 } |
| 301 | 301 |
| 302 IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, OpenURLSubframe) { | 302 IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, OpenURLSubframe) { |
| 303 | 303 |
| 304 // Navigate with source_frame_id 3, FrameTreeNode ID 4. | 304 // Navigate with FrameTreeNode ID 4. |
| 305 const GURL url("http://foo"); | 305 const GURL url("http://foo"); |
| 306 OpenURLParams params(url, Referrer(), 3, 4, CURRENT_TAB, PAGE_TRANSITION_LINK, | 306 OpenURLParams params(url, Referrer(), 4, CURRENT_TAB, PAGE_TRANSITION_LINK, |
| 307 true); | 307 true); |
| 308 shell()->web_contents()->OpenURL(params); | 308 shell()->web_contents()->OpenURL(params); |
| 309 | 309 |
| 310 // Make sure the NavigationEntry ends up with the FrameTreeNode ID. | 310 // Make sure the NavigationEntry ends up with the FrameTreeNode ID. |
| 311 NavigationController* controller = &shell()->web_contents()->GetController(); | 311 NavigationController* controller = &shell()->web_contents()->GetController(); |
| 312 EXPECT_TRUE(controller->GetPendingEntry()); | 312 EXPECT_TRUE(controller->GetPendingEntry()); |
| 313 EXPECT_EQ(4, NavigationEntryImpl::FromNavigationEntry( | 313 EXPECT_EQ(4, NavigationEntryImpl::FromNavigationEntry( |
| 314 controller->GetPendingEntry())->frame_tree_node_id()); | 314 controller->GetPendingEntry())->frame_tree_node_id()); |
| 315 } | 315 } |
| 316 | 316 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 RenderFrameCreatedObserver observer(shell()); | 368 RenderFrameCreatedObserver observer(shell()); |
| 369 NavigateToURL(shell(), cross_site_url); | 369 NavigateToURL(shell(), cross_site_url); |
| 370 | 370 |
| 371 // The observer should've seen a RenderFrameCreated call for the new frame | 371 // The observer should've seen a RenderFrameCreated call for the new frame |
| 372 // and not the old one. | 372 // and not the old one. |
| 373 EXPECT_NE(observer.last_rfh(), orig_rfh); | 373 EXPECT_NE(observer.last_rfh(), orig_rfh); |
| 374 EXPECT_EQ(observer.last_rfh(), shell()->web_contents()->GetMainFrame()); | 374 EXPECT_EQ(observer.last_rfh(), shell()->web_contents()->GetMainFrame()); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace content | 377 } // namespace content |
| OLD | NEW |