4 * Copyright 2019 Alistair Leslie-Hughes
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "uianimation.h"
27 #include "wine/test.h"
29 static void test_UIAnimationManager(void)
32 IUIAnimationManager
*manager
;
33 IUIAnimationVariable
*variable
;
34 IUIAnimationStoryboard
*storyboard
;
36 hr
= CoCreateInstance( &CLSID_UIAnimationManager
, NULL
, CLSCTX_ALL
, &IID_IUIAnimationManager
, (LPVOID
*)&manager
);
39 win_skip("UIAnimationManager not found\n");
43 hr
= IUIAnimationManager_CreateAnimationVariable(manager
, 1.0f
, &variable
);
44 ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
46 IUIAnimationVariable_Release(variable
);
48 hr
= IUIAnimationManager_CreateStoryboard(manager
, &storyboard
);
49 ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
51 IUIAnimationStoryboard_Release(storyboard
);
53 IUIAnimationManager_Release(manager
);
56 static void test_IUIAnimationTimer(void)
59 IUIAnimationTimer
*timer
;
61 hr
= CoCreateInstance( &CLSID_UIAnimationTimer
, NULL
, CLSCTX_ALL
, &IID_IUIAnimationTimer
, (void**)&timer
);
64 win_skip("IUIAnimationTimer not found\n");
68 hr
= IUIAnimationTimer_IsEnabled(timer
);
69 todo_wine
ok(hr
== S_FALSE
, "got 0x%08lx\n", hr
);
71 hr
= IUIAnimationTimer_Enable(timer
);
72 ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
74 hr
= IUIAnimationTimer_Enable(timer
);
75 todo_wine
ok(hr
== S_FALSE
, "got 0x%08lx\n", hr
);
77 hr
= IUIAnimationTimer_IsEnabled(timer
);
78 todo_wine
ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
80 hr
= IUIAnimationTimer_Disable(timer
);
81 todo_wine
ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
83 hr
= IUIAnimationTimer_Disable(timer
);
84 todo_wine
ok(hr
== S_FALSE
, "got 0x%08lx\n", hr
);
86 hr
= IUIAnimationTimer_IsEnabled(timer
);
87 todo_wine
ok(hr
== S_FALSE
, "got 0x%08lx\n", hr
);
89 IUIAnimationTimer_Release(timer
);
92 static void test_IUIAnimationTransitionFactory(void)
95 IUIAnimationTransitionFactory
*factory
;
96 IUIAnimationTransition
*transition
= NULL
;
98 hr
= CoCreateInstance( &CLSID_UIAnimationTransitionFactory
, NULL
, CLSCTX_ALL
,
99 &IID_IUIAnimationTransitionFactory
, (void**)&factory
);
102 win_skip("IUIAnimationTransitionFactory not found\n");
106 hr
= IUIAnimationTransitionFactory_CreateTransition(factory
, NULL
, &transition
);
107 todo_wine
ok(hr
== E_POINTER
, "got 0x%08lx\n", hr
);
109 IUIAnimationTransitionFactory_Release(factory
);
112 static void test_IUIAnimationTransitionLibrary(void)
115 IUIAnimationTransitionLibrary
*library
;
116 IUIAnimationTransition
*instantaneous
, *linear
, *smooth
;
118 hr
= CoCreateInstance( &CLSID_UIAnimationTransitionLibrary
, NULL
, CLSCTX_ALL
,
119 &IID_IUIAnimationTransitionLibrary
, (void**)&library
);
122 win_skip("IUIAnimationTransitionLibrary not found\n");
126 hr
= IUIAnimationTransitionLibrary_CreateInstantaneousTransition(library
, 100.0, &instantaneous
);
127 todo_wine
ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
129 IUIAnimationTransition_Release(instantaneous
);
131 hr
= IUIAnimationTransitionLibrary_CreateLinearTransition(library
, 500.0, 100.0, &linear
);
132 todo_wine
ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
134 IUIAnimationTransition_Release(linear
);
136 hr
= IUIAnimationTransitionLibrary_CreateSmoothStopTransition(library
, 500.0, 100.0, &smooth
);
137 todo_wine
ok(hr
== S_OK
, "got 0x%08lx\n", hr
);
139 IUIAnimationTransition_Release(smooth
);
141 IUIAnimationTransitionLibrary_Release(library
);
144 START_TEST(uianimation
)
148 hr
= CoInitialize(0);
149 ok(hr
== S_OK
, "failed to init com\n");
153 test_UIAnimationManager();
154 test_IUIAnimationTimer();
155 test_IUIAnimationTransitionFactory();
156 test_IUIAnimationTransitionLibrary();