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_folders5.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $
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 : check the internal file dialog ( 1. part )
38 '\*****************************************************************************
42 '///<h1>Enter ".." until we are at filesystem root level, verify</h1>
43 '///+This test verifies that each ".." moves one level up in the filesystem.
44 '///+Furthermore it is verified that the Level-Up button does not get disabled under way.
47 dim iParentDir as integer
49 ' We always want to start in a fixed directory structure so the first few dirnames are
50 ' known an can be used for verification
51 dim cStartDir as string
52 cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
53 cStartDir = convertpath( cStartDir )
54 printlog( "Start-Directory is: " & cStartDir )
57 ' Find out how deep into the filesystem hierarchy we are so we know when we are at the
58 ' filesystem root. We add one because Windows has one more level where the drive icons
60 dim iDirLevels as integer
61 iDirLevels = hGetDirTreeLevel( cStartDir )
63 if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then
64 iDirLevels = iDirLevels + 1
65 printlog( "Current threshold (Windows) is: " & iDirLevels)
66 elseif ( gtSysName = "ecomstation" ) then
67 iDirLevels = iDirLevels + 1
68 printlog( "Current threshold (eComStation) is: " & iDirLevels)
70 printlog( "Current threshold (Unix/Linux) is: " & iDirLevels)
73 dim sCurrentDir as string
74 dim sExpectedDir as string
77 '///+<li>Click FileOpen</li>
80 '///+<li>Open [Testtoolpath]\framework\filedlg\input\filetest\level1\level2\level3</li>
82 Dateiname.SetText( cStartDir )
85 '///+<li>Enter ".." and press "Open" until we are at filesystem root</li>
87 printlog "Enter '..' until we are in the filesystem root"
88 for iParentDir = 1 to iDirLevels
90 '///+<li>Enter ".."</li>
91 Dateiname.setText( ".." )
93 '///+<li>Click "Open"</li>
96 '///+<li>Get the name of the first item in the filepicker (excluding CVS)</li>
97 sCurrentDir = hGetFirstNameFromFileList()
99 '///+<li>Verify that the name of the first item is correct. The names of the first six dirs are known</li>
100 select case iParentDir
101 case 1 : sExpectedDir = "level3"
102 case 2 : sExpectedDir = "level2"
103 case 3 : sExpectedDir = "level1"
104 case 4 : sExpectedDir = "alldocs"
105 case 5 : sExpectedDir = "includes"
106 case 6 : sExpectedDir = "optional"
109 if ( iParentDir < 7 ) then
110 if ( sCurrentDir = sExpectedDir ) then
111 printlog( "Current directory name is: " & sCurrentDir & " [ok]" )
113 warnlog( "Error finding directory name:" )
114 printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" )
115 printlog( "Expected directory name..: " & sExpectedDir )
121 '///+<li>We should now be at the top of the tree, the "Level-Up" button should be disabled</li>
124 '///+<li>Verify that the button exists</li>
125 if ( UebergeordneterOrdner.exists() ) then
127 '///+<li>Check that the button is not enabled</li>
128 if ( not UebergeordneterOrdner.isEnabled() ) then
129 printlog( "Level-Up button is disabled, good" )
131 '///+<li>Warn if the button is enabled</li>
132 warnlog( "The Level-up button should not be enabled for filesystem root" )
135 warnlog( "Level-Up button does not exist" )