forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore_winrt_util_unittest.cc
34 lines (27 loc) · 987 Bytes
/
core_winrt_util_unittest.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/win/core_winrt_util.h"
#include "base/win/com_init_util.h"
#include "base/win/scoped_com_initializer.h"
#include "base/win/windows_version.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace win {
TEST(CoreWinrtUtilTest, PreloadFunctions) {
if (GetVersion() < Version::WIN8)
EXPECT_FALSE(ResolveCoreWinRTDelayload());
else
EXPECT_TRUE(ResolveCoreWinRTDelayload());
}
TEST(CoreWinrtUtilTest, RoInitializeAndUninitialize) {
if (GetVersion() < Version::WIN8)
return;
ASSERT_TRUE(ResolveCoreWinRTDelayload());
ASSERT_HRESULT_SUCCEEDED(base::win::RoInitialize(RO_INIT_MULTITHREADED));
AssertComApartmentType(ComApartmentType::MTA);
base::win::RoUninitialize();
AssertComApartmentType(ComApartmentType::NONE);
}
} // namespace win
} // namespace base