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/signature_evaluator_mac.h" | 5 #include "chrome/browser/safe_browsing/signature_evaluator_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/xattr.h> | 10 #include <sys/xattr.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
17 #include "base/files/scoped_temp_dir.h" | 17 #include "base/files/scoped_temp_dir.h" |
18 #include "base/mac/scoped_cftyperef.h" | 18 #include "base/mac/scoped_cftyperef.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/strings/sys_string_conversions.h" | 20 #include "base/strings/sys_string_conversions.h" |
21 #include "base/test/scoped_path_override.h" | 21 #include "base/test/scoped_path_override.h" |
22 #include "chrome/browser/safe_browsing/incident_reporting/incident.h" | 22 #include "chrome/browser/safe_browsing/incident_reporting/incident.h" |
23 #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver
.h" | 23 #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver
.h" |
24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/safe_browsing/csd.pb.h" | 25 #include "components/safe_browsing/csd.pb.h" |
26 #include "testing/gmock/include/gmock/gmock-matchers.h" | 26 #include "testing/gmock/include/gmock/gmock-matchers.h" |
27 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
29 | 29 |
30 using ::testing::_; | 30 using ::testing::_; |
31 using ::testing::StrictMock; | 31 using ::testing::StrictMock; |
32 | 32 |
33 namespace safe_browsing { | 33 namespace safe_browsing { |
34 | 34 |
35 namespace { | 35 namespace { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 std::vector<std::string> xattrs_seen; | 328 std::vector<std::string> xattrs_seen; |
329 for (const auto& xattr : mainmenunib->signature().xattr()) { | 329 for (const auto& xattr : mainmenunib->signature().xattr()) { |
330 ASSERT_TRUE(xattr.has_key()); | 330 ASSERT_TRUE(xattr.has_key()); |
331 EXPECT_TRUE(xattr.has_value()); | 331 EXPECT_TRUE(xattr.has_value()); |
332 xattrs_seen.push_back(xattr.key()); | 332 xattrs_seen.push_back(xattr.key()); |
333 } | 333 } |
334 EXPECT_THAT(xattrs_known, ::testing::ContainerEq(xattrs_seen)); | 334 EXPECT_THAT(xattrs_known, ::testing::ContainerEq(xattrs_seen)); |
335 } | 335 } |
336 | 336 |
337 } // namespace safe_browsing | 337 } // namespace safe_browsing |
OLD | NEW |