OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/child_process_security_policy_impl.h" | 5 #include "content/browser/child_process_security_policy_impl.h" |
6 #include "content/browser/renderer_host/test_render_view_host.h" | 6 #include "content/browser/renderer_host/test_render_view_host.h" |
7 #include "content/browser/tab_contents/navigation_controller_impl.h" | 7 #include "content/browser/tab_contents/navigation_controller_impl.h" |
8 #include "content/browser/tab_contents/test_tab_contents.h" | 8 #include "content/browser/tab_contents/test_tab_contents.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 TEST_F(RenderViewHostTest, StartDragging) { | 126 TEST_F(RenderViewHostTest, StartDragging) { |
127 TestTabContents* tab_contents = contents(); | 127 TestTabContents* tab_contents = contents(); |
128 MockDraggingRenderViewHostDelegateView view_delegate; | 128 MockDraggingRenderViewHostDelegateView view_delegate; |
129 tab_contents->set_view_delegate(&view_delegate); | 129 tab_contents->set_view_delegate(&view_delegate); |
130 | 130 |
131 WebDropData drop_data; | 131 WebDropData drop_data; |
132 GURL file_url = GURL("file:///home/user/secrets.txt"); | 132 GURL file_url = GURL("file:///home/user/secrets.txt"); |
133 drop_data.url = file_url; | 133 drop_data.url = file_url; |
134 drop_data.html_base_url = file_url; | 134 drop_data.html_base_url = file_url; |
135 test_rvh()->TestOnMsgStartDragging(drop_data); | 135 test_rvh()->TestOnMsgStartDragging(drop_data); |
136 EXPECT_TRUE(view_delegate.drag_url().is_empty()); | 136 EXPECT_EQ(GURL("about:blank"), view_delegate.drag_url()); |
137 EXPECT_TRUE(view_delegate.html_base_url().is_empty()); | 137 EXPECT_EQ(GURL("about:blank"), view_delegate.html_base_url()); |
138 | 138 |
139 GURL http_url = GURL("http://www.domain.com/index.html"); | 139 GURL http_url = GURL("http://www.domain.com/index.html"); |
140 drop_data.url = http_url; | 140 drop_data.url = http_url; |
141 drop_data.html_base_url = http_url; | 141 drop_data.html_base_url = http_url; |
142 test_rvh()->TestOnMsgStartDragging(drop_data); | 142 test_rvh()->TestOnMsgStartDragging(drop_data); |
143 EXPECT_EQ(http_url, view_delegate.drag_url()); | 143 EXPECT_EQ(http_url, view_delegate.drag_url()); |
144 EXPECT_EQ(http_url, view_delegate.html_base_url()); | 144 EXPECT_EQ(http_url, view_delegate.html_base_url()); |
145 | 145 |
146 GURL https_url = GURL("https://www.domain.com/index.html"); | 146 GURL https_url = GURL("https://www.domain.com/index.html"); |
147 drop_data.url = https_url; | 147 drop_data.url = https_url; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // the code actually expects it to have at least one int para, this this | 204 // the code actually expects it to have at least one int para, this this |
205 // bogus message will not fail at de-serialization but should fail in | 205 // bogus message will not fail at de-serialization but should fail in |
206 // OnMsgInputEventAck() processing. | 206 // OnMsgInputEventAck() processing. |
207 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, | 207 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, |
208 IPC::Message::PRIORITY_NORMAL); | 208 IPC::Message::PRIORITY_NORMAL); |
209 test_rvh()->TestOnMessageReceived(message); | 209 test_rvh()->TestOnMessageReceived(message); |
210 EXPECT_EQ(1, process()->bad_msg_count()); | 210 EXPECT_EQ(1, process()->bad_msg_count()); |
211 } | 211 } |
212 | 212 |
213 #endif | 213 #endif |
OLD | NEW |