OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/scoped_comptr.h" | 5 #include "base/scoped_comptr.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "chrome/common/win_util.h" | |
8 | 7 |
9 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
10 #include <shlobj.h> | 9 #include <shlobj.h> |
11 | 10 |
12 TEST(ScopedComPtrTest, ScopedComPtr) { | 11 TEST(ScopedComPtrTest, ScopedComPtr) { |
13 EXPECT_TRUE(memcmp(&scoped_comptr<IUnknown>::iid(), &IID_IUnknown, | 12 EXPECT_TRUE(memcmp(&scoped_comptr<IUnknown>::iid(), &IID_IUnknown, |
14 sizeof(IID)) == 0); | 13 sizeof(IID)) == 0); |
15 | 14 |
16 EXPECT_TRUE(SUCCEEDED(::CoInitialize(NULL))); | 15 EXPECT_TRUE(SUCCEEDED(::CoInitialize(NULL))); |
17 | 16 |
(...skipping 24 matching lines...) Expand all Loading... |
42 EXPECT_TRUE(unk != NULL); | 41 EXPECT_TRUE(unk != NULL); |
43 unk.Release(); | 42 unk.Release(); |
44 EXPECT_TRUE(unk == NULL); | 43 EXPECT_TRUE(unk == NULL); |
45 EXPECT_TRUE(unk.IsSameObject(copy1)); // both are NULL | 44 EXPECT_TRUE(unk.IsSameObject(copy1)); // both are NULL |
46 } | 45 } |
47 | 46 |
48 ::CoUninitialize(); | 47 ::CoUninitialize(); |
49 } | 48 } |
50 | 49 |
51 #endif // defined(OS_WIN) | 50 #endif // defined(OS_WIN) |
OLD | NEW |