| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/download/download_danger_prompt.h" | 9 #include "chrome/browser/download/download_danger_prompt.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 using safe_browsing::ClientDownloadResponse; | 31 using safe_browsing::ClientDownloadResponse; |
| 32 using safe_browsing::ClientSafeBrowsingReportRequest; | 32 using safe_browsing::ClientSafeBrowsingReportRequest; |
| 33 using safe_browsing::SafeBrowsingService; | 33 using safe_browsing::SafeBrowsingService; |
| 34 | 34 |
| 35 const char kTestDownloadUrl[] = "http://evildownload.com"; | 35 const char kTestDownloadUrl[] = "http://evildownload.com"; |
| 36 | 36 |
| 37 class FakeSafeBrowsingService : public SafeBrowsingService { | 37 class FakeSafeBrowsingService : public SafeBrowsingService { |
| 38 public: | 38 public: |
| 39 FakeSafeBrowsingService() {} | 39 FakeSafeBrowsingService() {} |
| 40 | 40 |
| 41 void SendDownloadRecoveryReport(const std::string& report) override { | 41 void SendSerializedDownloadReport(const std::string& report) override { |
| 42 report_ = report; | 42 report_ = report; |
| 43 } | 43 } |
| 44 | 44 |
| 45 std::string GetDownloadRecoveryReport() const { return report_; } | 45 std::string GetDownloadRecoveryReport() const { return report_; } |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 ~FakeSafeBrowsingService() override {} | 48 ~FakeSafeBrowsingService() override {} |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 std::string report_; | 51 std::string report_; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 VerifyExpectations(); | 253 VerifyExpectations(); |
| 254 | 254 |
| 255 // If the containing tab is closed, the dialog should DISMISS itself. | 255 // If the containing tab is closed, the dialog should DISMISS itself. |
| 256 OpenNewTab(); | 256 OpenNewTab(); |
| 257 SetUpExpectations(DownloadDangerPrompt::DISMISS, | 257 SetUpExpectations(DownloadDangerPrompt::DISMISS, |
| 258 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, | 258 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, |
| 259 ClientDownloadResponse::DANGEROUS); | 259 ClientDownloadResponse::DANGEROUS); |
| 260 chrome::CloseTab(browser()); | 260 chrome::CloseTab(browser()); |
| 261 VerifyExpectations(); | 261 VerifyExpectations(); |
| 262 } | 262 } |
| OLD | NEW |