As Wine currently does not have a way to set captions, returning the default value should suffice for most applications.
It looks like Windows does not do error checking for the *value parameter.
For the computed properties, they return E_INVALIDARG when all the captions are set as Default. But they return S_OK if any of the caption settings have been modified, regardless of whether a valid *value parameter is passed.
I expected it to at least return the computed values for the default properties but this does not appear to be the case. I guess there's no reason to keep the checks for each member of the computed color struct? Perhaps keep the checks for E_INVALIDARG and S_OK? I haven't come across an application that uses the functions so I didn't implement them.
For the rest of the properties, the if (0) test was added just to show that it crashes with a NULL value. Also, if the wrong type is passed, the function does not crash on Windows and the value remains unchanged, but it returns S_OK.
-- v3: windows.media: Partially implement IClosedCaptionPropertiesStatics_get_RegionOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_RegionColor. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_BackgroundOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_BackgroundColor. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontEffect. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontStyle. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontSize. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontColor. windows.media/tests: Add Closed Caption Properties tests.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- v2: - Remove error checks that crash on Windows. - Remove unreliable tests for computed colors. - Add comments clarifying expected behavior of computed functions. -- v3: - Replace comments with checks for ClosedCaptionColor_Default. --- dlls/windows.media/tests/captions.c | 97 +++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+)
diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index b1e1f4fd334..2aaab6aea1c 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -26,7 +26,10 @@ #include "roapi.h"
#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" +#define WIDL_using_Windows_UI +#include "windows.ui.h" #define WIDL_using_Windows_Media_ClosedCaptioning #include "windows.media.closedcaptioning.h"
@@ -55,6 +58,13 @@ static void test_CaptionStatics(void) HSTRING str; HRESULT hr; LONG ref; + /* Properties */ + ClosedCaptionColor color; + ClosedCaptionOpacity opacity; + ClosedCaptionSize size; + ClosedCaptionStyle style; + ClosedCaptionEdgeEffect effect; + Color computed_color;
hr = WindowsCreateString( caption_properties_name, wcslen( caption_properties_name ), &str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); @@ -75,6 +85,93 @@ static void test_CaptionStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IClosedCaptionPropertiesStatics, (void **)&caption_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
+ color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ); + if (color == ClosedCaptionColor_Default) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + } + else + { + todo_wine ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr ); + } + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + + size = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); + todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + + style = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); + todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + + effect = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); + todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ); + if (color == ClosedCaptionColor_Default) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + } + else + { + todo_wine ok( hr == S_OK, "get_ComputedBackgroundColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedBackgroundColor returned %#lx\n", hr ); + } + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ); + if (color == ClosedCaptionColor_Default) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + } + else + { + todo_wine ok( hr == S_OK, "get_ComputedRegionColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedRegionColor returned %#lx\n", hr ); + } + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 2e68948209e..41f14944ec0 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -128,8 +128,10 @@ DEFINE_IINSPECTABLE( captions, IClosedCaptionPropertiesStatics, struct captions_
static HRESULT WINAPI captions_get_FontColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 2aaab6aea1c..e98e13d3453 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -87,8 +87,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ); if (color == ClosedCaptionColor_Default)
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 41f14944ec0..43a421f0fa8 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -142,8 +142,10 @@ static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index e98e13d3453..483a45ed7db 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -106,8 +106,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity );
size = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 43a421f0fa8..f9bd9505ea5 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -150,8 +150,10 @@ static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionSize_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 483a45ed7db..e5d49a90ae2 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -111,8 +111,8 @@ static void test_CaptionStatics(void)
size = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); - todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); - todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size );
style = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index f9bd9505ea5..40f5fbb9800 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -158,8 +158,10 @@ static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *if
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionStyle_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index e5d49a90ae2..0b275e0a8cc 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -116,8 +116,8 @@ static void test_CaptionStatics(void)
style = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); - todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); - todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style );
effect = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 40f5fbb9800..d3954eb1b4f 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -166,8 +166,10 @@ static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *i
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionEdgeEffect_Default; + return S_OK; }
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 0b275e0a8cc..008ab37b7ef 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -121,8 +121,8 @@ static void test_CaptionStatics(void)
effect = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); - todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); - todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect );
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index d3954eb1b4f..b18c2dce820 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -174,8 +174,10 @@ static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 008ab37b7ef..aa85e55300e 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -126,8 +126,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ); if (color == ClosedCaptionColor_Default)
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index b18c2dce820..13a88da34ff 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -188,8 +188,10 @@ static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionProper
static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index aa85e55300e..1223824a994 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -145,8 +145,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity );
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 13a88da34ff..a3a27abc823 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -196,8 +196,10 @@ static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 1223824a994..0c34712b899 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -150,8 +150,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ); if (color == ClosedCaptionColor_Default)
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index a3a27abc823..b7e07710603 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -210,8 +210,10 @@ static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionProperties
static HRESULT WINAPI captions_get_RegionOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static const struct IClosedCaptionPropertiesStaticsVtbl captions_statics_vtbl = diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 0c34712b899..3844e646f19 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -169,8 +169,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity );
ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref );
On Fri Nov 25 04:55:13 2022 +0000, Mohamad Al-Jaf wrote:
I've added comments that clarify the expected behavior. Is this better? Also, I've removed the checks for the Color struct as they differ depending on the opacity and colors set. The function only succeeds when the relevant Color property is set to something other than Default; Opacity has no effect.
I suppose it's better to add a check for ClosedCaptionColor_Default rather than a comment. Seems like it clarifies it a bit more as the expected behavior.
Rémi Bernon (@rbernon) commented about dlls/windows.media/tests/captions.c:
hr = IActivationFactory_QueryInterface( factory, &IID_IClosedCaptionPropertiesStatics, (void **)&caption_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
- color = 0xdeadbeef;
- hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color );
- todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr );
- todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color );
- hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color );
- if (color == ClosedCaptionColor_Default)
I still don't really understand, you're checking right above that the color is the default, so it should never be different here. Simply add the todos for wine failure here too.