Add unit test that operator New is shimmed onto BRP

Validate that allocator shims are working, at least for standalone
unit tests.

Change-Id: I3fd0c6ea968384d1faf82647a2396a5e0c67407e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/108011
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/unowned_ptr_unittest.cpp b/core/fxcrt/unowned_ptr_unittest.cpp
index 3c7c137..15872da 100644
--- a/core/fxcrt/unowned_ptr_unittest.cpp
+++ b/core/fxcrt/unowned_ptr_unittest.cpp
@@ -259,4 +259,14 @@
   EXPECT_FALSE(pdfium::Contains(holder, &foos[1]));
 }
 
+#if defined(PDF_USE_PARTITION_ALLOC)
+#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+TEST(UnownedPtr, NewOperatorResultIsBRP) {
+  auto obj = std::make_unique<Clink>();
+  EXPECT_TRUE(partition_alloc::IsManagedByPartitionAllocBRPPool(
+      reinterpret_cast<uintptr_t>(obj.get())));
+}
+#endif
+#endif
+
 }  // namespace fxcrt