'encoding UTF-8 Do not remove or change this line! '************************************************************************** ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ' ' Copyright 2000, 2010 Oracle and/or its affiliates. ' ' OpenOffice.org - a multi-platform office productivity suite ' ' This file is part of OpenOffice.org. ' ' OpenOffice.org is free software: you can redistribute it and/or modify ' it under the terms of the GNU Lesser General Public License version 3 ' only, as published by the Free Software Foundation. ' ' OpenOffice.org is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU Lesser General Public License version 3 for more details ' (a copy is included in the LICENSE file that accompanied this code). ' ' You should have received a copy of the GNU Lesser General Public License ' version 3 along with OpenOffice.org. If not, see ' ' for a copy of the LGPLv3 License. ' '/************************************************************************ '* '* owner : joerg.skottke@sun.com '* '* short description : Window/Titlebar functionality '* '\****************************************************************************** testcase tWindowFunctions printlog( "Update test for window functions" ) if ( gtSysName = "Mac OS X" ) then printlog( "No testing for Mac as some Window attributes do not exist" ) goto endsub endif printlog( "Create initial document" ) gApplication = "WRITER" hInitSingleDoc() hInitWriteDocIdentifier( "F_updt_windowfuncs.bas" ) printlog( "New document" ) hNewDocument() if ( getDocumentCount <> 2 ) then warnlog( "Two open documents were expected, found " & getDocumentCount ) endif kontext "DocumentWriter" printlog( "Close document" ) DocumentWriter.close() if ( getDocumentCount <> 1 ) then warnlog( "One open document was expected, found " & getDocumentCount ) endif printlog( "New document" ) hNewDocument() if ( getDocumentCount <> 2) then warnlog( "Two open documents were expected, found " & getDocumentCount ) endif printlog( "Enter some text into the second writer document" ) kontext "DocumentWriter" DocumentWriter.TypeKeys( "test" ) DocumentWriter.close() kontext "active" if ( Active.exists() ) then printlog( "Close messagebox with Cancel (leaves the document open)" ) Active.Cancel() else warnlog( "No warning that data will be lost on close of this document" ) endif kontext "DocumentWriter" if ( getDocumentCount = 2 ) then printlog( "Two documents open. Good." ) else warnlog( "Incorrect document count. Expected two, found " & getDocumentCount ) endif kontext "DocumentWriter" printlog( "Close the document" ) FileClose() kontext "Active" if ( Active.exists() ) then printlog( "Do not save the document" ) Active.No() else warnlog( "Warning: No data loss warning" ) endif kontext "DocumentWriter" if ( getDocumentCount = 1 ) then printlog( "One document open. Good." ) else warnlog( "Incorrect document count. Expected one, found " & getDocumentCount ) endif Kontext "DocumentWriter" printlog( "Minimize window" ) DocumentWriter.Minimize() Wait( 2000 ) kontext "DocumentWriter" if ( DocumentWriter.IsMin() ) then printlog( "Window is minimized" ) else qaerrorlog( "#i32672# Window not minimized" ) endif kontext "DocumentWriter" printlog( "Restore window" ) DocumentWriter.Restore() Wait( 2000 ) if ( DocumentWriter.IsRestore() ) then printlog( "Window is Restored" ) else warnlog( " * Window not Restored" ) endif kontext "DocumentWriter" printlog( "Maximize window" ) DocumentWriter.Maximize() Wait( 2000 ) kontext "DocumentWriter" if ( DocumentWriter.IsMax() ) then printlog( "Window is maximized" ) else warnlog( " * Window not maximized" ) endif hDestroyDocument() endcase '******************************************************************************* sub sAllWindowTitle printlog( "Window titles for the applications" ) printlog( "Writer" ) gApplication = "WRITER" call tCheckWindowTitle("swriter","Writer") printlog( "Master Document" ) gApplication = "MASTERDOCUMENT" call tCheckWindowTitle("sglobal","Writer") printlog( "HTML" ) gApplication = "HTML" call tCheckWindowTitle("sweb","Writer/Web") printlog( "Spreadsheet" ) gApplication = "CALC" call tCheckWindowTitle("scalc","Calc") printlog( "Presentation" ) gApplication = "IMPRESS" call tCheckWindowTitle("simpress","Impress") printlog( "Drawing" ) gApplication = "DRAW" call tCheckWindowTitle("sdraw","Draw") printlog( "Formula" ) gApplication = "MATH" call tCheckWindowTitle("smath","Math") qaerrorlog( "Excluded BASE and BACKINGWINDOW" ) 'gApplication = "DATABASE" 'call tCheckWindowTitle("DATABASE","Base") 'fileclose 'call tCheckWindowTitle("soffice","") end sub '******************************************************************************* testcase tCheckWindowTitle(sApplication as string, sReference as string) printlog( "Update test for the office window titles" ) 'Input: '
    '+
  1. Name of application (string), case sensitive. Valid options are:
  2. '
      '+
    1. "swriter"
    2. '+
    3. "sglobal"
    4. '+
    5. "sweb"
    6. '+
    7. "scalc"
    8. '+
    9. "simpress"
    10. '+
    11. "sdraw"
    12. '+
    13. "smath"
    14. '+
    15. "insight" * Currently disabled
    16. '+
    17. "soffice" * Currently disabled
    18. '
    '+
  3. Reference name (string), matches name of application
  4. '
      '+
    1. "Writer"
    2. '+
    3. "Writer/Web"
    4. '+
    5. "Calc"
    6. '+
    7. "Impress"
    8. '+
    9. "Draw"
    10. '+
    11. "Math"
    12. '+
    13. "Base" * Currently disabled
    14. '+
    15. "" * Currently disabled
    16. '
    '
'Returns: '
    '+
  1. Nothing
  2. '
'Description: '