| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |