OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/common/page_transition_types.h" | |
6 #include "chrome/common/render_messages.h" | 5 #include "chrome/common/render_messages.h" |
7 #include "content/browser/renderer_host/test_render_view_host.h" | 6 #include "content/browser/renderer_host/test_render_view_host.h" |
8 #include "content/browser/tab_contents/navigation_controller.h" | 7 #include "content/browser/tab_contents/navigation_controller.h" |
9 #include "content/browser/tab_contents/navigation_entry.h" | 8 #include "content/browser/tab_contents/navigation_entry.h" |
10 #include "content/browser/tab_contents/test_tab_contents.h" | 9 #include "content/browser/tab_contents/test_tab_contents.h" |
| 10 #include "content/common/page_transition_types.h" |
11 | 11 |
12 class RenderViewHostTest : public RenderViewHostTestHarness { | 12 class RenderViewHostTest : public RenderViewHostTestHarness { |
13 }; | 13 }; |
14 | 14 |
15 // All about URLs reported by the renderer should get rewritten to about:blank. | 15 // All about URLs reported by the renderer should get rewritten to about:blank. |
16 // See RenderViewHost::OnMsgNavigate for a discussion. | 16 // See RenderViewHost::OnMsgNavigate for a discussion. |
17 TEST_F(RenderViewHostTest, FilterAbout) { | 17 TEST_F(RenderViewHostTest, FilterAbout) { |
18 rvh()->SendNavigate(1, GURL("about:cache")); | 18 rvh()->SendNavigate(1, GURL("about:cache")); |
19 ASSERT_TRUE(controller().GetActiveEntry()); | 19 ASSERT_TRUE(controller().GetActiveEntry()); |
20 EXPECT_EQ(GURL("about:blank"), controller().GetActiveEntry()->url()); | 20 EXPECT_EQ(GURL("about:blank"), controller().GetActiveEntry()->url()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // the code actually expects it to have at least one int para, this this | 91 // the code actually expects it to have at least one int para, this this |
92 // bogus message will not fail at de-serialization but should fail in | 92 // bogus message will not fail at de-serialization but should fail in |
93 // OnMsgInputEventAck() processing. | 93 // OnMsgInputEventAck() processing. |
94 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, | 94 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, |
95 IPC::Message::PRIORITY_NORMAL); | 95 IPC::Message::PRIORITY_NORMAL); |
96 rvh()->TestOnMessageReceived(message); | 96 rvh()->TestOnMessageReceived(message); |
97 EXPECT_EQ(1, process()->bad_msg_count()); | 97 EXPECT_EQ(1, process()->bad_msg_count()); |
98 } | 98 } |
99 | 99 |
100 #endif // NDEBUG | 100 #endif // NDEBUG |
OLD | NEW |