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