| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 void Test(const std::string& url) { | 276 void Test(const std::string& url) { |
| 277 OnMessageReceived(FrameHostMsg_SaveImageFromDataURL(0, 0, url)); | 277 OnMessageReceived(FrameHostMsg_SaveImageFromDataURL(0, 0, url)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 protected: | 280 protected: |
| 281 ~TestSaveImageFromDataURL() override {} | 281 ~TestSaveImageFromDataURL() override {} |
| 282 void DownloadUrl(int render_view_id, | 282 void DownloadUrl(int render_view_id, |
| 283 int render_frame_id, | 283 int render_frame_id, |
| 284 const GURL& url, | 284 const GURL& url, |
| 285 const Referrer& referrer, | 285 const Referrer& referrer, |
| 286 const url::Origin& initiator, |
| 286 const base::string16& suggested_name, | 287 const base::string16& suggested_name, |
| 287 const bool use_prompt) const override { | 288 const bool use_prompt) const override { |
| 288 url_string_ = url.spec(); | 289 url_string_ = url.spec(); |
| 289 is_downloaded_ = true; | 290 is_downloaded_ = true; |
| 290 } | 291 } |
| 291 | 292 |
| 292 private: | 293 private: |
| 293 mutable std::string url_string_; | 294 mutable std::string url_string_; |
| 294 mutable bool is_downloaded_; | 295 mutable bool is_downloaded_; |
| 295 }; | 296 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 306 const std::string data_url = "data:image/gif;base64," | 307 const std::string data_url = "data:image/gif;base64," |
| 307 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; | 308 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; |
| 308 | 309 |
| 309 tester->Reset(); | 310 tester->Reset(); |
| 310 tester->Test(data_url); | 311 tester->Test(data_url); |
| 311 EXPECT_EQ(tester->UrlString(), data_url); | 312 EXPECT_EQ(tester->UrlString(), data_url); |
| 312 EXPECT_TRUE(tester->IsDownloaded()); | 313 EXPECT_TRUE(tester->IsDownloaded()); |
| 313 } | 314 } |
| 314 | 315 |
| 315 } // namespace content | 316 } // namespace content |
| OLD | NEW |