| 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> |
| 8 |
| 9 #include "base/macros.h" |
| 7 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/common/safe_browsing/csd.pb.h" | 11 #include "chrome/common/safe_browsing/csd.pb.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 13 |
| 11 namespace safe_browsing { | 14 namespace safe_browsing { |
| 12 | 15 |
| 13 namespace { | 16 namespace { |
| 14 | 17 |
| 15 scoped_ptr<Incident> MakeIncident(const char* file_basename) { | 18 scoped_ptr<Incident> MakeIncident(const char* file_basename) { |
| 16 scoped_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> | 19 scoped_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ASSERT_EQ(MakeIncident("foo")->ComputeDigest(), | 54 ASSERT_EQ(MakeIncident("foo")->ComputeDigest(), |
| 52 MakeIncident("foo")->ComputeDigest()); | 55 MakeIncident("foo")->ComputeDigest()); |
| 53 } | 56 } |
| 54 | 57 |
| 55 TEST(BinaryIntegrityIncident, DifferentIncidentDifferentDigest) { | 58 TEST(BinaryIntegrityIncident, DifferentIncidentDifferentDigest) { |
| 56 ASSERT_NE(MakeIncident("foo")->ComputeDigest(), | 59 ASSERT_NE(MakeIncident("foo")->ComputeDigest(), |
| 57 MakeIncident("bar")->ComputeDigest()); | 60 MakeIncident("bar")->ComputeDigest()); |
| 58 } | 61 } |
| 59 | 62 |
| 60 } // namespace safe_browsing | 63 } // namespace safe_browsing |
| OLD | NEW |