summaryrefslogtreecommitdiffstats
path: root/chromium/base/profiler/stack_copier_unittest.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 17:21:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 16:25:15 +0000
commitc551f43206405019121bd2b2c93714319a0a3300 (patch)
tree1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/base/profiler/stack_copier_unittest.cc
parent7961cea6d1041e3e454dae6a1da660b453efd238 (diff)
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/profiler/stack_copier_unittest.cc')
-rw-r--r--chromium/base/profiler/stack_copier_unittest.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/chromium/base/profiler/stack_copier_unittest.cc b/chromium/base/profiler/stack_copier_unittest.cc
index a065c9f9a72..b4a81ef4b8b 100644
--- a/chromium/base/profiler/stack_copier_unittest.cc
+++ b/chromium/base/profiler/stack_copier_unittest.cc
@@ -15,6 +15,12 @@ namespace base {
namespace {
+class CopyFunctions : public StackCopier {
+ public:
+ using StackCopier::CopyStackContentsAndRewritePointers;
+ using StackCopier::RewritePointerIfInOriginalStack;
+};
+
static constexpr size_t kTestStackBufferSize = sizeof(uintptr_t) * 4;
union alignas(StackBuffer::kPlatformStackAlignment) TestStackBuffer {
@@ -29,7 +35,7 @@ TEST(StackCopierTest, RewritePointerIfInOriginalStack_InStack) {
uintptr_t original_stack[4];
uintptr_t stack_copy[4];
EXPECT_EQ(reinterpret_cast<uintptr_t>(&stack_copy[2]),
- StackCopier::RewritePointerIfInOriginalStack(
+ CopyFunctions::RewritePointerIfInOriginalStack(
reinterpret_cast<uint8_t*>(&original_stack[0]),
&original_stack[0] + base::size(original_stack),
reinterpret_cast<uint8_t*>(&stack_copy[0]),
@@ -44,7 +50,7 @@ TEST(StackCopierTest, RewritePointerIfInOriginalStack_NotInStack) {
uintptr_t stack_copy[4];
EXPECT_EQ(reinterpret_cast<uintptr_t>(&non_stack_location),
- StackCopier::RewritePointerIfInOriginalStack(
+ CopyFunctions::RewritePointerIfInOriginalStack(
reinterpret_cast<uint8_t*>(&original_stack[0]),
&original_stack[0] + size(original_stack),
reinterpret_cast<uint8_t*>(&stack_copy[0]),
@@ -62,7 +68,7 @@ TEST(StackCopierTest, StackCopy) {
reinterpret_cast<uintptr_t>(&original_stack.as_uintptr[1]);
TestStackBuffer stack_copy;
- StackCopier::CopyStackContentsAndRewritePointers(
+ CopyFunctions::CopyStackContentsAndRewritePointers(
&original_stack.as_uint8[0],
&original_stack.as_uintptr[0] + size(original_stack.as_uintptr),
StackBuffer::kPlatformStackAlignment, &stack_copy.as_uintptr[0]);
@@ -97,7 +103,7 @@ TEST(StackCopierTest, StackCopy_NonAlignedStackPointerCopy) {
TestStackBuffer stack_copy_buffer = {{0}};
const uint8_t* stack_copy_bottom =
- StackCopier::CopyStackContentsAndRewritePointers(
+ CopyFunctions::CopyStackContentsAndRewritePointers(
unaligned_stack_bottom, stack_top,
StackBuffer::kPlatformStackAlignment,
&stack_copy_buffer.as_uintptr[0]);
@@ -144,7 +150,7 @@ TEST(StackCopierTest, StackCopy_NonAlignedStackPointerUnalignedRewriteAtStart) {
TestStackBuffer stack_copy_buffer = {{0}};
const uint8_t* stack_copy_bottom =
- StackCopier::CopyStackContentsAndRewritePointers(
+ CopyFunctions::CopyStackContentsAndRewritePointers(
unaligned_stack_bottom,
&stack_buffer.as_uintptr[0] + size(stack_buffer.as_uintptr),
StackBuffer::kPlatformStackAlignment,
@@ -181,7 +187,7 @@ TEST(StackCopierTest,
TestStackBuffer stack_copy_buffer = {{0}};
const uint8_t* stack_copy_bottom =
- StackCopier::CopyStackContentsAndRewritePointers(
+ CopyFunctions::CopyStackContentsAndRewritePointers(
unaligned_stack_bottom,
&stack_buffer.as_uintptr[0] + size(stack_buffer.as_uintptr),
StackBuffer::kPlatformStackAlignment,
@@ -212,7 +218,7 @@ TEST(StackCopierTest, StackCopy_NonAlignedStackPointerAlignedRewrite) {
TestStackBuffer stack_copy_buffer = {{0}};
- StackCopier::CopyStackContentsAndRewritePointers(
+ CopyFunctions::CopyStackContentsAndRewritePointers(
unaligned_stack_bottom,
&stack_buffer.as_uintptr[0] + size(stack_buffer.as_uintptr),
StackBuffer::kPlatformStackAlignment, &stack_copy_buffer.as_uintptr[0]);