Commit e363e947 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Chromium LUCI CQ

profiler: fix ThreadProfilerPlatformConfigurationTest.IsSupported on Mac11

The sampling profiler isn't supported on macOS 11.0 because of the
new dyld shared cache; have the test check that it is disabled.

Bug: 1101399
Change-Id: I312a31d2bc2df3b1e5b6e9da675b11069cca4aef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643408Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846127}
parent e3eefc4a
......@@ -12,6 +12,10 @@
#include "components/version_info/version_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_MAC)
#include "base/mac/mac_util.h"
#endif
#if (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) || \
(defined(OS_MAC) && defined(ARCH_CPU_X86_64)) || \
(defined(OS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE))
......@@ -79,9 +83,18 @@ TEST_F(ThreadProfilerPlatformConfigurationTest, IsSupported) {
EXPECT_FALSE(config()->IsSupported(base::nullopt));
#else
#if defined(OS_MAC)
// Sampling profiler does not work on macOS 11.0 yet:
// https://crbug.com/1101399
const bool on_canary = base::mac::IsAtMostOS10_15();
const bool on_dev = base::mac::IsAtMostOS10_15();
#else
const bool on_canary = true;
const bool on_dev = true;
#endif
EXPECT_FALSE(config()->IsSupported(version_info::Channel::UNKNOWN));
EXPECT_TRUE(config()->IsSupported(version_info::Channel::CANARY));
EXPECT_TRUE(config()->IsSupported(version_info::Channel::DEV));
EXPECT_EQ(on_canary, config()->IsSupported(version_info::Channel::CANARY));
EXPECT_EQ(on_dev, config()->IsSupported(version_info::Channel::DEV));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::BETA));
EXPECT_FALSE(config()->IsSupported(version_info::Channel::STABLE));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment