Commit f678881d authored by Frank Li's avatar Frank Li Committed by Commit Bot

media: Skip DXGIDeviceScopedHandleTest.UseDXGIDeviceScopedHandle test on Win7

Bug: 1040237
Change-Id: I0c29e343b139b3ed8d643ed14dbf3e5ca95e02ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992562Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729540}
parent 91cbd757
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <d3d11.h> #include <d3d11.h>
#include <mfapi.h> #include <mfapi.h>
#include "base/win/windows_version.h"
#include "media/base/test_helpers.h" #include "media/base/test_helpers.h"
#include "media/base/win/mf_helpers.h" #include "media/base/win/mf_helpers.h"
#include "media/base/win/mf_initializer.h" #include "media/base/win/mf_initializer.h"
...@@ -15,11 +16,15 @@ using Microsoft::WRL::ComPtr; ...@@ -15,11 +16,15 @@ using Microsoft::WRL::ComPtr;
class DXGIDeviceScopedHandleTest : public testing::Test { class DXGIDeviceScopedHandleTest : public testing::Test {
public: public:
DXGIDeviceScopedHandleTest() = default; DXGIDeviceScopedHandleTest()
: test_supported_(base::win::GetVersion() >= base::win::Version::WIN10) {}
~DXGIDeviceScopedHandleTest() override = default; ~DXGIDeviceScopedHandleTest() override = default;
protected: protected:
void SetUp() override { void SetUp() override {
if (!test_supported_)
return;
ASSERT_TRUE(InitializeMediaFoundation()); ASSERT_TRUE(InitializeMediaFoundation());
// Get a shared DXGI Device Manager from Media Foundation. // Get a shared DXGI Device Manager from Media Foundation.
...@@ -50,16 +55,23 @@ class DXGIDeviceScopedHandleTest : public testing::Test { ...@@ -50,16 +55,23 @@ class DXGIDeviceScopedHandleTest : public testing::Test {
} }
void TearDown() override { void TearDown() override {
ASSERT_HRESULT_SUCCEEDED(MFUnlockDXGIDeviceManager()); if (test_supported_) {
ASSERT_HRESULT_SUCCEEDED(MFUnlockDXGIDeviceManager());
}
} }
Microsoft::WRL::ComPtr<IMFDXGIDeviceManager> dxgi_device_man_ = nullptr; Microsoft::WRL::ComPtr<IMFDXGIDeviceManager> dxgi_device_man_ = nullptr;
UINT device_reset_token_ = 0; UINT device_reset_token_ = 0;
const bool test_supported_;
}; };
TEST_F(DXGIDeviceScopedHandleTest, UseDXGIDeviceScopedHandle) { TEST_F(DXGIDeviceScopedHandleTest, UseDXGIDeviceScopedHandle) {
if (!test_supported_)
return;
{ {
// Create DXGIDeviceScopedHandle in an inner scope without LockDevice call. // Create DXGIDeviceScopedHandle in an inner scope without LockDevice
// call.
mf::DXGIDeviceScopedHandle device_handle_1(dxgi_device_man_.Get()); mf::DXGIDeviceScopedHandle device_handle_1(dxgi_device_man_.Get());
} }
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment