Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / renderer / render_view_browsertest.cc
index 7ffa3fa..19c3d43 100644 (file)
@@ -3,13 +3,16 @@
 // found in the LICENSE file.
 
 #include "base/basictypes.h"
-
+#include "base/bind.h"
+#include "base/callback.h"
 #include "base/memory/shared_memory.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/windows_version.h"
+#include "content/common/frame_messages.h"
 #include "content/common/ssl_status_serialization.h"
 #include "content/common/view_messages.h"
+#include "content/public/browser/browser_context.h"
 #include "content/public/browser/native_web_keyboard_event.h"
 #include "content/public/browser/web_ui_controller_factory.h"
 #include "content/public/common/bindings_policy.h"
 #include "content/public/renderer/document_state.h"
 #include "content/public/renderer/history_item_serialization.h"
 #include "content/public/renderer/navigation_state.h"
+#include "content/public/test/browser_test_utils.h"
 #include "content/public/test/render_view_test.h"
+#include "content/public/test/test_utils.h"
 #include "content/renderer/render_view_impl.h"
-#include "content/shell/browser/shell_content_browser_client.h"
-#include "content/shell/common/shell_content_client.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
 #include "content/test/mock_keyboard.h"
 #include "net/base/net_errors.h"
 #include "net/cert/cert_status_flags.h"
@@ -30,7 +35,6 @@
 #include "third_party/WebKit/public/platform/WebData.h"
 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
 #include "third_party/WebKit/public/platform/WebString.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
 #include "third_party/WebKit/public/platform/WebURLResponse.h"
 #include "third_party/WebKit/public/web/WebDataSource.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
@@ -117,8 +121,6 @@ class WebUITestWebUIControllerFactory : public WebUIControllerFactory {
   }
 };
 
-}  // namespace
-
 class RenderViewImplTest : public RenderViewTest {
  public:
   RenderViewImplTest() {
@@ -304,6 +306,8 @@ class RenderViewImplTest : public RenderViewTest {
   scoped_ptr<MockKeyboard> mock_keyboard_;
 };
 
+}  // namespace
+
 // Test that we get form state change notifications when input fields change.
 TEST_F(RenderViewImplTest, DISABLED_OnNavStateChanged) {
   // Don't want any delay for form state sync changes. This will still post a
@@ -327,11 +331,11 @@ TEST_F(RenderViewImplTest, DISABLED_OnNavStateChanged) {
 }
 
 TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
-  ViewMsg_Navigate_Params nav_params;
+  FrameMsg_Navigate_Params nav_params;
 
   // An http url will trigger a resource load so cannot be used here.
   nav_params.url = GURL("data:text/html,<div>Page</div>");
-  nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   nav_params.transition = PAGE_TRANSITION_TYPED;
   nav_params.page_id = -1;
   nav_params.is_post = true;
@@ -343,16 +347,17 @@ TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
   const std::vector<unsigned char> post_data(raw_data, raw_data + length);
   nav_params.browser_initiated_post_data = post_data;
 
-  view()->OnNavigate(nav_params);
+  frame()->OnNavigate(nav_params);
   ProcessPendingMessages();
 
   const IPC::Message* frame_navigate_msg =
       render_thread_->sink().GetUniqueMessageMatching(
-          ViewHostMsg_FrameNavigate::ID);
+          FrameHostMsg_DidCommitProvisionalLoad::ID);
   EXPECT_TRUE(frame_navigate_msg);
 
-  ViewHostMsg_FrameNavigate::Param host_nav_params;
-  ViewHostMsg_FrameNavigate::Read(frame_navigate_msg, &host_nav_params);
+  FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params;
+  FrameHostMsg_DidCommitProvisionalLoad::Read(frame_navigate_msg,
+                                              &host_nav_params);
   EXPECT_TRUE(host_nav_params.a.is_post);
 
   // Check post data sent to browser matches
@@ -531,15 +536,15 @@ TEST_F(RenderViewImplTest, SendSwapOutACK) {
 
   // If we navigate back to this RenderView, ensure we don't send a state
   // update for the swapped out URL.  (http://crbug.com/72235)
-  ViewMsg_Navigate_Params nav_params;
+  FrameMsg_Navigate_Params nav_params;
   nav_params.url = GURL("data:text/html,<div>Page B</div>");
-  nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   nav_params.transition = PAGE_TRANSITION_TYPED;
   nav_params.current_history_list_length = 1;
   nav_params.current_history_list_offset = 0;
   nav_params.pending_history_list_offset = 1;
   nav_params.page_id = -1;
-  view()->OnNavigate(nav_params);
+  frame()->OnNavigate(nav_params);
   ProcessPendingMessages();
   const IPC::Message* msg3 = render_thread_->sink().GetUniqueMessageMatching(
       ViewHostMsg_UpdateState::ID);
@@ -567,15 +572,15 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
   render_thread_->sink().ClearMessages();
 
   // Back to page A (page_id 1) and commit.
-  ViewMsg_Navigate_Params params_A;
-  params_A.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_A;
+  params_A.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_A.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_A.current_history_list_length = 2;
   params_A.current_history_list_offset = 1;
   params_A.pending_history_list_offset = 0;
   params_A.page_id = 1;
   params_A.page_state = state_A;
-  view()->OnNavigate(params_A);
+  frame()->OnNavigate(params_A);
   ProcessPendingMessages();
 
   // Respond to a swap out request.
@@ -591,27 +596,28 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
   // params.page_state of the initial page (e.g., if the new page fails the
   // provisional load in the renderer process, after we unload the old page).
   // Ensure the old page gets reloaded, not swappedout://.
-  ViewMsg_Navigate_Params nav_params;
+  FrameMsg_Navigate_Params nav_params;
   nav_params.url = GURL("data:text/html,<div>Page A</div>");
-  nav_params.navigation_type = ViewMsg_Navigate_Type::RELOAD;
+  nav_params.navigation_type = FrameMsg_Navigate_Type::RELOAD;
   nav_params.transition = PAGE_TRANSITION_RELOAD;
   nav_params.current_history_list_length = 2;
   nav_params.current_history_list_offset = 0;
   nav_params.pending_history_list_offset = 0;
   nav_params.page_id = 1;
   nav_params.page_state = state_A;
-  view()->OnNavigate(nav_params);
+  frame()->OnNavigate(nav_params);
   ProcessPendingMessages();
 
   // Verify page A committed, not swappedout://.
   const IPC::Message* frame_navigate_msg =
       render_thread_->sink().GetUniqueMessageMatching(
-          ViewHostMsg_FrameNavigate::ID);
+          FrameHostMsg_DidCommitProvisionalLoad::ID);
   EXPECT_TRUE(frame_navigate_msg);
 
   // Read URL out of the parent trait of the params object.
-  ViewHostMsg_FrameNavigate::Param commit_params;
-  ViewHostMsg_FrameNavigate::Read(frame_navigate_msg, &commit_params);
+  FrameHostMsg_DidCommitProvisionalLoad::Param commit_params;
+  FrameHostMsg_DidCommitProvisionalLoad::Read(frame_navigate_msg,
+                                              &commit_params);
   EXPECT_NE(GURL("swappedout://"), commit_params.a.url);
 }
 
@@ -668,15 +674,15 @@ TEST_F(RenderViewImplTest,  DISABLED_LastCommittedUpdateState) {
   render_thread_->sink().ClearMessages();
 
   // Go back to C and commit, preparing for our real test.
-  ViewMsg_Navigate_Params params_C;
-  params_C.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_C;
+  params_C.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_C.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_C.current_history_list_length = 4;
   params_C.current_history_list_offset = 3;
   params_C.pending_history_list_offset = 2;
   params_C.page_id = 3;
   params_C.page_state = state_C;
-  view()->OnNavigate(params_C);
+  frame()->OnNavigate(params_C);
   ProcessPendingMessages();
   render_thread_->sink().ClearMessages();
 
@@ -685,26 +691,26 @@ TEST_F(RenderViewImplTest,  DISABLED_LastCommittedUpdateState) {
   // the RenderView's page ID.
 
   // Back to page B (page_id 2), without committing.
-  ViewMsg_Navigate_Params params_B;
-  params_B.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_B;
+  params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_B.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_B.current_history_list_length = 4;
   params_B.current_history_list_offset = 2;
   params_B.pending_history_list_offset = 1;
   params_B.page_id = 2;
   params_B.page_state = state_B;
-  view()->OnNavigate(params_B);
+  frame()->OnNavigate(params_B);
 
   // Back to page A (page_id 1) and commit.
-  ViewMsg_Navigate_Params params;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_B.current_history_list_length = 4;
   params_B.current_history_list_offset = 2;
   params_B.pending_history_list_offset = 0;
   params.page_id = 1;
   params.page_state = state_A;
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
   ProcessPendingMessages();
 
   // Now ensure that the UpdateState message we receive is consistent
@@ -749,15 +755,15 @@ TEST_F(RenderViewImplTest, StaleNavigationsIgnored) {
   render_thread_->sink().ClearMessages();
 
   // Back to page A (page_id 1) and commit.
-  ViewMsg_Navigate_Params params_A;
-  params_A.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_A;
+  params_A.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_A.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_A.current_history_list_length = 2;
   params_A.current_history_list_offset = 1;
   params_A.pending_history_list_offset = 0;
   params_A.page_id = 1;
   params_A.page_state = state_A;
-  view()->OnNavigate(params_A);
+  frame()->OnNavigate(params_A);
   ProcessPendingMessages();
 
   // A new navigation commits, clearing the forward history.
@@ -767,15 +773,15 @@ TEST_F(RenderViewImplTest, StaleNavigationsIgnored) {
   EXPECT_EQ(3, view()->history_page_ids_[1]);
 
   // The browser then sends a stale navigation to B, which should be ignored.
-  ViewMsg_Navigate_Params params_B;
-  params_B.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_B;
+  params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_B.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_B.current_history_list_length = 2;
   params_B.current_history_list_offset = 0;
   params_B.pending_history_list_offset = 1;
   params_B.page_id = 2;
   params_B.page_state = state_A;  // Doesn't matter, just has to be present.
-  view()->OnNavigate(params_B);
+  frame()->OnNavigate(params_B);
 
   // State should be unchanged.
   EXPECT_EQ(2, view()->history_list_length_);
@@ -833,15 +839,15 @@ TEST_F(RenderViewImplTest, DontIgnoreBackAfterNavEntryLimit) {
   // Suppose the browser has limited the number of NavigationEntries to 2.
   // It has now dropped the first entry, but the renderer isn't notified.
   // Ensure that going back to page B (page_id 2) at offset 0 is successful.
-  ViewMsg_Navigate_Params params_B;
-  params_B.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  FrameMsg_Navigate_Params params_B;
+  params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params_B.transition = PAGE_TRANSITION_FORWARD_BACK;
   params_B.current_history_list_length = 2;
   params_B.current_history_list_offset = 1;
   params_B.pending_history_list_offset = 0;
   params_B.page_id = 2;
   params_B.page_state = state_B;
-  view()->OnNavigate(params_B);
+  frame()->OnNavigate(params_B);
   ProcessPendingMessages();
 
   EXPECT_EQ(2, view()->history_list_length_);
@@ -1552,11 +1558,11 @@ TEST_F(RenderViewImplTest, DISABLED_DidFailProvisionalLoadWithErrorForError) {
 
   // Start a load that will reach provisional state synchronously,
   // but won't complete synchronously.
-  ViewMsg_Navigate_Params params;
+  FrameMsg_Navigate_Params params;
   params.page_id = -1;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params.url = GURL("data:text/html,test data");
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
 
   // An error occurred.
   view()->main_render_frame()->didFailProvisionalLoad(web_frame, error);
@@ -1574,11 +1580,11 @@ TEST_F(RenderViewImplTest, DidFailProvisionalLoadWithErrorForCancellation) {
 
   // Start a load that will reach provisional state synchronously,
   // but won't complete synchronously.
-  ViewMsg_Navigate_Params params;
+  FrameMsg_Navigate_Params params;
   params.page_id = -1;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params.url = GURL("data:text/html,test data");
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
 
   // A cancellation occurred.
   view()->main_render_frame()->didFailProvisionalLoad(web_frame, error);
@@ -1610,7 +1616,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // No history to merge and a committed page to be kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(0, expected_page_id);
   EXPECT_EQ(1, view()->history_list_length_);
@@ -1619,7 +1625,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // No history to merge and a committed page to be pruned.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(0, expected_page_id + 1);
   EXPECT_EQ(0, view()->history_list_length_);
@@ -1627,7 +1633,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // No history to merge and a committed page that the browser was unaware of.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(0, -1);
   EXPECT_EQ(1, view()->history_list_length_);
@@ -1636,7 +1642,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // History to merge and a committed page to be kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(2, expected_page_id);
   EXPECT_EQ(3, view()->history_list_length_);
@@ -1647,7 +1653,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // History to merge and a committed page to be pruned.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(2, expected_page_id + 1);
   EXPECT_EQ(2, view()->history_list_length_);
@@ -1657,7 +1663,7 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // History to merge and a committed page that the browser was unaware of.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
   view()->OnSetHistoryLengthAndPrune(2, -1);
   EXPECT_EQ(3, view()->history_list_length_);
@@ -1670,9 +1676,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   int expected_page_id_2 = -1;
 
   // No history to merge and two committed pages, both to be kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(0, expected_page_id);
@@ -1683,9 +1689,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // No history to merge and two committed pages, and only the second is kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(0, expected_page_id_2);
@@ -1696,9 +1702,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
 
   // No history to merge and two committed pages, both of which the browser was
   // unaware of.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(0, -1);
@@ -1709,9 +1715,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // History to merge and two committed pages, both to be kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(2, expected_page_id);
@@ -1724,9 +1730,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
   ClearHistory();
 
   // History to merge and two committed pages, and only the second is kept.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(2, expected_page_id_2);
@@ -1739,9 +1745,9 @@ TEST_F(RenderViewImplTest, SetHistoryLengthAndPrune) {
 
   // History to merge and two committed pages, both of which the browser was
   // unaware of.
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id = view()->page_id_;
-  view()->didCommitProvisionalLoad(GetMainFrame(), true);
+  frame()->didCommitProvisionalLoad(GetMainFrame(), true);
   expected_page_id_2 = view()->page_id_;
   EXPECT_GT(expected_page_id_2, expected_page_id);
   view()->OnSetHistoryLengthAndPrune(2, -1);
@@ -1773,7 +1779,7 @@ TEST_F(RenderViewImplTest, ContextMenu) {
   SendWebMouseEvent(mouse_event);
 
   EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
-      ViewHostMsg_ContextMenu::ID));
+      FrameHostMsg_ContextMenu::ID));
 }
 
 TEST_F(RenderViewImplTest, TestBackForward) {
@@ -1907,16 +1913,16 @@ TEST_F(RenderViewImplTest, ZoomLimit) {
   const double kMinZoomLevel = ZoomFactorToZoomLevel(kMinimumZoomFactor);
   const double kMaxZoomLevel = ZoomFactorToZoomLevel(kMaximumZoomFactor);
 
-  ViewMsg_Navigate_Params params;
+  FrameMsg_Navigate_Params params;
   params.page_id = -1;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
 
   // Verifies navigation to a URL with preset zoom level indeed sets the level.
   // Regression test for http://crbug.com/139559, where the level was not
   // properly set when it is out of the default zoom limits of WebView.
   params.url = GURL("data:text/html,min_zoomlimit_test");
   view()->OnSetZoomLevelForLoadingURL(params.url, kMinZoomLevel);
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
   ProcessPendingMessages();
   EXPECT_DOUBLE_EQ(kMinZoomLevel, view()->GetWebView()->zoomLevel());
 
@@ -1925,7 +1931,7 @@ TEST_F(RenderViewImplTest, ZoomLimit) {
                                           ZoomFactorToZoomLevel(1.0));
   params.url = GURL("data:text/html,max_zoomlimit_test");
   view()->OnSetZoomLevelForLoadingURL(params.url, kMaxZoomLevel);
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
   ProcessPendingMessages();
   EXPECT_DOUBLE_EQ(kMaxZoomLevel, view()->GetWebView()->zoomLevel());
 }
@@ -1985,16 +1991,16 @@ TEST_F(RenderViewImplTest, NavigateFrame) {
   LoadHTML("hello <iframe srcdoc='fail' name='frame'></iframe>");
 
   // Navigate the frame only.
-  ViewMsg_Navigate_Params nav_params;
+  FrameMsg_Navigate_Params nav_params;
   nav_params.url = GURL("data:text/html,world");
-  nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   nav_params.transition = PAGE_TRANSITION_TYPED;
   nav_params.current_history_list_length = 1;
   nav_params.current_history_list_offset = 0;
   nav_params.pending_history_list_offset = 1;
   nav_params.page_id = -1;
   nav_params.frame_to_navigate = "frame";
-  view()->OnNavigate(nav_params);
+  frame()->OnNavigate(nav_params);
   ProcessPendingMessages();
 
   // Copy the document content to std::wstring and compare with the
@@ -2068,6 +2074,10 @@ class SuppressErrorPageTest : public RenderViewTest {
     return static_cast<RenderViewImpl*>(view_);
   }
 
+  RenderFrameImpl* frame() {
+    return static_cast<RenderFrameImpl*>(view()->GetMainRenderFrame());
+  }
+
  private:
   class TestContentRendererClient : public ContentRendererClient {
    public:
@@ -2107,11 +2117,11 @@ TEST_F(SuppressErrorPageTest, MAYBE_Suppresses) {
 
   // Start a load that will reach provisional state synchronously,
   // but won't complete synchronously.
-  ViewMsg_Navigate_Params params;
+  FrameMsg_Navigate_Params params;
   params.page_id = -1;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params.url = GURL("data:text/html,test data");
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
 
   // An error occurred.
   view()->main_render_frame()->didFailProvisionalLoad(web_frame, error);
@@ -2135,11 +2145,11 @@ TEST_F(SuppressErrorPageTest, MAYBE_DoesNotSuppress) {
 
   // Start a load that will reach provisional state synchronously,
   // but won't complete synchronously.
-  ViewMsg_Navigate_Params params;
+  FrameMsg_Navigate_Params params;
   params.page_id = -1;
-  params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
+  params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
   params.url = GURL("data:text/html,test data");
-  view()->OnNavigate(params);
+  frame()->OnNavigate(params);
 
   // An error occurred.
   view()->main_render_frame()->didFailProvisionalLoad(web_frame, error);