-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix find-window for macOS Catalina * Rebuild binary * Rewrite open in objc * Add single binary * Try to fix * Final commit * Revert lint * Fix open safari
- Loading branch information
1 parent
543c521
commit 9002d21
Showing
51 changed files
with
397 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ | |
|
||
/src/natives/*/any/bin/** | ||
/src/natives/*/any/obj/** | ||
|
||
/src/natives/*/mac/obj/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>testcafe-browser-tools</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.devexpress.testcafe-browser-tools</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>TestCafe Browser Tools</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSupportedPlatforms</key> | ||
<array> | ||
<string>MacOSX</string> | ||
</array> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>CFBundleIconFile</key> | ||
<string>testcafe.icns</string> | ||
<key>LSUIElement</key> | ||
<true/> | ||
<key>NSAppleEventsUsageDescription</key> | ||
<string>TestCafe uses Automation to take screenshots and control browser windows</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2019 DevExpress. All rights reserved.</string> | ||
<key>NSSupportsAutomaticTermination</key> | ||
<true/> | ||
<key>NSSupportsSuddenTermination</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+127 KB
bin/mac/TestCafe Browser Tools.app/Contents/MacOS/testcafe-browser-tools
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APPL???? |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
all: clean build | ||
clean: | ||
rm "${DEST}/testcafe-browser-tools" || true | ||
build: | ||
mkdir "${DEST}" || true | ||
clang -o "${DEST}/testcafe-browser-tools" -framework Cocoa -framework ScriptingBridge -framework AppKit ../../*/{mac,any}/obj/*.o testcafe-browser-tools.m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// testcafe-browser-tools.m | ||
// Dispatch browser manipulation commands | ||
// | ||
|
||
#include <fcntl.h> | ||
#import <Cocoa/Cocoa.h> | ||
|
||
typedef int command (int argc, const char * argv[]); | ||
|
||
int bringToFront (int argc, const char * argv[]); | ||
int closeWindow (int argc, const char * argv[]); | ||
int findWindow (int argc, const char * argv[]); | ||
int generateThumbnail (int argc, const char * argv[]); | ||
int getWindowBounds (int argc, const char * argv[]); | ||
int getWindowMaxBounds (int argc, const char * argv[]); | ||
int getWindowSize (int argc, const char * argv[]); | ||
int openWindow (int argc, const char * argv[]); | ||
int resize (int argc, const char * argv[]); | ||
int screenshot (int argc, const char * argv[]); | ||
int setWindowBounds (int argc, const char * argv[]); | ||
|
||
int main (int argc, const char * argv[]) { | ||
int fd = open(argv[1], O_WRONLY); | ||
|
||
if (fd != -1) | ||
dup2(fd, STDOUT_FILENO); | ||
|
||
@autoreleasepool { | ||
id commands = @{ | ||
@"bring-to-front": [NSValue valueWithPointer: &bringToFront], | ||
@"close": [NSValue valueWithPointer: &closeWindow], | ||
@"find-window": [NSValue valueWithPointer: &findWindow], | ||
@"generate-thumbnail": [NSValue valueWithPointer: &generateThumbnail], | ||
@"get-window-bounds": [NSValue valueWithPointer: &getWindowBounds], | ||
@"get-window-max-bounds": [NSValue valueWithPointer: &getWindowMaxBounds], | ||
@"get-window-size": [NSValue valueWithPointer: &getWindowSize], | ||
@"open": [NSValue valueWithPointer: &openWindow], | ||
@"resize": [NSValue valueWithPointer: &resize], | ||
@"screenshot": [NSValue valueWithPointer: &screenshot], | ||
@"set-window-bounds": [NSValue valueWithPointer: &setWindowBounds], | ||
|
||
}; | ||
|
||
id commandName = [NSString stringWithUTF8String:argv[2]]; | ||
|
||
id item = commands[commandName]; | ||
|
||
if (item == nil) | ||
return 1; | ||
|
||
command *commandPointer = (command *)[item pointerValue]; | ||
|
||
int exitCode = (*commandPointer)(argc - 2, argv + 2); | ||
|
||
printf("\nExit code: %d\n", exitCode); | ||
|
||
if (fd != -1) { | ||
fsync(fd); | ||
close(fd); | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
all: clean build | ||
clean: | ||
rm "${DEST}/bring-to-front" || true | ||
rm "${DEST}/bring-to-front.o" || true | ||
build: | ||
mkdir "${DEST}" || true | ||
clang -o "${DEST}/bring-to-front" -framework Cocoa -framework ScriptingBridge -framework AppKit bring-to-front.m | ||
clang -c -o "${DEST}/bring-to-front.o" bring-to-front.m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
all: clean build | ||
clean: | ||
rm "${DEST}/close" || true | ||
rm "${DEST}/close.o" || true | ||
build: | ||
mkdir "${DEST}" || true | ||
clang -o "${DEST}/close" -framework Cocoa -framework ScriptingBridge close.m | ||
clang -c -o "${DEST}/close.o" close.m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
all: clean build | ||
clean: | ||
rm "${DEST}/find-window" || true | ||
rm "${DEST}/find-window.o" || true | ||
build: | ||
mkdir "${DEST}" || true | ||
clang -o "${DEST}/find-window" -framework Cocoa -framework ScriptingBridge find-window.m | ||
clang -c -o "${DEST}/find-window.o" find-window.m |
Oops, something went wrong.