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

Unified Diff: base/win/scoped_comptr_unittest.cc

Issue 2865713002: Remove ScopedComPtr::IsSameObject() (Closed)
Patch Set: Created 3 years, 7 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/win/scoped_comptr.h ('k') | ui/views/accessibility/native_view_accessibility_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_comptr_unittest.cc
diff --git a/base/win/scoped_comptr_unittest.cc b/base/win/scoped_comptr_unittest.cc
index 51a20ca712aafa518bdb8f2287c7fc5438ed4a9c..0d486bd35ab1727279be4967364042459640ab00 100644
--- a/base/win/scoped_comptr_unittest.cc
+++ b/base/win/scoped_comptr_unittest.cc
@@ -51,30 +51,6 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
ScopedComPtr<IUnknown> qi_test;
EXPECT_HRESULT_SUCCEEDED(mem_alloc.CopyTo(IID_PPV_ARGS(&qi_test)));
EXPECT_TRUE(qi_test.Get() != NULL);
- qi_test.Reset();
-
- // test ScopedComPtr& constructor
- ScopedComPtr<IMalloc> copy1(mem_alloc);
- EXPECT_TRUE(copy1.IsSameObject(mem_alloc.Get()));
- EXPECT_FALSE(copy1.IsSameObject(unk2.Get())); // unk2 is valid but different
- EXPECT_FALSE(copy1.IsSameObject(unk.Get())); // unk is NULL
-
- IMalloc* naked_copy = copy1.Detach();
- copy1 = naked_copy; // Test the =(T*) operator.
- naked_copy->Release();
-
- copy1.Reset();
- EXPECT_FALSE(copy1.IsSameObject(unk2.Get())); // unk2 is valid, copy1 is not
-
- // test Interface* constructor
- ScopedComPtr<IMalloc> copy2(static_cast<IMalloc*>(mem_alloc.Get()));
- EXPECT_TRUE(copy2.IsSameObject(mem_alloc.Get()));
-
- EXPECT_TRUE(SUCCEEDED(unk.QueryFrom(mem_alloc.Get())));
- EXPECT_TRUE(unk.Get() != NULL);
- unk.Reset();
- EXPECT_TRUE(unk.Get() == NULL);
- EXPECT_TRUE(unk.IsSameObject(copy1.Get())); // both are NULL
}
TEST(ScopedComPtrTest, ScopedComPtrVector) {
« no previous file with comments | « base/win/scoped_comptr.h ('k') | ui/views/accessibility/native_view_accessibility_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698