diff --git a/BUILD.gn b/BUILD.gn index dfa7b1f9..666784af 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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", ] } diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index 70e4a310..2d613b6f 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -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", diff --git a/snapshot/mac/system_snapshot_mac_test.cc b/snapshot/mac/system_snapshot_mac_test.cc index bdbc2962..0cf1a7cf 100644 --- a/snapshot/mac/system_snapshot_mac_test.cc +++ b/snapshot/mac/system_snapshot_mac_test.cc @@ -19,6 +19,7 @@ #include #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 diff --git a/snapshot/snapshot_test.gyp b/snapshot/snapshot_test.gyp index a4d4d9e0..361a33a7 100644 --- a/snapshot/snapshot_test.gyp +++ b/snapshot/snapshot_test.gyp @@ -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',