Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: content/browser/renderer_host/render_view_host_unittest.cc

Issue 12213066: Use base namespace for FilePath in content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "content/browser/child_process_security_policy_impl.h" 6 #include "content/browser/child_process_security_policy_impl.h"
7 #include "content/browser/renderer_host/test_render_view_host.h" 7 #include "content/browser/renderer_host/test_render_view_host.h"
8 #include "content/browser/web_contents/navigation_controller_impl.h" 8 #include "content/browser/web_contents/navigation_controller_impl.h"
9 #include "content/browser/web_contents/test_web_contents.h" 9 #include "content/browser/web_contents/test_web_contents.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 EXPECT_EQ(javascript_url, delegate_view.drag_url()); 152 EXPECT_EQ(javascript_url, delegate_view.drag_url());
153 EXPECT_EQ(http_url, delegate_view.html_base_url()); 153 EXPECT_EQ(http_url, delegate_view.html_base_url());
154 } 154 }
155 155
156 TEST_F(RenderViewHostTest, DragEnteredFileURLsStillBlocked) { 156 TEST_F(RenderViewHostTest, DragEnteredFileURLsStillBlocked) {
157 WebDropData dropped_data; 157 WebDropData dropped_data;
158 gfx::Point client_point; 158 gfx::Point client_point;
159 gfx::Point screen_point; 159 gfx::Point screen_point;
160 // We use "//foo/bar" path (rather than "/foo/bar") since dragged paths are 160 // We use "//foo/bar" path (rather than "/foo/bar") since dragged paths are
161 // expected to be absolute on any platforms. 161 // expected to be absolute on any platforms.
162 FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html")); 162 base::FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html"));
163 FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg")); 163 base::FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg"));
164 FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd")); 164 base::FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd"));
165 GURL highlighted_file_url = net::FilePathToFileURL(highlighted_file_path); 165 GURL highlighted_file_url = net::FilePathToFileURL(highlighted_file_path);
166 GURL dragged_file_url = net::FilePathToFileURL(dragged_file_path); 166 GURL dragged_file_url = net::FilePathToFileURL(dragged_file_path);
167 GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path); 167 GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path);
168 dropped_data.url = highlighted_file_url; 168 dropped_data.url = highlighted_file_url;
169 dropped_data.filenames.push_back(WebDropData::FileInfo( 169 dropped_data.filenames.push_back(WebDropData::FileInfo(
170 UTF8ToUTF16(dragged_file_path.AsUTF8Unsafe()), string16())); 170 UTF8ToUTF16(dragged_file_path.AsUTF8Unsafe()), string16()));
171 171
172 rvh()->DragTargetDragEnter(dropped_data, client_point, screen_point, 172 rvh()->DragTargetDragEnter(dropped_data, client_point, screen_point,
173 WebKit::WebDragOperationNone, 0); 173 WebKit::WebDragOperationNone, 0);
174 174
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // OnInputEventAck() processing. 220 // OnInputEventAck() processing.
221 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, 221 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID,
222 IPC::Message::PRIORITY_NORMAL); 222 IPC::Message::PRIORITY_NORMAL);
223 test_rvh()->OnMessageReceived(message); 223 test_rvh()->OnMessageReceived(message);
224 EXPECT_EQ(1, process()->bad_msg_count()); 224 EXPECT_EQ(1, process()->bad_msg_count());
225 } 225 }
226 226
227 #endif 227 #endif
228 228
229 } // namespace content 229 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698