mirror of
https://github.com/reactos/ahk_tests.git
synced 2025-03-02 17:45:31 +00:00
[AHK_Firefox12.0]
prepare.ahk: add EnterURL() function, so, we don't need duplicate code; address_bar.ahk: use EnterURL() function; Test succeeds in win2k3 SP1. svn path=/trunk/ahk_tests/; revision=1997
This commit is contained in:
parent
b365da483e
commit
6b3c82a315
@ -29,33 +29,23 @@ else
|
||||
TestsFailed("'Mozilla Firefox Start Page - Mozilla Firefox' is not active window.")
|
||||
else
|
||||
{
|
||||
SendInput, {ALTDOWN}d{ALTUP} ; Go to address bar
|
||||
; copy text to clipboard and compare
|
||||
clipboard = ; Empty the clipboard
|
||||
Send, ^c
|
||||
ClipWait, 2
|
||||
if ErrorLevel
|
||||
TestsFailed("The attempt to copy text onto the clipboard failed.")
|
||||
else
|
||||
TestsTotal++
|
||||
EnterURL("http://dsx86.patrickaalto.com")
|
||||
if bContinue
|
||||
{
|
||||
if clipboard <> about:home
|
||||
TestsFailed("Clipboard content is not the same as expected (is '" clipboard "', should be 'about:home') Can't focus address bar using Alt+D?.")
|
||||
; SendInput, http{:}//dsx86{.}patrickaalto{.}com{ENTER}
|
||||
WinWaitActive, DSx86 by Patrick Aalto - Mozilla Firefox,, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'DSx86 by Patrick Aalto - Mozilla Firefox' window failed to appear, so, typing URL failed (Alt+D).")
|
||||
else
|
||||
{
|
||||
SendInput, http{:}//dsx86{.}patrickaalto{.}com{ENTER}
|
||||
WinWaitActive, DSx86 by Patrick Aalto - Mozilla Firefox,, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'DSx86 by Patrick Aalto - Mozilla Firefox' window failed to appear, so, typing URL failed (Alt+D).")
|
||||
Sleep, 5500 ; Let it to load the page, maybe we will crash
|
||||
Process, Close, %ProcessExe%
|
||||
Process, WaitClose, %ProcessExe%, 5
|
||||
if ErrorLevel ; The PID still exists.
|
||||
TestsFailed("Unable to terminate '" ProcessExe "' process.")
|
||||
else
|
||||
{
|
||||
Sleep, 5500 ; Let it to load the page, maybe we will crash
|
||||
Process, Close, %ProcessExe%
|
||||
Process, WaitClose, %ProcessExe%, 5
|
||||
if ErrorLevel ; The PID still exists.
|
||||
TestsFailed("Unable to terminate '" ProcessExe "' process.")
|
||||
else
|
||||
TestsOK("'DSx86 by Patrick Aalto - Mozilla Firefox' window appeared, so typing URL works (Alt+D), '" ProcessExe "' process closed.")
|
||||
}
|
||||
TestsOK("'DSx86 by Patrick Aalto - Mozilla Firefox' window appeared, so typing URL works (Alt+D), '" ProcessExe "' process closed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,3 +122,49 @@ if bContinue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EnterURL(TheURL)
|
||||
{
|
||||
global TestName
|
||||
global bContinue
|
||||
global TestsTotal
|
||||
|
||||
IfWinNotActive, Mozilla Firefox Start Page - Mozilla Firefox
|
||||
TestsFailed("'Mozilla Firefox Start Page - Mozilla Firefox' is not active window.")
|
||||
else
|
||||
{
|
||||
SendInput, {ALTDOWN}d{ALTUP} ; Go to address bar
|
||||
; copy text to clipboard and compare
|
||||
clipboard = ; Empty the clipboard
|
||||
Send, ^c
|
||||
ClipWait, 2
|
||||
if ErrorLevel
|
||||
TestsFailed("The attempt to copy text onto the clipboard failed.")
|
||||
else
|
||||
{
|
||||
if clipboard <> about:home
|
||||
TestsFailed("Clipboard content is not the same as expected (is '" clipboard "', should be 'about:home') Can't focus address bar using Alt+D?.")
|
||||
else
|
||||
{
|
||||
SendInput, %TheURL%
|
||||
clipboard = ; Empty the clipboard
|
||||
Send, ^a ; Ctrl+A
|
||||
Send, ^c ; Ctrl+C
|
||||
ClipWait, 2
|
||||
if ErrorLevel
|
||||
TestsFailed("The attempt to copy text onto the clipboard failed when entering '" TheURL "'.")
|
||||
else
|
||||
{
|
||||
IfNotInString, TheURL, %clipboard%
|
||||
TestsFailed("Entered URL to addressbar, copied it and clipboard content is wwrong. Is '" clipboard "', should be '" TheURL "'.")
|
||||
else
|
||||
{
|
||||
SendInput, {ENTER} ; Go to URL
|
||||
TestsOK("Entered '" TheURL "' successfully and sent ENTER to go to it.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user