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: filedlg_triggers.inc,v $
13 '* last change: $Author: jsk $ $Date: 2008-06-20 08:03:53 $
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 : joerg.skottke@sun.com
36 '* short description : Alternative ways to open file-dialogs / slot availablilty
38 '\******************************************************************************
40 testcase tDialogTriggers
42 '///<h1>Alternative ways to open file-dialogs / slot availablilty</h1>
44 '///<u><pre>Synopsis</pre></u>Test that some slots for the file-save, file-save-as
45 '///+ and file-open dialogs are not available in special situations, using accelerators.<br>
46 '///<u><pre>Specification document</pre></u>No specification provided<br>
47 '///<u><pre>Files used</pre></u>framework/tools/input/accelerators.txt<br>framework/tools/inc/t_accels.inc<br>
48 '///<u><pre>Test case specification</pre></u>
51 dim cAcceleratorFileOpen as string
52 dim cAcceleratorFileSave as string
53 dim cAcceleratorFileSaveAs as string
55 '///+<li>Make sure we are on the backing window</li>
56 do while ( getDocumentCount > 0 )
60 '///+<li>Get the accelerators from reference file for FileOpen, FileSave
61 '///+ and FileSaveAs</li>
62 cAcceleratorFileOpen = hGetAccel( "FileOpen" )
63 cAcceleratorFileSave = hGetAccel( "FileSave" )
64 cAcceleratorFileSaveAs = hGetAccel( "FileSaveAs" )
67 '///+<li>Actions on backing window</li>
69 '///+<li>Test case 1: FileOpen should be possible from backing window (accelerator)</li>
70 printlog( "Test case 1: FileOpen should be possible from backing window (accelerator)" )
72 kontext "DocumentBackground"
73 if ( DocumentBackground.exists( 1 ) ) then
75 DocumentBackground.typeKeys( cAcceleratorFileOpen )
78 if ( OeffnenDlg.exists( 1 ) ) then
79 printlog( "File Open dialog is open. Good." )
82 warnlog( "File Open dialog did not open." )
85 warnlog( "Backing window not found" )
90 '///+<li>Test case 2: File Save should not work from backing window (accelerator)</li>
91 printlog( "Test case 2: File Save should not work from backing window (accelerator)" )
93 kontext "DocumentBackground"
94 if ( DocumentBackground.exists( 1 ) ) then
96 DocumentBackground.typeKeys( cAcceleratorFileSave )
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" )
111 '///+<li>Test case 3: File Save As should not work from backing window (accelerator)</li>
112 printlog( "Test case 3: File Save As should not work from backing window (accelerator)" )
114 kontext "DocumentBackground"
115 if ( DocumentBackground.exists( 1 ) ) then
117 DocumentBackground.typeKeys( cAcceleratorFileSaveAs )
119 kontext "SpeichernDlg"
120 if ( SpeichernDlg.exists( 1 ) ) then
121 warnlog( "File Save dialog should not open." )
122 SpeichernDlg.cancel()
124 printlog( "File Open dialog is not open. Good." )
127 warnlog( "Backing window not found" )
131 '///+<li>Test case 4: FileOpen should be possible from backing window (slot)</li>
132 printlog( "Test case 4: FileOpen should be possible from backing window (slot)" )
134 kontext "DocumentBackground"
135 if ( DocumentBackground.exists( 1 ) ) then
140 if ( OeffnenDlg.exists( 1 ) ) then
141 printlog( "File Open dialog is open. Good." )
144 warnlog( "File Open dialog did not open." )
147 warnlog( "Backing window not found" )
152 '///+<li>Test case 5: File Save should not work from backing window (slot)</li>
153 printlog( "Test case 5: File Save should not work from backing window (slot)" )
155 kontext "DocumentBackground"
156 if ( DocumentBackground.exists( 1 ) ) then
161 kontext "SpeichernDlg"
162 if ( SpeichernDlg.exists( 1 ) ) then
163 warnlog( "File Save dialog should not open." )
164 SpeichernDlg.cancel()
166 printlog( "File Open dialog is not open. Good." )
169 printlog( "Slot blocked, good" )
173 warnlog( "Backing window not found" )
178 '///+<li>Test case 6: File Save As should not work from backing window (slot)</li>
179 printlog( "Test case 6: File Save As should not work from backing window (slot)" )
181 kontext "DocumentBackground"
182 if ( DocumentBackground.exists( 1 ) ) then
187 kontext "SpeichernDlg"
188 if ( SpeichernDlg.exists( 1 ) ) then
189 warnlog( "File Save dialog should not open." )
190 SpeichernDlg.cancel()
192 printlog( "File Open dialog is not open. Good." )
195 printlog( "Slot blocked, good" )
199 warnlog( "Backing window not found" )
206 '///+<li>Actions on unmodified documents (Writer)</li>
209 gApplication = "WRITER"
211 '///+<li>Open a new writer document</li>
214 '///+<li>Test case 7: File Save should not work from unmodified documents (accelerator)</li>
215 printlog( "Test case 7: File Save should not work from unmodified documents (accelerator)" )
217 kontext "DocumentWriter"
218 if ( DocumentWriter.exists( 1 ) ) then
220 DocumentWriter.typeKeys( cAcceleratorFileSave )
222 kontext "SpeichernDlg"
223 if ( SpeichernDlg.exists( 1 ) ) then
224 warnlog( "File Save dialog should not open." )
225 SpeichernDlg.cancel()
227 printlog( "File Open dialog is not open. Good." )
230 warnlog( "Writer document not not found" )
235 '///+<li>Test case 8: File Save As should work from unmodified documents (accelerator)</li>
236 printlog( "Test case 8: File Save As should work from unmodified documents (accelerator)" )
238 kontext "DocumentWriter"
239 if ( DocumentWriter.exists( 1 ) ) then
241 DocumentWriter.typeKeys( cAcceleratorFileSaveAs )
243 kontext "SpeichernDlg"
244 if ( SpeichernDlg.exists( 1 ) ) then
245 printlog( "File Save dialog is open. Good." )
246 SpeichernDlg.cancel()
248 warnlog( "File Open dialog is not open." )
251 warnlog( "Writer document not not found" )
255 '///+<li>Test case 9: File Save should not work from unmodified documents (slot)</li>
256 printlog( "Test case 9: File Save should not work from unmodified documents (slot)" )
258 kontext "DocumentWriter"
259 if ( DocumentWriter.exists( 1 ) ) then
264 kontext "SpeichernDlg"
265 if ( SpeichernDlg.exists( 1 ) ) then
266 warnlog( "File Save dialog should not open." )
267 SpeichernDlg.cancel()
269 printlog( "File Save dialog is not open. Good." )
272 printlog( "Slot blocked, good" )
275 warnlog( "Writer document not not found" )
280 '///+<li>Test case 10: File Save As should work from unmodified documents (slot)</li>
281 printlog( "Test case 10: File Save As should work from unmodified documents (slot)" )
283 kontext "DocumentWriter"
284 if ( DocumentWriter.exists( 1 ) ) then
289 kontext "SpeichernDlg"
290 if ( SpeichernDlg.exists( 1 ) ) then
291 printlog( "File Save dialog is open. Good." )
292 SpeichernDlg.cancel()
294 warnlog( "File Save dialog should open." )
297 warnlog( "Slot blocked" )
300 warnlog( "Writer document not not found" )
303 '///+<li>Close the document</li>
304 call hCloseDocument()