| 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/incident_reporting/binary_integrity_incid
ent.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incid
ent.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "components/safe_browsing/csd.pb.h" | 14 #include "components/safe_browsing/common/csd.pb.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace safe_browsing { | 17 namespace safe_browsing { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 std::unique_ptr<Incident> MakeIncident(const char* file_basename) { | 21 std::unique_ptr<Incident> MakeIncident(const char* file_basename) { |
| 22 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> | 22 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> |
| 23 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident); | 23 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident); |
| 24 | 24 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 ASSERT_EQ(MakeIncident("foo")->ComputeDigest(), | 57 ASSERT_EQ(MakeIncident("foo")->ComputeDigest(), |
| 58 MakeIncident("foo")->ComputeDigest()); | 58 MakeIncident("foo")->ComputeDigest()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 TEST(BinaryIntegrityIncident, DifferentIncidentDifferentDigest) { | 61 TEST(BinaryIntegrityIncident, DifferentIncidentDifferentDigest) { |
| 62 ASSERT_NE(MakeIncident("foo")->ComputeDigest(), | 62 ASSERT_NE(MakeIncident("foo")->ComputeDigest(), |
| 63 MakeIncident("bar")->ComputeDigest()); | 63 MakeIncident("bar")->ComputeDigest()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace safe_browsing | 66 } // namespace safe_browsing |
| OLD | NEW |