diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 21:03:58 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 21:03:58 +0000 |
commit | 58faf940cadadfb0cfd5eb061c66d56fbc29b0d6 (patch) | |
tree | 5748f400594712d3e11f0fa7587290d6ae8d0f8e /content/browser/frame_host/frame_tree_browsertest.cc | |
parent | b91119e2dcd92057f9de00361b1206aa1f4e3fb9 (diff) | |
download | chromium_src-58faf940cadadfb0cfd5eb061c66d56fbc29b0d6.zip chromium_src-58faf940cadadfb0cfd5eb061c66d56fbc29b0d6.tar.gz chromium_src-58faf940cadadfb0cfd5eb061c66d56fbc29b0d6.tar.bz2 |
Unify frame IDs with RenderFrameHost routing IDs.
This eliminates a lot of unnecessary code around FrameTreeNode::frame_id_, which was also incorrect if two frames had the same frame ID in different processes.
BUG=314791
Review URL: https://codereview.chromium.org/172063002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/frame_host/frame_tree_browsertest.cc')
-rw-r--r-- | content/browser/frame_host/frame_tree_browsertest.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/content/browser/frame_host/frame_tree_browsertest.cc b/content/browser/frame_host/frame_tree_browsertest.cc index 9a67097..b384391 100644 --- a/content/browser/frame_host/frame_tree_browsertest.cc +++ b/content/browser/frame_host/frame_tree_browsertest.cc @@ -70,15 +70,11 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, FrameTreeShape2) { test_server()->GetURL("files/frame_tree/top.html")); WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents()); - RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( - wc->GetRenderViewHost()); FrameTreeNode* root = wc->GetFrameTree()->root(); - // Check that the root node is properly created with the frame id of the - // initial navigation. + // Check that the root node is properly created. ASSERT_EQ(3UL, root->child_count()); EXPECT_EQ(std::string(), root->frame_name()); - EXPECT_EQ(rvh->main_frame_id(), root->frame_id()); ASSERT_EQ(2UL, root->child_at(0)->child_count()); EXPECT_STREQ("1-1-name", root->child_at(0)->frame_name().c_str()); @@ -97,7 +93,6 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, FrameTreeShape2) { root = wc->GetFrameTree()->root(); EXPECT_EQ(0UL, root->child_count()); EXPECT_EQ(std::string(), root->frame_name()); - EXPECT_EQ(rvh->main_frame_id(), root->frame_id()); } // Test that we can navigate away if the previous renderer doesn't clean up its @@ -114,22 +109,16 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, FrameTreeAfterCrash) { NavigateToURL(shell(), GURL(kChromeUICrashURL)); crash_observer.Wait(); - // The frame tree should be cleared, and the frame ID should be reset. + // The frame tree should be cleared. WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents()); - RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( - wc->GetRenderViewHost()); FrameTreeNode* root = wc->GetFrameTree()->root(); EXPECT_EQ(0UL, root->child_count()); - EXPECT_EQ(FrameTreeNode::kInvalidFrameId, root->frame_id()); - EXPECT_EQ(rvh->main_frame_id(), root->frame_id()); // Navigate to a new URL. - NavigateToURL(shell(), test_server()->GetURL("files/title1.html")); - - // The frame ID should now be set. + GURL url(test_server()->GetURL("files/title1.html")); + NavigateToURL(shell(), url); EXPECT_EQ(0UL, root->child_count()); - EXPECT_NE(FrameTreeNode::kInvalidFrameId, root->frame_id()); - EXPECT_EQ(rvh->main_frame_id(), root->frame_id()); + EXPECT_EQ(url, root->current_url()); } // Test that we can navigate away if the previous renderer doesn't clean up its @@ -162,9 +151,8 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, NavigateWithLeftoverFrames) { shell()->LoadURL(base_url.Resolve("blank.html")); tab_observer.Wait(); - // The frame tree should now be cleared, and the frame ID should be valid. + // The frame tree should now be cleared. EXPECT_EQ(0UL, root->child_count()); - EXPECT_NE(FrameTreeNode::kInvalidFrameId, root->frame_id()); } } // namespace content |