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 : Extension Update Test
32 '\******************************************************************************
34 testcase tExtensionManagerResources()
36 ' Test is based on issue #i86913 and the common rules for update tests (QA)
38 ' We need to know if the user may change extension parameters. This is the case
39 ' when a) the user is root/Administrator or b) the office was installed
40 ' for the current user only
42 dim bUserIsAdmin as boolean : bUserIsAdmin = hCheckForAdministratorPermissions()
43 dim iBreakCounter as integer : iBreakCounter = 0
44 dim iFilterItems as integer
46 const MAX_ITERATIONS = 50
47 const FILTER_ITEMS = 10 ' This is the number of filters/extension types we know
49 printlog( "Ressource test for the Extension Manager UI" )
52 kontext "PackageManager"
53 if ( PackageManager.exists( 1 ) ) then
55 ' OOo comes with a few preinstalled, shared - extensions. We need at least one.
56 ' This test is bound to fail if we have a user-installed extension at the
57 ' first position of the Extension Manager UI list. There is no way we can
58 ' check that for now. However, this is hardly ever the case.
60 if ( BrowsePackages.getItemCount() = 0 ) then
61 warnlog( "This test requires at least one extension to be installed." )
62 printlog( "Some of the controls are not available or disabled." )
66 call dialogtest( PackageManager )
68 kontext "PackgeManager"
73 if ( OeffnenDlg.exists( 1 ) ) then
74 iFilterItems = DateiTyp.getItemCount
75 if ( iFilterItems <> FILTER_ITEMS ) then
76 warnlog( "The file type filter list is incorrect" )
77 printlog( "Expected: " & FILTER_ITEMS )
78 printlog( "Found...: " & iFilterItems )
80 '1: Configuration Data
81 '2: Configuration Schema
84 '5: UNO Dynamic Library Component
85 '6: UNO Java Component
86 '7: UNO Java Type Library
87 '8: UNO Python Component
88 '9: UNO RDB Type Library
90 printlog( "The number of filters in Add Extensions Dialog is ok" )
94 warnlog( "File Open dialog did not open" )
97 kontext "PackageManager"
98 printlog( "Check for updates..." )
101 kontext "ExtensionUpdate"
102 if ( ExtensionUpdate.exists( 2 ) ) then
103 call dialogtest( ExtensionUpdate )
104 ExtensionUpdate.close()
105 ExtensionUpdate.notExists( 3 )
107 warnlog( "Extenson Update dialog did not open" )
110 kontext "PackageManager"
111 printlog( "Controls belonging to extensions" )
113 BrowsePackages.select( 1 )
114 printlog( "Extension name.......: " & BrowsePackages.getItemText( 1 , 1 ) )
115 printlog( "Extension version....: " & BrowsePackages.getItemText( 1 , 2 ) )
116 printlog( "Extension description: " & BrowsePackages.getItemText( 1 , 3 ) )
118 if ( options.exists() ) then
119 if ( options.isEnabled() ) then
120 printlog( "Extension has options" )
123 kontext "OptionenDlg"
127 warnlog( "Extension Options button visible but disabled" )
130 printlog( "Extension Options button does not exist, no options available" )
133 kontext "PackageManager"
134 BrowsePackages.select( 1 )
136 printlog( "Check visibility of some controls, many are hidden for bundled extensions" )
137 if ( disable.exists() ) then
138 if ( disable.isVisible() ) then
139 warnlog( "Button <Disable> should not be visible for shared extensions" )
141 printlog( "Button <Disable> is hidden" )
144 printlog( "The control <Disable> is not defined in this context" )
147 if ( remove.exists() ) then
148 if ( remove.isVisible() ) then
149 warnlog( "Button <Remove> should not be visible for shared extensions" )
151 printlog( "Button <Remove> is hidden" )
154 printlog( "The control <Remove> is not defined in this context" )
157 kontext "PackageManager"
158 PackageManager.close()
161 warnlog( "Extension Manager UI did not open" )