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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/******************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description : Alternative ways to open file-dialogs / slot availablilty
32 '\******************************************************************************
34 testcase tDialogTriggers
38 dim cAcceleratorFileOpen as string
39 dim cAcceleratorFileSave as string
40 dim cAcceleratorFileSaveAs as string
42 do while ( getDocumentCount > 0 )
46 cAcceleratorFileOpen = hGetAccel( "FileOpen" )
47 cAcceleratorFileSave = hGetAccel( "FileSave" )
48 cAcceleratorFileSaveAs = hGetAccel( "FileSaveAs" )
51 printlog( "Test case 1: FileOpen should be possible from backing window (accelerator)" )
53 kontext "DocumentBackground"
54 if ( DocumentBackground.exists( 1 ) ) then
56 DocumentBackground.typeKeys( cAcceleratorFileOpen )
59 if ( OeffnenDlg.exists( 1 ) ) then
60 printlog( "File Open dialog is open. Good." )
63 warnlog( "File Open dialog did not open." )
66 warnlog( "Backing window not found" )
71 printlog( "Test case 2: File Save should not work from backing window (accelerator)" )
73 kontext "DocumentBackground"
74 if ( DocumentBackground.exists( 1 ) ) then
76 DocumentBackground.typeKeys( cAcceleratorFileSave )
78 kontext "SpeichernDlg"
79 if ( SpeichernDlg.exists( 1 ) ) then
80 warnlog( "File Save dialog should not open." )
83 printlog( "File Open dialog is not open. Good." )
86 warnlog( "Backing window not found" )
91 printlog( "Test case 3: File Save As should not work from backing window (accelerator)" )
93 kontext "DocumentBackground"
94 if ( DocumentBackground.exists( 1 ) ) then
96 DocumentBackground.typeKeys( cAcceleratorFileSaveAs )
98 kontext "SpeichernDlg"
99 if ( SpeichernDlg.exists( 1 ) ) then
100 warnlog( "File Save dialog should not open." )
101 SpeichernDlg.cancel()
103 printlog( "File Open dialog is not open. Good." )
106 warnlog( "Backing window not found" )
110 printlog( "Test case 4: FileOpen should be possible from backing window (slot)" )
112 kontext "DocumentBackground"
113 if ( DocumentBackground.exists( 1 ) ) then
118 if ( OeffnenDlg.exists( 1 ) ) then
119 printlog( "File Open dialog is open. Good." )
122 warnlog( "File Open dialog did not open." )
125 warnlog( "Backing window not found" )
130 printlog( "Test case 5: File Save should not work from backing window (slot)" )
132 kontext "DocumentBackground"
133 if ( DocumentBackground.exists( 1 ) ) then
138 kontext "SpeichernDlg"
139 if ( SpeichernDlg.exists( 1 ) ) then
140 warnlog( "File Save dialog should not open." )
141 SpeichernDlg.cancel()
143 printlog( "File Open dialog is not open. Good." )
146 printlog( "Slot blocked, good" )
150 warnlog( "Backing window not found" )
155 printlog( "Test case 6: File Save As should not work from backing window (slot)" )
157 kontext "DocumentBackground"
158 if ( DocumentBackground.exists( 1 ) ) then
163 kontext "SpeichernDlg"
164 if ( SpeichernDlg.exists( 1 ) ) then
165 warnlog( "File Save dialog should not open." )
166 SpeichernDlg.cancel()
168 printlog( "File Open dialog is not open. Good." )
171 printlog( "Slot blocked, good" )
175 warnlog( "Backing window not found" )
182 gApplication = "WRITER"
186 printlog( "Test case 7: File Save should not work from unmodified documents (accelerator)" )
188 kontext "DocumentWriter"
189 if ( DocumentWriter.exists( 1 ) ) then
191 DocumentWriter.typeKeys( cAcceleratorFileSave )
193 kontext "SpeichernDlg"
194 if ( SpeichernDlg.exists( 1 ) ) then
195 warnlog( "File Save dialog should not open." )
196 SpeichernDlg.cancel()
198 printlog( "File Open dialog is not open. Good." )
201 warnlog( "Writer document not not found" )
206 printlog( "Test case 8: File Save As should work from unmodified documents (accelerator)" )
208 kontext "DocumentWriter"
209 if ( DocumentWriter.exists( 1 ) ) then
211 DocumentWriter.typeKeys( cAcceleratorFileSaveAs )
213 kontext "SpeichernDlg"
214 if ( SpeichernDlg.exists( 1 ) ) then
215 printlog( "File Save dialog is open. Good." )
216 SpeichernDlg.cancel()
218 warnlog( "File Open dialog is not open." )
221 warnlog( "Writer document not not found" )
225 printlog( "Test case 9: File Save should not work from unmodified documents (slot)" )
227 kontext "DocumentWriter"
228 if ( DocumentWriter.exists( 1 ) ) then
233 kontext "SpeichernDlg"
234 if ( SpeichernDlg.exists( 1 ) ) then
235 warnlog( "File Save dialog should not open." )
236 SpeichernDlg.cancel()
238 printlog( "File Save dialog is not open. Good." )
241 printlog( "Slot blocked, good" )
244 warnlog( "Writer document not not found" )
249 printlog( "Test case 10: File Save As should work from unmodified documents (slot)" )
251 kontext "DocumentWriter"
252 if ( DocumentWriter.exists( 1 ) ) then
257 kontext "SpeichernDlg"
258 if ( SpeichernDlg.exists( 1 ) ) then
259 printlog( "File Save dialog is open. Good." )
260 SpeichernDlg.cancel()
262 warnlog( "File Save dialog should open." )
265 warnlog( "Slot blocked" )
268 warnlog( "Writer document not not found" )
271 call hCloseDocument()