1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_mediaplayer.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:40 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : wolfram.garten@sun.com
36 '* short description : g_mediaplayer.inc
38 '*********************************************************************
40 '\********************************************************************
42 testcase g_mediaplayer
47 dim timecounter, iWaitIndex, timefound as integer
49 if iSprache <> 39 then
50 Printlog "- MediaPlayer"
51 if gPlatgroup = "unx" then
52 QaErrorLog "Solaris / Linux: Soundcard + Java Media Framework (JMF) Media-Libraries is needed."
55 Datei$ = ConvertPath (convertPath (gTesttoolPath + "graphics\required\input\29secsound.wav"))
56 '/// Open New Document ///'
59 '/// Check if the Media Player already exists - if so - close it ///'
61 if mPlayer.exists then ' Close the MediaPlayer
62 warnlog "The MediaPlayer was visible since some earlier test. Plese notify FHA."
64 printlog "Closed the Media Player"
67 '/// Tools - MediaPlayer ///'
70 '/// Open file ///' 'a bigger / longer one
72 if mPlayer.exists then
73 printlog "The MediaPlayer was open."
75 warnlog "Tools - MediaPlayer didnt work. The MediaPlayer wasnt visible. Aborting test."
76 Call hCloseDocument '/// Close document ///'
84 '/// This test wont work correctly under Solaris and Linux, ///'
85 '/// unless some optional Media-libraries are installed. ///'
86 '/// Therefore we warn the tester about it if we cannot open the file. ///'
89 do while OeffnenDlg.Exists AND iWaitIndex < 10
91 iWaitIndex = iWaitIndex + 1
95 Warnlog "Error when opening file. Last dialogue said: " + Active.GetText
99 Call hCloseDocument '/// close document ///'
103 if Mplayer.exists then printlog "Media Player was opened."
106 timevalue1 = mTimeedit.GetText
111 printlog "Just pressed stop."
113 timevalue2 = mTimeedit.GetText
115 timevalue3 = mTimeedit.GetText
116 printlog "The time was: " + mTimeedit.GetText
117 if timevalue1 = timevalue2 AND timevalue2 = timevalue3 then
118 if gtSYSName <> "WinXP" then '("Solaris x86" OR "Linux" OR "Solaris") then
119 warnlog "The sound doesnt seem to be played at all. And since the test is run on a platform which needs extra libraries, the test ends now."
121 if Mplayer.Exists(3) then
124 Call hCloseDocument '/// close document ///'
127 warnlog "The sound doesnt seem to be played at all, but I will continue the test. The platform was: " + gtSYSName
130 if timevalue1 <> timevalue2 AND timevalue2 = timevalue3 then
131 Printlog "the stop-button seemed to work. Good."
133 warnlog "Very strange. The first value was: " + timevalue1 + ". Second: " + timevalue2 + ". Third: " + timevalue3
138 timevalue1 = mTimeedit.GetText
142 timevalue2 = mTimeedit.GetText
143 printlog "The time was: " + mTimeedit.GetText
144 if timevalue1 = timevalue2 then
145 warnlog "The play-button didnt seem to work" ' Because the time did not change.
147 Printlog "the play-button seemed to work. Good."
155 timevalue1 = mTimeedit.GetText
157 timevalue2 = mTimeedit.GetText
158 printlog "The time was: " + mTimeedit.GetText
159 if timevalue1 <> timevalue2 then
160 warnlog "The pause-button didnt seem to work"
162 Printlog "the pause-button seemed to work. Good."
166 mStop.Click 'to get to the beginning.
167 sleep 1 'And make sure it's really the beginning.
168 timevalue1 = mTimeedit.GetText
169 if timevalue1 <> "00:00:00 / 00:00:29" then
170 warnlog "Expected the time to go back to 00:00:00, but was " + timevalue1 + " instead."
171 mStop.Click 'to make another try to get to the beginning again.
173 printlog "Sound stopped, time-value set to 00:00:00."
176 printlog "We press 'Play'"
177 mPlay.Click 'to get it running
181 for timecounter = 1 to 50000
182 timevalue1 = mTimeedit.GetText
183 if timevalue1 = "00:00:20 / 00:00:29" then
187 if timevalue1 = "00:00:29 / 00:00:29" then
193 if timefound = 1 then
194 Printlog "the time-counter seemed to work. Good."
195 elseif timefound = 2 then
196 warnlog "Contact the test-administrator, this test needs to be rewritten."
197 elseif timefound = 0 then
198 warnlog "Either the time didnt change, or the test-computer is too fast."
202 'Plays the file repeatedly.
216 'Turns sound off and on.
218 '/// Time-slider ///'
219 ' mTimeslider. 'Click
221 'Moves to a different position in the file.
223 '/// Scroll-whatever ///'
226 'Adjusts the size of the movie playback.
232 '/// Close the MediaPlayer via Tools - MediaPlayer ///'
235 '/// Check if there is an object available. ///'
236 if (gApplication = "IMPRESS") then
237 kontext "DocumentImpress"
239 kontext "DocumentDraw"
241 hTypeKeys ("<escape><tab>")
245 Kontext "TabPositionAndSize"
247 Active.SetPage TabPositionAndSize
248 Kontext "TabPositionAndSize"
250 Printlog "Position and Size came up, object inserted correctly."
251 '/// Close dialog TabPositionAndSize with 'OK' ///'
252 TabPositionAndSize.OK
254 Warnlog "Position And Size didn't come up, was there no sound-object inserted?"
257 '/// close document ///'
258 Call hCloseDocument '/// close document ///'
260 qaerrorLog "#74350# - Different strings in g_mediaplayer under Italian."