mirror of
https://github.com/dart-lang/sdk
synced 2024-09-21 23:11:18 +00:00
92bd7fb891
BUG=dartbug.com/20731 R=ahe@google.com Review URL: https://codereview.chromium.org//542623003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39930 260f80e4-7a28-3924-810f-c04153c831b5
98 lines
2.1 KiB
AppleScript
98 lines
2.1 KiB
AppleScript
-- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
-- for details. All rights reserved. Use of this source code is governed by a
|
|
-- BSD-style license that can be found in the LICENSE file.
|
|
|
|
-- This: 'tell application "Firefox" to activate' doesn't seem to bring
|
|
-- application in focus if it's not already open.
|
|
do shell script "open -a Firefox"
|
|
|
|
delay 3.0
|
|
|
|
tell application "System Events"
|
|
--- Open Incognito window to avoid effect of caching of pages.
|
|
keystroke "p" using {command down, shift down}
|
|
|
|
delay 1.0
|
|
|
|
keystroke "l" using command down
|
|
|
|
keystroke "http://localhost:8080/"
|
|
-- Simulate Enter key.
|
|
key code 36
|
|
|
|
delay 10.0
|
|
|
|
-- Refresh the page to reload the scripts
|
|
keystroke "r" using command down
|
|
|
|
keystroke "l" using command down
|
|
|
|
delay 1.0
|
|
|
|
-- Simulate Tab key to get to 'Pick an example' dropdown
|
|
repeat 8 times
|
|
key code 48
|
|
end repeat
|
|
|
|
-- Simulate Down then Enter to select Hello, World
|
|
key code 125
|
|
key code 36
|
|
|
|
delay 1.0
|
|
|
|
keystroke "l" using command down
|
|
|
|
delay 1.0
|
|
|
|
-- Simulate Tab key to get to Code editor.
|
|
repeat 9 times
|
|
key code 48
|
|
end repeat
|
|
|
|
-- Simulate sequence of Down keys to get to "print(greeting);" line
|
|
repeat 8 times
|
|
key code 125
|
|
end repeat
|
|
|
|
-- Simulate Cmd-Right.
|
|
key code 124 using command down
|
|
|
|
keystroke "print('c');"
|
|
|
|
-- Simulate Left*11 to get to the beginning of "print('c');"
|
|
repeat 11 times
|
|
key code 123
|
|
end repeat
|
|
|
|
-- Simulate Enter to split lines
|
|
key code 36
|
|
|
|
-- Simulate Delete to join lines
|
|
key code 51
|
|
|
|
-- Simulate Enter to split lines
|
|
key code 36
|
|
|
|
-- Simulate Right*8 to get to right after the c in "print('c');"
|
|
repeat 8 times
|
|
key code 124
|
|
end repeat
|
|
|
|
keystroke "d"
|
|
|
|
delay 0.1
|
|
keystroke "a" using command down
|
|
delay 0.2
|
|
keystroke "c" using command down
|
|
|
|
delay 1
|
|
set clipboardData to (the clipboard as text)
|
|
|
|
if ("print('cd')" is not in (clipboardData as string)) then
|
|
error "print('cd') is not in clipboardData: "
|
|
end if
|
|
end tell
|
|
|
|
tell application "Firefox" to quit
|
|
|
|
display notification "Test passed" with title "Firefox test" sound name "Glass" |