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

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

Issue 1723763002: Add WebDragData to blink::WebView::dragtargetDrop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 9 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
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // expected to be absolute on any platforms. 164 // expected to be absolute on any platforms.
165 base::FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html")); 165 base::FilePath highlighted_file_path(FILE_PATH_LITERAL("//tmp/foo.html"));
166 base::FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg")); 166 base::FilePath dragged_file_path(FILE_PATH_LITERAL("//tmp/image.jpg"));
167 base::FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd")); 167 base::FilePath sensitive_file_path(FILE_PATH_LITERAL("//etc/passwd"));
168 GURL highlighted_file_url = net::FilePathToFileURL(highlighted_file_path); 168 GURL highlighted_file_url = net::FilePathToFileURL(highlighted_file_path);
169 GURL dragged_file_url = net::FilePathToFileURL(dragged_file_path); 169 GURL dragged_file_url = net::FilePathToFileURL(dragged_file_path);
170 GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path); 170 GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path);
171 dropped_data.url = highlighted_file_url; 171 dropped_data.url = highlighted_file_url;
172 dropped_data.filenames.push_back( 172 dropped_data.filenames.push_back(
173 ui::FileInfo(dragged_file_path, base::FilePath())); 173 ui::FileInfo(dragged_file_path, base::FilePath()));
174 dropped_data.is_valid = true;
174 175
175 rvh()->DragTargetDragEnter(dropped_data, client_point, screen_point, 176 rvh()->DragTargetDragEnter(dropped_data, client_point, screen_point,
176 blink::WebDragOperationNone, 0); 177 blink::WebDragOperationNone, 0);
177 178
178 int id = process()->GetID(); 179 int id = process()->GetID();
179 ChildProcessSecurityPolicyImpl* policy = 180 ChildProcessSecurityPolicyImpl* policy =
180 ChildProcessSecurityPolicyImpl::GetInstance(); 181 ChildProcessSecurityPolicyImpl::GetInstance();
181 182
182 EXPECT_FALSE(policy->CanRequestURL(id, highlighted_file_url)); 183 EXPECT_FALSE(policy->CanRequestURL(id, highlighted_file_url));
183 EXPECT_FALSE(policy->CanReadFile(id, highlighted_file_path)); 184 EXPECT_FALSE(policy->CanReadFile(id, highlighted_file_path));
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 const std::string data_url = "data:image/gif;base64," 303 const std::string data_url = "data:image/gif;base64,"
303 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; 304 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=";
304 305
305 tester->Reset(); 306 tester->Reset();
306 tester->Test(data_url); 307 tester->Test(data_url);
307 EXPECT_EQ(tester->UrlString(), data_url); 308 EXPECT_EQ(tester->UrlString(), data_url);
308 EXPECT_TRUE(tester->IsDownloaded()); 309 EXPECT_TRUE(tester->IsDownloaded());
309 } 310 }
310 311
311 } // namespace content 312 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698