Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: base/memory/ref_counted_unittest.cc

Issue 623633002: scoped_refptr: support opaque pointed-to classes via extern template (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header guard Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/ref_counted.h ('k') | base/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted_unittest.cc
diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc
index e8eb0fd90f6c507912299eec14a53ef015e027c2..7e73bde1155db44e11eb2bdf071091782a648ce6 100644
--- a/base/memory/ref_counted_unittest.cc
+++ b/base/memory/ref_counted_unittest.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "base/memory/ref_counted.h"
+
+#include "base/test/opaque_ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -60,3 +62,13 @@ TEST(RefCountedUnitTest, ScopedRefPtrToSelf) {
check->SelfDestruct();
EXPECT_TRUE(ScopedRefPtrToSelf::was_destroyed());
}
+
+TEST(RefCountedUnitTest, ScopedRefPtrToOpaque) {
+ scoped_refptr<base::OpaqueRefCounted> p = base::MakeOpaqueRefCounted();
+ base::TestOpaqueRefCounted(p);
+
+ scoped_refptr<base::OpaqueRefCounted> q;
+ q = p;
+ base::TestOpaqueRefCounted(p);
+ base::TestOpaqueRefCounted(q);
+}
« no previous file with comments | « base/memory/ref_counted.h ('k') | base/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698