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: g_009.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:03 $
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 : thorsten.bosbach@sun.com
36 '* short description : Global resource tests for the menu: Help
38 '*************************************************************************
40 ' #1 tHelpCheckForUpdates
42 '\************************************************************************
44 testcase tHelpCheckForUpdates
46 dim sIniFile as string
49 dim bOnceAgain as boolean
50 dim sProxyFile as string
51 dim iOldProxy as integer
56 '/// open application ///'
59 if gPlatGroup = "unx" then
60 sIniFile = convertPath(gNetzOfficePath+"program/versionrc")
62 sIniFile = convertPath(gNetzOfficePath+"program\version.ini")
64 sTemp = GetIniValue (sIniFile, "Version", "UpdateURL")
65 if (sTemp <> "" AND NOT gOOO) then
66 '/// choose Help -> Check for Updates... ///'
68 if bProxy AND bOnceAgain then
75 if (gtplatform = "sol") OR (gtplatform = "x86") or gOOO then
76 printlog "This could be a (patched) installation on Solaris Sparc/Intel or OOo - No Online Update Feature available."
79 warnlog "Help->Check for Updates failed"
84 ' The dialog has to come up: 'Check for Updates'
85 Kontext "CheckForUpdates"
86 ' if CheckForUpdates.exists(10) then ' id not in build for dialog workaround: ' not working due to i 80859
87 if Status.exists(10) then
89 printlog "'Check for Updates' came up"
91 warnlog "'Check for Updates' came up, but the feature is disabled and the dialog hasn't to come up"
94 'dialogTest(CheckForUpdates) ' not working due to i 80859
95 '/// A messagebox comes up with either CANCEL and/or OK -> press CANCEL or the only available button. ///'
96 ' And will be overlayed soon by an 'active'
98 if active.exists(6) then
99 printlog "Active text: '" + active.getText + "'"
102 printlog "Pressed CANCEL"
105 printlog "Pressed OK"
110 Kontext "CheckForUpdates"
112 CheckForUpdates.cancel
114 'cancel button is no more availabale
115 printlog "cancel wasnt possible"
117 'CheckForUpdates.close
118 ' close method doesn't work
119 printlog "1:"+status.gettext
120 printlog "2:"+description.gettext
123 printlog "close wasnt possible"
125 'printlog resetapplication
127 printlog "1:"+status.gettext
128 printlog "2:"+description.gettext
136 if (gtplatform = "sol") OR (gtplatform = "x86") or gOOO then
137 printlog "This could be a (patched) installation on Solaris Sparc/Intel or OOo - No Online Update Feature available."
139 warnlog "Dialog didn't came up: 'Check for Updates'; URL that was called is: '" + sTemp + "'"
142 warnlog "Online Update Feature isn't available in this build, but calling Help -> Check for Updates is possible? (no 'UpdateURL' in file: '"+sIniFile+"')"
145 ' Set proxy to get connection to update server
148 hToolsOptions("INTERNET","PROXY")
149 Kontext "TabProxyServer"
150 a = ProxyServer.getItemCount
152 printlog "(" + i + "/" + a + "): '" + ProxyServer.getItemText(i) + "'"
154 ProxyServer.select(a) ' should be always manual
155 if HttpProxy.isEnabled AND (privateProxyServer <> "") then
156 HttpProxy.setText privateProxyServer
157 HttpPort.setText cStr(privateProxyPort)
159 iOldProxy = ProxyServer.getSelIndex
161 ProxyServer.select(iOldProxy)
163 Kontext "OptionenDlg"
166 if privateProxyServer <> "" then
167 warnLog "Wrong assumption that last entry is 'manual'! " + ProxyServer.getItemText(a)
169 qaErrorLog "Maybe you need to use a proxy server to connect to the internet."
171 Kontext "OptionenDlg"
179 qaErrorlog "Test disabled, because it is OOo build and UpdateURL is empty and calling the slot would succeed"
181 '/// close application ///'