| 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" |
| 11 #include "content/browser/frame_host/render_frame_host_impl.h" | 11 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 12 #include "content/browser/renderer_host/render_message_filter.h" | 12 #include "content/browser/renderer_host/render_message_filter.h" |
| 13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 14 #include "content/browser/renderer_host/render_widget_helper.h" | 14 #include "content/browser/renderer_host/render_widget_helper.h" |
| 15 #include "content/common/frame_messages.h" | 15 #include "content/common/frame_messages.h" |
| 16 #include "content/common/input_messages.h" | 16 #include "content/common/input_messages.h" |
| 17 #include "content/common/view_messages.h" | 17 #include "content/common/view_messages.h" |
| 18 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
| 19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 20 #include "content/public/browser/storage_partition.h" |
| 20 #include "content/public/common/bindings_policy.h" | 21 #include "content/public/common/bindings_policy.h" |
| 21 #include "content/public/common/drop_data.h" | 22 #include "content/public/common/drop_data.h" |
| 22 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 23 #include "content/public/test/mock_render_process_host.h" | 24 #include "content/public/test/mock_render_process_host.h" |
| 24 #include "content/test/test_content_browser_client.h" | 25 #include "content/test/test_content_browser_client.h" |
| 25 #include "content/test/test_render_view_host.h" | 26 #include "content/test/test_render_view_host.h" |
| 26 #include "content/test/test_web_contents.h" | 27 #include "content/test/test_web_contents.h" |
| 27 #include "net/base/filename_util.h" | 28 #include "net/base/filename_util.h" |
| 28 #include "third_party/WebKit/public/web/WebDragOperation.h" | 29 #include "third_party/WebKit/public/web/WebDragOperation.h" |
| 29 #include "ui/base/page_transition_types.h" | 30 #include "ui/base/page_transition_types.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 EXPECT_NE(test_rvh()->GetRoutingID(), root_rfh->routing_id()); | 242 EXPECT_NE(test_rvh()->GetRoutingID(), root_rfh->routing_id()); |
| 242 } | 243 } |
| 243 | 244 |
| 244 class TestSaveImageFromDataURL : public RenderMessageFilter { | 245 class TestSaveImageFromDataURL : public RenderMessageFilter { |
| 245 public: | 246 public: |
| 246 TestSaveImageFromDataURL( | 247 TestSaveImageFromDataURL( |
| 247 BrowserContext* context) | 248 BrowserContext* context) |
| 248 : RenderMessageFilter( | 249 : RenderMessageFilter( |
| 249 0, | 250 0, |
| 250 context, | 251 context, |
| 251 context->GetRequestContext(), | 252 BrowserContext::GetDefaultStoragePartition(context)-> |
| 253 GetURLRequestContext(), |
| 252 nullptr, | 254 nullptr, |
| 253 nullptr, | 255 nullptr, |
| 254 nullptr, | 256 nullptr, |
| 255 nullptr) { | 257 nullptr) { |
| 256 Reset(); | 258 Reset(); |
| 257 } | 259 } |
| 258 | 260 |
| 259 void Reset() { | 261 void Reset() { |
| 260 url_string_ = std::string(); | 262 url_string_ = std::string(); |
| 261 is_downloaded_ = false; | 263 is_downloaded_ = false; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 const std::string data_url = "data:image/gif;base64," | 304 const std::string data_url = "data:image/gif;base64," |
| 303 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; | 305 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; |
| 304 | 306 |
| 305 tester->Reset(); | 307 tester->Reset(); |
| 306 tester->Test(data_url); | 308 tester->Test(data_url); |
| 307 EXPECT_EQ(tester->UrlString(), data_url); | 309 EXPECT_EQ(tester->UrlString(), data_url); |
| 308 EXPECT_TRUE(tester->IsDownloaded()); | 310 EXPECT_TRUE(tester->IsDownloaded()); |
| 309 } | 311 } |
| 310 | 312 |
| 311 } // namespace content | 313 } // namespace content |
| OLD | NEW |