| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/safe_browsing/metadata.pb.h" | 5 #include "components/safe_browsing_db/metadata.pb.h" |
| 6 #include "chrome/browser/safe_browsing/safe_browsing_api_handler_util.h" | 6 #include "components/safe_browsing_db/safe_browsing_api_handler_util.h" |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 7 #include "components/safe_browsing_db/util.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace safe_browsing { | 10 namespace safe_browsing { |
| 11 | 11 |
| 12 class SafeBrowsingApiHandlerUtilTest : public ::testing::Test { | 12 class SafeBrowsingApiHandlerUtilTest : public ::testing::Test { |
| 13 protected: | 13 protected: |
| 14 SBThreatType threat_; | 14 SBThreatType threat_; |
| 15 std::string pb_str_; | 15 std::string pb_str_; |
| 16 | 16 |
| 17 UmaRemoteCallResult ResetAndParseJson(const std::string& json) { | 17 UmaRemoteCallResult ResetAndParseJson(const std::string& json) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 EXPECT_EQ(SB_THREAT_TYPE_URL_PHISHING, threat_); | 114 EXPECT_EQ(SB_THREAT_TYPE_URL_PHISHING, threat_); |
| 115 EXPECT_EQ(MalwarePatternType::DISTRIBUTION, ParsePatternType()); | 115 EXPECT_EQ(MalwarePatternType::DISTRIBUTION, ParsePatternType()); |
| 116 | 116 |
| 117 EXPECT_EQ(UMA_STATUS_UNSAFE, | 117 EXPECT_EQ(UMA_STATUS_UNSAFE, |
| 118 ResetAndParseJson("{\"matches\":[{\"threat_type\":\"5\", " | 118 ResetAndParseJson("{\"matches\":[{\"threat_type\":\"5\", " |
| 119 "\"se_pattern_type\":\"junk\"}]}")); | 119 "\"se_pattern_type\":\"junk\"}]}")); |
| 120 EXPECT_TRUE(pb_str_.empty()); | 120 EXPECT_TRUE(pb_str_.empty()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace safe_browsing | 123 } // namespace safe_browsing |
| OLD | NEW |