Chromium Code Reviews| Index: chrome/browser/safe_browsing/download_protection_service_unittest.cc |
| diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
| index c3ccd7178c2e567d9bf3d9aedb20e0f984379ca4..dfb07f3e2fda5299a19a4e1a2694b09ec1bc2cf9 100644 |
| --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
| +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
| @@ -1853,6 +1853,17 @@ TEST_F(DownloadProtectionServiceTest, ShowDetailsForDownloadHasContext) { |
| &mock_page_navigator); |
| } |
| +TEST_F(DownloadProtectionServiceTest, GetAndSetDownloadPingToken) { |
| + content::MockDownloadItem item; |
| + std::string token = "download_ping_token"; |
| + DownloadProtectionService::SetDownloadPingToken(&item, token); |
|
Nathan Parker
2016/06/07 23:00:53
How about checking it before setting it, to ensure
Jialiu Lin
2016/06/08 00:06:16
Sure.
|
| + EXPECT_EQ(token, DownloadProtectionService::GetDownloadPingToken(&item)); |
| + |
| + DownloadProtectionService::SetDownloadPingToken(&item, std::string()); |
| + EXPECT_EQ(std::string(), |
| + DownloadProtectionService::GetDownloadPingToken(&item)); |
| +} |
| + |
| TEST_F(DownloadProtectionServiceTest, PPAPIDownloadRequest_Unsupported) { |
| base::FilePath default_file_path(FILE_PATH_LITERAL("/foo/bar/test.txt")); |
| std::vector<base::FilePath::StringType> alternate_extensions{ |