1 \0\x05\x16\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\0\0\x01\0\0\0>
\0\0;Å
\0\0\0\x02\0\0<
\x03\0\0\x04[
\0\0\0 \0\0@^
\0\0\0 [ ] use "apFrame.inc"
\r[ ]
\r[ ] //GLOBAL VARIABLES
\r[ ] ARRAY[8] OF ANYTYPE aaData
\r[ ] STRING sTestArea
\r[ ] STRING sTestCoverage
\r[ ] STRING sTestName
\r[ ] STRING sTestFile // file to open for tests
\r[ ] STRING sTestCaption // caption of sTestFile
\r[ ] STRING sReport // name of the report file
\r[ ] STRING MOZILLA_HOME = ReadMozillaHome() // home directory of seamonkey executable (Apprunner)
\r[ ] HFILE hReport,hData
\r[ ]
\r[+] Debug()
\r [ ]
\r[+] DebugStr(STRING s)
\r [-] if (bDebug == true)
\r [ ] Print(s)
\r[+] // INT OpenEditor()
\r [ ] // Apprunner.Invoke()
\r [ ] // Apprunner.Tasks.Editor.Pick()
\r [ ] // return 1
\r[+] // INT DoStyleTest()
\r [ ] // BOOLEAN bCompare
\r [ ] // INT iOrigCRC,iNewOrigCRC,iAlteredCRC,iNewAlteredCRC
\r [ ] // STRING sBaseline = "{MOZILLA_HOME}:tools:tests:mac:Enderb.bmp"
\r [ ] // STRING sNewBaseline = "{MOZILLA_HOME}:tools:tests:mac:Endernew.bmp"
\r [ ] // STRING sAltered = "{MOZILLA_HOME}:tools:tests:mac:Ender2.bmp"
\r [ ] // STRING sNewAltered = "{MOZILLA_HOME}:tools:tests:mac:Ender2new.bmp"
\r [ ] // STRING sMask = "{MOZILLA_HOME}:tools:tests:mac:Enderb.mask"
\r [ ] // RECT rTest = {72,175,70,70}
\r [ ] // iOrigCRC = SYS_GetBitmapCRC(sBaseline,sMask)
\r [ ] // iAlteredCRC = SYS_GetBitmapCRC(sAltered,sMask)
\r [ ] // OpenEditor()
\r [ ] // Apprunner.Tasks.Editor.Pick()
\r [ ] // Agent.SetOption(OPT_BITMAP_MATCH_COUNT, 1)
\r [ ] // Agent.SetOption(OPT_BITMAP_MATCH_INTERVAL, .1)
\r [ ] // //EnderHTMLTestPage.CaptureBitmap(sBaseline,rTest)
\r [ ] // sleep(10)
\r [ ] // EnderHTMLTestPage.Size(560,518)
\r [ ] // EnderHTMLTestPage.VerifyBitmap(sBaseline,rTest)
\r [ ] // Agent.SetOption (OPT_MOUSE_DELAY, 1)
\r [ ] // Mozilla.PressMouse (1, 10, 157)
\r [ ] // Mozilla.ReleaseMouse (1, 303, 220)
\r [ ] // EnderHTMLTestPage.Bold.Click ()
\r [ ] // EnderHTMLTestPage.Italic.Click ()
\r [ ] // EnderHTMLTestPage.Underline.Click ()
\r [ ] // Agent.SetOption (OPT_MOUSE_DELAY, 0)
\r [ ] // EnderHTMLTestPage.Click(1,10,157)
\r [ ] // sleep(10)
\r [ ] // //EnderHTMLTestPage.CaptureBitmap(sAltered,rTest)
\r [ ] // EnderHTMLTestPage.VerifyBitmap(sAltered,rTest)
\r [ ] // EnderHTMLTestPage.Close()
\r [ ] // return (1)
\r[+] // INT InsertText()
\r [ ] // LIST OF STRING ls
\r [ ] // Agent.SetOption (OPT_MOUSE_DELAY, 1)
\r [ ] // Apprunner.Tasks.Editor.Pick()
\r [ ] // sleep(20)
\r [ ] // EnderHTMLTestPage.Size(560,518)
\r [ ] // Apprunner.Debug.InsertText.Pick()
\r [ ] // EnderHTMLTestPage.Click (1, 65, 42)
\r [ ] // EnderHTMLTestPage.PressMouse (1, 13, 42)
\r [ ] // EnderHTMLTestPage.ReleaseMouse (1, 259, 41)
\r [ ] // Apprunner.Edit.Copy.Pick ()
\r [ ] // ls = Clipboard.GetText()
\r [ ] // Verify(ls[1],"Once more into the breach, dear friends.")
\r [ ] // EnderHTMLTestPage.Close()
\r [ ] // Agent.SetOption (OPT_MOUSE_DELAY, 0)
\r [ ] // return (1)
\r[+] INT DoBasicTest()
\r [-] switch (aaData[4])
\r [-] case "ClickOnBackForward"
\r [ ] return DoBackClick()
\r [-] case "OpenNewBrowserWin"
\r [ ] return OpenNewWin()
\r [-] case "OpenFile"
\r [ ] sTestFile = aaData[1]
\r [ ] sTestCaption = aaData[6]
\r [ ] return OpenFile(sTestFile,sTestCaption)
\r [+] // case "InsertText"
\r [ ] // return InsertText()
\r [+] // case "StyleText"
\r [ ] // return DoStyleTest()
\r [-] default
\r [ ] return 0
\r[+] INT DoWinScroll()
\r [ ] // DoWinScroll
\r [ ] // Opens a window and takes a bitmap of a rectangle within the window, then clicks in the scrollbar. Compares
\r [ ] // new bitmap of the same rectangle and verifies that it is different. Then clicks in the scrollbar
\r [ ] // high enough to set the scroll bar to its original (y = 0) position. Verifies that the bitmaps are
\r [ ] // once again identical.
\r [ ]
\r [ ] //Local Variable declarations
\r [ ] INT iCRC // checksum for bitmap region
\r [ ] INT iRes // numerical result for return value
\r [ ] BOOLEAN bMatch
\r [ ] STRING sRes // Result of test returned as a string
\r [ ] STRING sPrintStr // string to print to report file
\r [ ] STRING sNewWindow // window that actually loads
\r [ ] STRING sBitmap // File to store bitmap
\r [ ] RECT rTextRect //a section of text in the window to be scrolled
\r [ ] RECT rWinRect // rectangle for Mozilla startup window
\r [ ]
\r [ ] //Variable assignment--aaData is a global array that has been read from data file
\r [ ] sBitmap = "winscroll.bmp"
\r [ ] sURL = aaData[1]
\r [ ] rWinRect = Mozilla.GetRect()
\r [ ] rTextRect = aaData[5]
\r [ ] AppRunnerBMP(sBitmap,rTextRect)
\r [ ] iBaselineCRC = SYS_GetBitmapCRC(sBitmap)
\r [ ] iCRC = 0
\r [ ] bMatch = false
\r [ ] WaitWindowCaption(sWindowName)
\r [ ] iCRC = Mozilla.GetBitmapCRC(rTextRect)
\r [ ] Verify(iCRC,iBaselineCRC,"bitmap matches baseline")
\r [ ] Mozilla.Click (1, rWinRect.xSize-22, 300) //click low in scrollbar
\r [-] if(iBaselineCRC == Mozilla.GetBitmapCRC(rTextRect))
\r [ ] bMatch = true
\r [-] if (bMatch)
\r [ ] iRes = -1
\r [ ] return iRes
\r [ ] Mozilla.Click (1, rWinRect.xSize-22, 100) //click high
\r [ ] sleep(10)
\r [-] if (Mozilla.GetBitmapCRC(rTextRect) == iBaselineCRC)
\r [ ] iRes = 1
\r [-] else
\r [ ] iRes = -1
\r [ ] return iRes
\r[+] INT DoBackClick()
\r [ ] STRING sWin1,sWin2
\r [ ] Mozilla.SetActive()
\r [ ] Mozilla.MyNetscape.Click()
\r [ ] sWin1 = Mozilla.GetCaption()
\r [ ] Mozilla.Back.Click()
\r [ ] sWin2 = Mozilla.GetCaption()
\r [-] if (sWin1 == sWin2)
\r [ ] return E_BACK_BUTTON_FAILS
\r [ ] Mozilla.Forward.Click()
\r [-] if (sWin1 != Mozilla.GetCaption())
\r [ ] return E_FORWARD_BUTTON_FAILS
\r [ ] return 1
\r[+] INT OpenNewWin()
\r [ ] Mozilla.SetActive()
\r [ ] Apprunner.File.NewBrowserWindow.Pick()
\r [ ] sleep(30)
\r [-] if (Apprunner.ChildWin("#2").Exists())
\r [-] do
\r [ ] Verify(Apprunner.ChildWin("#1").GetCaption(),sWindowName)
\r [ ] Apprunner.ChildWin("#1").Close()
\r [ ] return 1
\r [-] except
\r [ ] Print(ExceptData())
\r [ ] return E_WIN_NOT_FOUND
\r [-] else
\r [ ] Print(ExceptData())
\r [ ] return E_WIN_NOT_OPEN
\r[+] INT OpenFile(STRING s, STRING sName optional)
\r [ ] LIST OF STRING ls
\r [ ] INT iTimes = 0
\r [ ] Apprunner.File.OpenFile.Pick()
\r [ ] sleep(5)
\r [ ] OpenLocation.SelectFile.Click()
\r [ ] sleep(5)
\r [ ] ls = String2List(s)
\r [ ] OpenFileDialog.OpenFile(ls)
\r [-] if (sName != NULL)
\r [-] while (Apprunner.ChildWin("#1").GetCaption() != sName)
\r [ ] sleep(1)
\r [ ] iTimes++
\r [-] if (iTimes > 30)
\r [ ] raise E_WIN_NOT_FOUND, "Window does not have expected caption"
\r [ ] Apprunner.ChildWin("#1").Close()
\r [-] if (OpenLocation.Exists())
\r [ ] OpenLocation.SetActive()
\r [ ] OpenLocation.Close()
\r [ ] return 1
\r[+] SetSeamonkeyOptions()
\r [ ] // QAP options necessary for running these tests
\r [ ] Agent.SetOption(OPT_VERIFY_EXPOSED, false)
\r [ ] Agent.SetOption(OPT_VERIFY_UNIQUE, false)
\r [ ] Agent.SetOption(OPT_VERIFY_ENABLED, false)
\r [ ] Agent.SetOption(OPT_WINDOW_TIMEOUT, 60) // maximum time QAP will wait for a window
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_COUNT, 1)
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_INTERVAL, .1)
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_TIMEOUT, 60) // maximum time QAP will wait for a bitmap to match
\r[+] WaitWindowCaption(STRING s,INT iWait optional)
\r [ ] INT i = 0
\r [-] if (iWait==NULL)
\r [ ] iWait = 60
\r [-] while (StrPos(Mozilla.GetCaption(), s) == 0)
\r [ ] sleep (1)
\r [ ] i++
\r [-] if ( i > iWait)
\r [ ] raise 1, "Expected window did not load: test {sTestName} FAILS"
\r[+] STRING GetBuildNum()
\r [ ] HFILE hXUL
\r [ ] STRING sLine,sBuildID
\r [-] if (bDebug == true)
\r [ ] hXUL = FileOpen("MacHDD:mozilla:dist:viewer:Chrome:Navigator:locale:en-US:navigator.dtd",FM_READ)
\r [-] while (FileReadLine(hXUL,sLine))
\r [ ] INT iPos = StrPos(sLine,"Build ID:")
\r [-] if (iPos > 0)
\r [ ] sBuildID = SubStr(sLine,12,10)
\r [ ] DebugStr(sBuildID)
\r [-] else
\r [ ] hXUL = FileOpen("BigFatBoy:Mozilla Tree:mozilla:config:build_number",FM_READ)
\r [ ] FileReadLine(hXUL,sLine)
\r [ ] sBuildID = sLine
\r [ ] return (sBuildID)
\r[+] AppRunnerBMP(STRING sBMP, RECT rVerify)
\r [ ] // captures a bitmap
\r [ ] // this should be repeated before each run
\r [ ] sleep(2)
\r [ ] Mozilla.CaptureBitmap(sBMP,rVerify)
\r[+] INT DoMailTest(ARRAY OF STRING aaArray)
\r [ ] DebugStr("Do Mail Test")
\r [ ] return(1)
\r[+] INT DoEditTest(ARRAY OF STRING aaArray)
\r [ ] DebugStr("Do Edit Test")
\r [ ] return(1)
\r[-] INT DoBrowserTest(ARRAY[6] OF ANYTYPE aaArray)
\r [ ] //Local Variable declarations
\r [ ] INT iCRC // checksum for bitmap region
\r [ ] INT iTimes // loop variable for checksum verification
\r [ ] INT iExcept // exception number returned by QA Partner
\r [ ] INT iRes // numerical result for return value
\r [ ] INT iFound // tests whether search string is found in window caption
\r [ ] BOOLEAN bDone // Flag for completion of checksum verification
\r [ ] BOOLEAN bTimedOut // If bitmap doesn't match, also gives information about time
\r [ ] STRING sRes // Result of test returned as a string
\r [ ] STRING sPrintStr // string to print to report file
\r [ ] STRING sNewWindow // window that actually loads
\r [ ] HTIMER hTimer // timer handle
\r [ ] NUMBER nSeconds // seconds elapsed since beginning of checksum verification
\r [ ] RECT rRect // rectangle of bitmap for verification--must include part of throbber
\r [ ]
\r [ ] //Variable assignment--aaArray has been read from data file
\r [ ] sURL = aaArray[1] // URL to Load
\r [ ] sTestArea = aaArray[2]
\r [ ] sTestCoverage = aaArray[3]
\r [ ] sTestName = aaArray[4]
\r [ ] rRect = rThrobber
\r [ ] sWindowName = aaArray[6]
\r [-] if (sTestArea == "stop")
\r [ ] FileWriteLine(hReport,"{sTestName} TEST NOT RUN: {sTestCoverage}")
\r [ ] return -1
\r [ ] Apprunner.Invoke()
\r [-] do
\r [ ] iCRC = 0
\r [ ] iTimes = 0
\r [ ] nSeconds = 0
\r [ ] bTimedOut = false
\r [ ] bDone = false
\r [ ] hTimer = TimerCreate()
\r [ ] Mozilla.SetAddress(sURL)
\r [ ] Mozilla.TypeKeys("<enter>")
\r [ ] TimerStart(hTimer)
\r [-] while (bDone == false)
\r [-] do
\r [ ] iCRC = Mozilla.GetBitmapCRC(rThrobber)
\r [-] except
\r [-] if (ExceptNum()==E_BITMAP_REGION_INVALID)
\r [ ] Mozilla.Close()
\r [-] if (iCRC != iBaselineCRC)
\r [ ] nSeconds = TimerValue(hTimer)
\r [ ] iTimes = 0
\r [-] if (nSeconds > iBitmapWait)
\r [ ] bDone = true
\r [-] else
\r [-] switch (iTimes)
\r [-] case 0
\r [ ] nSeconds = TimerValue(hTimer)
\r [ ] iTimes++
\r [-] case 1,2,3
\r [ ] iTimes++
\r [-] case 4
\r [ ] bDone = true
\r [-] if(nSeconds > iBitmapWait)
\r [ ] bDone = true
\r [ ] DebugStr("***Error: Time Ran Out -{iBitmapWait}")
\r [ ] sNewWindow = Mozilla.GetCaption()
\r [-] if (StrPos(sWindowName,sNewWindow) == 0)
\r [ ] DebugStr("Expected: {sWindowName} Found {sNewWindow}")
\r [ ] DebugStr("***May be due to changes on site")
\r [-] do
\r [ ] Verify(bTimedOut,false,"time less than {iBitmapWait} seconds")
\r [-] except
\r [ ] DebugStr("{sTestName} FAILED-E1")
\r [ ] reraise
\r [-] do
\r [ ] Verify(iCRC,iBaselineCRC,"bitmap matches baseline")
\r [-] except
\r [ ] DebugStr("{sTestName} FAILED-E1")
\r [ ] reraise
\r [ ] iRes = 1
\r [ ] TimerDestroy(hTimer)
\r [-] except
\r [ ] iExcept = ExceptNum()
\r [-] switch (iExcept)
\r [-] case E_VERIFY // iCRC does not equal iBaselineCRC
\r [ ] iRes = -1
\r [ ] sRes = "FAIL-E1"
\r [-] case E_WINDOW_NOT_FOUND // Window not found--often because App has crashed
\r [ ] iRes = -2
\r [ ] sRes = "FAIL-E2"
\r [-] case E_BITMAPS_DIFFERENT // same as E1
\r [ ] iRes = -3
\r [ ] sRes = "FAIL-E3"
\r [-] case E_BITMAP_NOT_STABLE // mainly with waitBitmap--possibly hung
\r [ ] iRes = -4
\r [ ] sRes = "FAIL-E4"
\r [-] case E_BITMAP_REGION_INVALID // bitmap region is not inside window boundaries
\r [ ] iRes = -5
\r [ ] sRes = "FAIL-E5"
\r [-] default
\r [ ] sRes = "FAIL-UNKNOWN FAILURE"
\r [ ] iRes = -999
\r [+] // if (ApprunnerError.Exists()) // uncomment line for windows
\r [ ] // ApprunnerError.Close.Click()
\r [ ] FileWriteLine(hReport,"{sTestName} {sRes}")
\r [ ] DebugStr("{sTestName} {sRes}")
\r [ ] TimerDestroy(hTimer)
\r [ ] return iRes
\r[-] SmokeTest()
\r [ ] //Local Variable declarations
\r [ ] STRING sTimeStamp
\r [ ] STRING printStr
\r [ ] STRING sTestType
\r [ ] INTEGER i,iLoop,iExcept,iPass,iFail,iRan,iRes
\r [ ] HTIMER hTimer,hStarter
\r [ ] INTEGER iFound
\r [ ] BOOLEAN bPass
\r [ ] Print("Beginning smoke tests at {TimeStr()}")
\r [ ] sData = "all_smoke.txt"
\r [ ] Print("Using data file {sData}")
\r [ ] sTimeStamp = StrTran(TimeStr(),":","")
\r [ ] sReport = "SmokeReport{sTimeStamp}.txt"
\r [ ] Print("Using log file {sReport}")
\r [ ] Print(GetBuildNum())
\r [ ] hReport = FileOpen(sReport, FM_WRITE)
\r [ ] sBitmapFile = "throb.bmp"
\r [ ] sTestCaption = "Preferences"
\r [ ] hData = FileOpen(sData,FM_READ)
\r [ ] FileWriteLine(hReport, "Beginning smoke tests at {TimeStr()}")
\r [ ] FileWriteLine(hReport, "apprunner located at {MOZILLA_HOME}")
\r [ ] FileWriteLine(hReport, "Using data file {sData}")
\r [ ] FileWriteLine(hReport, GetBuildNum())
\r [ ] Agent.SetOption(OPT_VERIFY_EXPOSED, false)
\r [ ] Agent.SetOption(OPT_VERIFY_UNIQUE, false)
\r [ ] Agent.SetOption(OPT_VERIFY_ENABLED, false)
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_COUNT, 1)
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_INTERVAL, .1)
\r [ ] Agent.SetOption(OPT_BITMAP_MATCH_TIMEOUT, iBitmapWait)
\r [ ] Apprunner.Invoke()
\r [ ] sleep(20)
\r [ ] AppRunnerBMP(sBitmapFile,rThrobber)
\r [ ] iBaselineCRC = SYS_GetBitmapCRC(sBitmapFile)
\r [-] while (FileReadValue(hData,aaData))
\r [ ] sURL = aaData[1]
\r [ ] sTestArea = aaData[2]
\r [ ] sTestType = aaData[3]
\r [ ] sTestName = aaData[4]
\r [ ] sWindowName = aaData[6]
\r [-] switch sTestArea
\r [-] // case "Mail"
\r [ ] // DoMailTest(aaData)
\r [-] // case "Editor"
\r [ ] // DoEditTest(aaData)
\r [-] case "Startup" // This test must pass or the others will not be run
\r [-] do
\r [ ] Apprunner.Invoke()
\r [-] except
\r [ ] reraise
\r [-] do
\r [ ] iRes = StrPos("Mozilla",Mozilla.GetCaption())
\r [-] except
\r [ ] reraise
\r [-] if (iRes == 0)
\r [ ] iRes = -1
\r [-] case "Exit"
\r [-] do
\r [ ] Apprunner.Invoke()
\r [-] except
\r [ ] DebugStr("{sTestName} FAIL {ExceptData()}")
\r [ ] reraise
\r [-] do
\r [ ] Mozilla.Close()
\r [ ] iRes = 1
\r [-] except
\r [ ] iRes = -1
\r [-] case "Top Site", "Frames", "Tables","Java","JavaScript Applets","PNG Images","JPEG Images","Transparencies","Java Applets","Multilingual UTF-8","Multilingual NCR"
\r [-] do
\r [ ] Apprunner.Invoke()
\r [ ] iRes = DoBrowserTest(aaData)
\r [-] except
\r [ ] FileWriteLine(hReport,"{sTestName} FAILED")
\r [ ] DebugStr("{sTestName} FAILED")
\r [-] case "Basic Functional Test"
\r [-] do
\r [-] if (sTestType == "Browser")
\r [ ] Apprunner.Invoke()
\r [ ] Mozilla.SetAddress(sURL)
\r [ ] Mozilla.TypeKeys("<enter>")
\r [ ] iRes = DoBasicTest()
\r [-] except
\r [ ] Print(ExceptData())
\r [-] if (sTestType == "Ender")
\r [ ] EnderHTMLTestPage.Close()
\r [ ] iRes = -1
\r [-] case "WindowScrolling"
\r [-] do
\r [ ] Apprunner.Invoke()
\r [ ] Mozilla.SetAddress(sURL)
\r [ ] Mozilla.TypeKeys("<enter>")
\r [ ] sleep(10)
\r [ ] iRes = DoWinScroll()
\r [-] except
\r [ ] Print(ExceptData())
\r [ ] iRes = -1
\r [-] default
\r [ ] iRes = 0
\r [+] if (iRes > 0)
\r [ ] FileWriteLine (hReport, "{sTestName} PASSED")
\r [ ] DebugStr("{sTestName} PASS")
\r [-] else if (iRes < 0)
\r [ ] FileWriteLine (hReport, "{sTestName} FAILED")
\r [ ] DebugStr("{sTestName} FAIL")
\r [+] else if (iRes == 0)
\r [ ] FileWriteLine(hReport,"{sTestName} NOT RUN")
\r [ ] DebugStr("{sTestName} NOT RUN")
\r [-] do
\r [ ] Mozilla.Close()
\r [-] except
\r [-] if (sTestArea == "Exit")
\r [ ]
\r [-] else
\r [ ] Apprunner.Invoke()
\r [ ] FileWriteLine(hReport,"Smoke test complete at {TimeStr()}")
\r [ ] Print("Smoke test complete at {TimeStr()}")
\r[-] main()
\r [ ] SmokeTest()
\r\0\0\x01\0\0\0\x03Ú
\0\0\x02Ú
\0\0\0�ÿ
\0™2"}i—
\x0fD“ë·d¨yZER¿
\x03±*xš¨eËxC]”MÞ©5Ê*
\x05ô¿©PÌO ((ÎÍÅWùW"#I2µ
\aºº�–y�‰^
\x04–;©ýŸõrT
\x11e¡st‘
\x18VW
\x10ž¨
\x18ñßÛ
\x1a\vhrF
\x15T´µ{¹ÄJ
\r:±
\x02´
\x19\x19J‚c
\e,£O°´Ž bâà
\x12¼”ƒñ)(â¾*Ëų
\x18›ryl‰–Ö
\x06B…
\x01V
\x04\x15 \x10Aê
\bý¬T
\x16\x19{¥,
\x0em
\x04eU
\x15Þ
\x19K†,9Uþ
\x17f›�9~
\x1fï~
\a‹Ô›Ö“ÓÃŽF&™æˆ˜âI
\b*H=GQ™®¼¸