mac/arm64: recognize “Apple M1” as a valid CPU vendor

The DTK reported “Apple processor” in this spot, but shipping hardware
now seems to use “Apple M1”. The DTK is no longer relevant, but for some
degree of future-proofing, look for “Apple ” as prefix in the test.

Test: snapshot_test SystemSnapshotMacTest.CPUVendor
Bug: chromium:1222625
Change-Id: I6ead87ebe9aa078ef9a95e5bcc6a9e5ca8c3b55a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2976787
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2021-06-22 10:55:22 -04:00 committed by Crashpad LUCI CQ
parent cbec52f327
commit 883a64e8ee
4 changed files with 6 additions and 3 deletions

View File

@ -152,7 +152,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_snapshot_test") {
deps = [
"snapshot:snapshot_test",
"test:googletest_main",
"test:googlemock_main",
]
}

View File

@ -433,6 +433,7 @@ source_set("snapshot_test") {
"../compat",
"../minidump:format",
"../test",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",

View File

@ -19,6 +19,7 @@
#include <string>
#include "build/build_config.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "snapshot/mac/process_reader_mac.h"
#include "test/errors.h"
@ -90,7 +91,7 @@ TEST_F(SystemSnapshotMacTest, CPUVendor) {
FAIL() << "cpu_vendor " << cpu_vendor;
}
#elif defined(ARCH_CPU_ARM64)
EXPECT_EQ(cpu_vendor, "Apple processor");
EXPECT_THAT(cpu_vendor, testing::StartsWith("Apple "));
#else
#error port to your architecture
#endif

View File

@ -59,8 +59,9 @@
'snapshot.gyp:crashpad_snapshot',
'../client/client.gyp:crashpad_client',
'../compat/compat.gyp:crashpad_compat',
'../test/test.gyp:crashpad_googletest_main',
'../test/test.gyp:crashpad_googlemock_main',
'../test/test.gyp:crashpad_test',
'../third_party/googletest/googlemock.gyp:googlemock',
'../third_party/googletest/googletest.gyp:googletest',
'../third_party/mini_chromium/mini_chromium.gyp:base',
'../util/util.gyp:crashpad_util',