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 : check the internal file dialog ( 1. part )
32 '\*****************************************************************************
37 dim iCurrentItem as Integer ' increment variable
38 dim iCurrentItemCount as Integer ' actual number of entries in dropdown menu
41 ' The directory that we want to start in so we know how many steps we have
42 ' to the filesystem root (cStartDir is always good for at least 8 steps)
43 dim cStartDir as string
44 cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
45 cStartDir = convertpath( cStartDir )
47 ' This is the threshold of the directory defined above. Usually we will have
48 ' 9 as the expected number of directories but depending on the mountpoint
49 ' of the testtool workdirectory the number may vary.
50 dim iExpectedItemCount as Integer
51 iExpectedItemCount = hGetDirTreeLevel( cStartDir )
53 ' Windows has one more level (Drives)
54 if ( gPlatGroup = "w95" ) then
55 iExpectedItemCount = iExpectedItemCount + 1
58 printlog( "Test context menu of the Level Up button on the FileOpen dialog" )
59 printlog( "Current threshold: " & iExpectedItemCount )
64 Dateiname.SetText( cStartDir )
67 UebergeordneterOrdner.Open()
69 iCurrentItemCount = hMenuItemGetCount()
70 Printlog( "Current itemcount: " & iCurrentItemCount )
72 if ( iCurrentItemCount < iExpectedItemCount ) then
73 warnlog( "Items missing in the menu." )
74 printlog( "On Windows the node 'My Computer' might be missing" )
75 printlog( "On UNIX filesystem root might be missing" )
78 if ( iCurrentItemCount = iExpectedItemCount ) then
79 printlog( "The number of entries in the context menu is correct" )
82 if ( iCurrentItemCount > iExpectedItemCount ) then
83 warnlog( "Found more menu-items than expected: " & iCurrentItemCount)
86 for iCurrentItem = 1 to iCurrentItemCount - 1
88 iExpectedItemCount = iCurrentItemCount - iCurrentItem
93 UebergeordneterOrdner.Open()
95 if ( hMenuItemGetCount < iExpectedItemCount ) then
96 printlog( "The number of entries is correct" )
99 if ( hMenuItemGetCount > iExpectedItemCount ) then
100 printlog( "The number of entries is correct" )
107 if ( iCurrentItemCount = 8 ) then
110 UebergeordneterOrdner.Click()
115 if ( UebergeordneterOrdner.isEnabled() ) then
116 warnlog( "Level-Up is enabled, it should be disabled at filesystem root" )
119 printlog( "Good, button is disabled" )