appium-webdriveragent 7.0.5 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/PrivateHeaders/XCTest/XCTRunnerDaemonSession.h +8 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +60 -0
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +14 -8
- package/WebDriverAgentLib/Commands/FBVideoCommands.h +20 -0
- package/WebDriverAgentLib/Commands/FBVideoCommands.m +85 -0
- package/WebDriverAgentLib/Routing/FBExceptionHandler.m +3 -0
- package/WebDriverAgentLib/Routing/FBExceptions.h +3 -0
- package/WebDriverAgentLib/Routing/FBExceptions.m +1 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.h +57 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.m +73 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.h +30 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.m +32 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.h +40 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.m +95 -0
- package/WebDriverAgentLib/Routing/FBSession.m +13 -0
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +6 -0
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +81 -16
- package/WebDriverAgentTests/IntegrationTests/FBVideoRecordingTests.m +63 -0
- package/build/lib/check-dependencies.js.map +1 -1
- package/build/lib/no-session-proxy.js.map +1 -1
- package/build/lib/utils.js +1 -1
- package/build/lib/utils.js.map +1 -1
- package/build/lib/webdriveragent.d.ts +2 -2
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [7.1.0](https://github.com/appium/WebDriverAgent/compare/v7.0.6...v7.1.0) (2024-03-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add wrappers for native XCTest video recorder ([#858](https://github.com/appium/WebDriverAgent/issues/858)) ([9728548](https://github.com/appium/WebDriverAgent/commit/9728548676c8de67c30d127ee8b0374f58286e74))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* bump typescript ([89880f5](https://github.com/appium/WebDriverAgent/commit/89880f509f930f16f6469bcda613569040c337b6))
|
|
12
|
+
|
|
13
|
+
## [7.0.6](https://github.com/appium/WebDriverAgent/compare/v7.0.5...v7.0.6) (2024-03-03)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Miscellaneous Chores
|
|
17
|
+
|
|
18
|
+
* Handle app startup errors as session creation exceptions ([#855](https://github.com/appium/WebDriverAgent/issues/855)) ([0ec5398](https://github.com/appium/WebDriverAgent/commit/0ec5398e9cb4b0e5ab133cc0c330b85b3d37766e))
|
|
19
|
+
|
|
1
20
|
## [7.0.5](https://github.com/appium/WebDriverAgent/compare/v7.0.4...v7.0.5) (2024-03-03)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
@property(readonly) _Bool supportsLocationSimulation;
|
|
81
81
|
#endif
|
|
82
82
|
|
|
83
|
+
// Since Xcode 15.0-beta1
|
|
84
|
+
- (void)stopScreenRecordingWithUUID:(NSUUID *)arg1
|
|
85
|
+
withReply:(void (^)(NSError *))arg2;
|
|
86
|
+
- (void)startScreenRecordingWithRequest:(id/* XCTScreenRecordingRequest */)arg1
|
|
87
|
+
withReply:(void (^)(id/* XCTAttachmentFutureMetadata */, NSError *))arg2;
|
|
88
|
+
- (_Bool)supportsScreenRecording;
|
|
89
|
+
- (_Bool)preferScreenshotsOverScreenRecordings;
|
|
90
|
+
|
|
83
91
|
// Since Xcode 10.2
|
|
84
92
|
- (void)launchApplicationWithPath:(NSString *)arg1
|
|
85
93
|
bundleID:(NSString *)arg2
|
|
@@ -457,6 +457,27 @@
|
|
|
457
457
|
71B155E123080CA600646AFB /* FBProtocolHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B155DE23080CA600646AFB /* FBProtocolHelpers.m */; };
|
|
458
458
|
71B49EC71ED1A58100D51AD6 /* XCUIElement+FBUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B49EC51ED1A58100D51AD6 /* XCUIElement+FBUID.h */; };
|
|
459
459
|
71B49EC81ED1A58100D51AD6 /* XCUIElement+FBUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B49EC61ED1A58100D51AD6 /* XCUIElement+FBUID.m */; };
|
|
460
|
+
71BB58DE2B9631B700CB9BFE /* FBVideoRecordingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58DD2B9631B700CB9BFE /* FBVideoRecordingTests.m */; };
|
|
461
|
+
71BB58E12B9631F100CB9BFE /* FBScreenRecordingPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58DF2B9631F100CB9BFE /* FBScreenRecordingPromise.h */; };
|
|
462
|
+
71BB58E22B9631F100CB9BFE /* FBScreenRecordingPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58DF2B9631F100CB9BFE /* FBScreenRecordingPromise.h */; };
|
|
463
|
+
71BB58E32B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E02B9631F100CB9BFE /* FBScreenRecordingPromise.m */; };
|
|
464
|
+
71BB58E42B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E02B9631F100CB9BFE /* FBScreenRecordingPromise.m */; };
|
|
465
|
+
71BB58E52B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E02B9631F100CB9BFE /* FBScreenRecordingPromise.m */; };
|
|
466
|
+
71BB58E82B96328700CB9BFE /* FBScreenRecordingRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58E62B96328700CB9BFE /* FBScreenRecordingRequest.h */; };
|
|
467
|
+
71BB58E92B96328700CB9BFE /* FBScreenRecordingRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58E62B96328700CB9BFE /* FBScreenRecordingRequest.h */; };
|
|
468
|
+
71BB58EA2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E72B96328700CB9BFE /* FBScreenRecordingRequest.m */; };
|
|
469
|
+
71BB58EB2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E72B96328700CB9BFE /* FBScreenRecordingRequest.m */; };
|
|
470
|
+
71BB58EC2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58E72B96328700CB9BFE /* FBScreenRecordingRequest.m */; };
|
|
471
|
+
71BB58EF2B96511800CB9BFE /* FBVideoCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58ED2B96511800CB9BFE /* FBVideoCommands.h */; };
|
|
472
|
+
71BB58F02B96511800CB9BFE /* FBVideoCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58ED2B96511800CB9BFE /* FBVideoCommands.h */; };
|
|
473
|
+
71BB58F12B96511800CB9BFE /* FBVideoCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58EE2B96511800CB9BFE /* FBVideoCommands.m */; };
|
|
474
|
+
71BB58F22B96511800CB9BFE /* FBVideoCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58EE2B96511800CB9BFE /* FBVideoCommands.m */; };
|
|
475
|
+
71BB58F32B96511800CB9BFE /* FBVideoCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58EE2B96511800CB9BFE /* FBVideoCommands.m */; };
|
|
476
|
+
71BB58F62B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58F42B96531900CB9BFE /* FBScreenRecordingContainer.h */; };
|
|
477
|
+
71BB58F72B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BB58F42B96531900CB9BFE /* FBScreenRecordingContainer.h */; };
|
|
478
|
+
71BB58F82B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58F52B96531900CB9BFE /* FBScreenRecordingContainer.m */; };
|
|
479
|
+
71BB58F92B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58F52B96531900CB9BFE /* FBScreenRecordingContainer.m */; };
|
|
480
|
+
71BB58FA2B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BB58F52B96531900CB9BFE /* FBScreenRecordingContainer.m */; };
|
|
460
481
|
71BD20731F86116100B36EC2 /* XCUIApplication+FBTouchAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD20711F86116100B36EC2 /* XCUIApplication+FBTouchAction.h */; };
|
|
461
482
|
71BD20741F86116100B36EC2 /* XCUIApplication+FBTouchAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD20721F86116100B36EC2 /* XCUIApplication+FBTouchAction.m */; };
|
|
462
483
|
71C8E55125399A6B008572C1 /* XCUIApplication+FBQuiescence.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C8E54F25399A6B008572C1 /* XCUIApplication+FBQuiescence.h */; };
|
|
@@ -1035,6 +1056,15 @@
|
|
|
1035
1056
|
71B155DE23080CA600646AFB /* FBProtocolHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBProtocolHelpers.m; sourceTree = "<group>"; };
|
|
1036
1057
|
71B49EC51ED1A58100D51AD6 /* XCUIElement+FBUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XCUIElement+FBUID.h"; sourceTree = "<group>"; };
|
|
1037
1058
|
71B49EC61ED1A58100D51AD6 /* XCUIElement+FBUID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "XCUIElement+FBUID.m"; sourceTree = "<group>"; };
|
|
1059
|
+
71BB58DD2B9631B700CB9BFE /* FBVideoRecordingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBVideoRecordingTests.m; sourceTree = "<group>"; };
|
|
1060
|
+
71BB58DF2B9631F100CB9BFE /* FBScreenRecordingPromise.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBScreenRecordingPromise.h; sourceTree = "<group>"; };
|
|
1061
|
+
71BB58E02B9631F100CB9BFE /* FBScreenRecordingPromise.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBScreenRecordingPromise.m; sourceTree = "<group>"; };
|
|
1062
|
+
71BB58E62B96328700CB9BFE /* FBScreenRecordingRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBScreenRecordingRequest.h; sourceTree = "<group>"; };
|
|
1063
|
+
71BB58E72B96328700CB9BFE /* FBScreenRecordingRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBScreenRecordingRequest.m; sourceTree = "<group>"; };
|
|
1064
|
+
71BB58ED2B96511800CB9BFE /* FBVideoCommands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBVideoCommands.h; sourceTree = "<group>"; };
|
|
1065
|
+
71BB58EE2B96511800CB9BFE /* FBVideoCommands.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBVideoCommands.m; sourceTree = "<group>"; };
|
|
1066
|
+
71BB58F42B96531900CB9BFE /* FBScreenRecordingContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBScreenRecordingContainer.h; sourceTree = "<group>"; };
|
|
1067
|
+
71BB58F52B96531900CB9BFE /* FBScreenRecordingContainer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBScreenRecordingContainer.m; sourceTree = "<group>"; };
|
|
1038
1068
|
71BD20711F86116100B36EC2 /* XCUIApplication+FBTouchAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIApplication+FBTouchAction.h"; sourceTree = "<group>"; };
|
|
1039
1069
|
71BD20721F86116100B36EC2 /* XCUIApplication+FBTouchAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUIApplication+FBTouchAction.m"; sourceTree = "<group>"; };
|
|
1040
1070
|
71C8E54F25399A6B008572C1 /* XCUIApplication+FBQuiescence.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIApplication+FBQuiescence.h"; sourceTree = "<group>"; };
|
|
@@ -1789,6 +1819,8 @@
|
|
|
1789
1819
|
EE9AB7631CAEDF0C008C271F /* FBTouchIDCommands.m */,
|
|
1790
1820
|
EE9AB7641CAEDF0C008C271F /* FBUnknownCommands.h */,
|
|
1791
1821
|
EE9AB7651CAEDF0C008C271F /* FBUnknownCommands.m */,
|
|
1822
|
+
71BB58ED2B96511800CB9BFE /* FBVideoCommands.h */,
|
|
1823
|
+
71BB58EE2B96511800CB9BFE /* FBVideoCommands.m */,
|
|
1792
1824
|
);
|
|
1793
1825
|
name = Commands;
|
|
1794
1826
|
path = WebDriverAgentLib/Commands;
|
|
@@ -1828,6 +1860,12 @@
|
|
|
1828
1860
|
EE9AB7861CAEDF0C008C271F /* FBRouteRequest-Private.h */,
|
|
1829
1861
|
EE9AB7871CAEDF0C008C271F /* FBRouteRequest.h */,
|
|
1830
1862
|
EE9AB7881CAEDF0C008C271F /* FBRouteRequest.m */,
|
|
1863
|
+
71BB58F42B96531900CB9BFE /* FBScreenRecordingContainer.h */,
|
|
1864
|
+
71BB58F52B96531900CB9BFE /* FBScreenRecordingContainer.m */,
|
|
1865
|
+
71BB58DF2B9631F100CB9BFE /* FBScreenRecordingPromise.h */,
|
|
1866
|
+
71BB58E02B9631F100CB9BFE /* FBScreenRecordingPromise.m */,
|
|
1867
|
+
71BB58E62B96328700CB9BFE /* FBScreenRecordingRequest.h */,
|
|
1868
|
+
71BB58E72B96328700CB9BFE /* FBScreenRecordingRequest.m */,
|
|
1831
1869
|
EE9AB7891CAEDF0C008C271F /* FBSession-Private.h */,
|
|
1832
1870
|
EE9AB78A1CAEDF0C008C271F /* FBSession.h */,
|
|
1833
1871
|
EE9AB78B1CAEDF0C008C271F /* FBSession.m */,
|
|
@@ -1972,6 +2010,7 @@
|
|
|
1972
2010
|
EE1E06DC1D1811C4007CF043 /* FBTestMacros.h */,
|
|
1973
2011
|
AD76723F1D6B826F00610457 /* FBTypingTest.m */,
|
|
1974
2012
|
714CA3C61DC23186000F12C9 /* FBXPathIntegrationTests.m */,
|
|
2013
|
+
71BB58DD2B9631B700CB9BFE /* FBVideoRecordingTests.m */,
|
|
1975
2014
|
71241D7D1FAF084E00B9559F /* FBW3CTouchActionsIntegrationTests.m */,
|
|
1976
2015
|
71241D7F1FAF087500B9559F /* FBW3CMultiTouchActionsIntegrationTests.m */,
|
|
1977
2016
|
7136C0F8243A182400921C76 /* FBW3CTypeActionsTests.m */,
|
|
@@ -2264,6 +2303,7 @@
|
|
|
2264
2303
|
641EE64F2240C5CA00173FCB /* XCTestExpectationWaiter.h in Headers */,
|
|
2265
2304
|
13DE7A5C287CA444003243C6 /* FBXCElementSnapshotWrapper+Helpers.h in Headers */,
|
|
2266
2305
|
641EE6502240C5CA00173FCB /* UIGestureRecognizer-RecordingAdditions.h in Headers */,
|
|
2306
|
+
71BB58E92B96328700CB9BFE /* FBScreenRecordingRequest.h in Headers */,
|
|
2267
2307
|
641EE6512240C5CA00173FCB /* XCKeyboardKeyMap.h in Headers */,
|
|
2268
2308
|
641EE6522240C5CA00173FCB /* XCTNSPredicateExpectationObject-Protocol.h in Headers */,
|
|
2269
2309
|
641EE6532240C5CA00173FCB /* WebDriverAgentLib.h in Headers */,
|
|
@@ -2280,6 +2320,7 @@
|
|
|
2280
2320
|
641EE65F2240C5CA00173FCB /* XCSourceCodeTreeNodeEnumerator.h in Headers */,
|
|
2281
2321
|
641EE6602240C5CA00173FCB /* XCUIElement+FBIsVisible.h in Headers */,
|
|
2282
2322
|
641EE6622240C5CA00173FCB /* FBResponsePayload.h in Headers */,
|
|
2323
|
+
71BB58E22B9631F100CB9BFE /* FBScreenRecordingPromise.h in Headers */,
|
|
2283
2324
|
641EE6632240C5CA00173FCB /* FBUnknownCommands.h in Headers */,
|
|
2284
2325
|
641EE7062240CDCF00173FCB /* XCUIElement+FBTVFocuse.h in Headers */,
|
|
2285
2326
|
71822738258744B800661B83 /* HTTPConnection.h in Headers */,
|
|
@@ -2382,6 +2423,7 @@
|
|
|
2382
2423
|
7182276E258744C900661B83 /* HTTPErrorResponse.h in Headers */,
|
|
2383
2424
|
641EE6B82240C5CA00173FCB /* FBAlert.h in Headers */,
|
|
2384
2425
|
641EE6B92240C5CA00173FCB /* XCUIElementQuery.h in Headers */,
|
|
2426
|
+
71BB58F02B96511800CB9BFE /* FBVideoCommands.h in Headers */,
|
|
2385
2427
|
641EE6BA2240C5CA00173FCB /* XCPointerEvent.h in Headers */,
|
|
2386
2428
|
718F49C923087ACF0045FE8B /* FBProtocolHelpers.h in Headers */,
|
|
2387
2429
|
641EE6BB2240C5CA00173FCB /* XCSourceCodeRecording.h in Headers */,
|
|
@@ -2419,6 +2461,7 @@
|
|
|
2419
2461
|
641EE6D42240C5CA00173FCB /* NSValue-XCTestAdditions.h in Headers */,
|
|
2420
2462
|
641EE6D52240C5CA00173FCB /* _XCTWaiterImpl.h in Headers */,
|
|
2421
2463
|
641EE6D62240C5CA00173FCB /* FBLogger.h in Headers */,
|
|
2464
|
+
71BB58F72B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */,
|
|
2422
2465
|
641EE6D72240C5CA00173FCB /* XCTestObserver.h in Headers */,
|
|
2423
2466
|
641EE6D82240C5CA00173FCB /* XCUIElement.h in Headers */,
|
|
2424
2467
|
641EE6D92240C5CA00173FCB /* XCKeyboardInputSolver.h in Headers */,
|
|
@@ -2479,6 +2522,7 @@
|
|
|
2479
2522
|
EE158ABA1CBD456F00A3E3F0 /* FBCustomCommands.h in Headers */,
|
|
2480
2523
|
EE35AD0D1E3B77D600A02D78 /* _XCTestCaseInterruptionException.h in Headers */,
|
|
2481
2524
|
EE158AC41CBD456F00A3E3F0 /* FBOrientationCommands.h in Headers */,
|
|
2525
|
+
71BB58EF2B96511800CB9BFE /* FBVideoCommands.h in Headers */,
|
|
2482
2526
|
7119097C2152580600BA3C7E /* XCUIScreen.h in Headers */,
|
|
2483
2527
|
EE35AD611E3B77D600A02D78 /* XCTRunnerIDESession.h in Headers */,
|
|
2484
2528
|
EE158AE01CBD456F00A3E3F0 /* FBRouteRequest-Private.h in Headers */,
|
|
@@ -2559,6 +2603,7 @@
|
|
|
2559
2603
|
EE158AD21CBD456F00A3E3F0 /* FBElementCache.h in Headers */,
|
|
2560
2604
|
EE35AD5A1E3B77D600A02D78 /* XCTMetric.h in Headers */,
|
|
2561
2605
|
EE35AD461E3B77D600A02D78 /* XCTestContextScope.h in Headers */,
|
|
2606
|
+
71BB58F62B96531900CB9BFE /* FBScreenRecordingContainer.h in Headers */,
|
|
2562
2607
|
71A7EAF51E20516B001DA4F2 /* XCUIElement+FBClassChain.h in Headers */,
|
|
2563
2608
|
EE158ADA1CBD456F00A3E3F0 /* FBResponseJSONPayload.h in Headers */,
|
|
2564
2609
|
EE35AD3D1E3B77D600A02D78 /* XCTAutomationTarget-Protocol.h in Headers */,
|
|
@@ -2621,6 +2666,7 @@
|
|
|
2621
2666
|
EE35AD331E3B77D600A02D78 /* XCPointerEvent.h in Headers */,
|
|
2622
2667
|
EE35AD351E3B77D600A02D78 /* XCSourceCodeRecording.h in Headers */,
|
|
2623
2668
|
71D04DC825356C43008A052C /* XCUIElement+FBCaching.h in Headers */,
|
|
2669
|
+
71BB58E12B9631F100CB9BFE /* FBScreenRecordingPromise.h in Headers */,
|
|
2624
2670
|
E444DC99249131D40060D7EB /* HTTPLogging.h in Headers */,
|
|
2625
2671
|
E444DC9B249131D40060D7EB /* HTTPResponse.h in Headers */,
|
|
2626
2672
|
EEE9B4721CD02B88009D2030 /* FBRunLoopSpinner.h in Headers */,
|
|
@@ -2646,6 +2692,7 @@
|
|
|
2646
2692
|
EE35AD571E3B77D600A02D78 /* XCTestSuiteRun.h in Headers */,
|
|
2647
2693
|
EE35AD701E3B77D600A02D78 /* XCUIElementAsynchronousHandlerWrapper.h in Headers */,
|
|
2648
2694
|
EE35AD4C1E3B77D600A02D78 /* XCTestLog.h in Headers */,
|
|
2695
|
+
71BB58E82B96328700CB9BFE /* FBScreenRecordingRequest.h in Headers */,
|
|
2649
2696
|
EE35AD231E3B77D600A02D78 /* UITapGestureRecognizer-RecordingAdditions.h in Headers */,
|
|
2650
2697
|
EE35AD2A1E3B77D600A02D78 /* XCDebugLogDelegate-Protocol.h in Headers */,
|
|
2651
2698
|
EE35AD1C1E3B77D600A02D78 /* NSString-XCTAdditions.h in Headers */,
|
|
@@ -3051,6 +3098,7 @@
|
|
|
3051
3098
|
71C8E55425399A6B008572C1 /* XCUIApplication+FBQuiescence.m in Sources */,
|
|
3052
3099
|
641EE5DC2240C5CA00173FCB /* XCUIApplication+FBAlert.m in Sources */,
|
|
3053
3100
|
641EE70F2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */,
|
|
3101
|
+
71BB58EB2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */,
|
|
3054
3102
|
714D88CF2733FB970074A925 /* FBXMLGenerationOptions.m in Sources */,
|
|
3055
3103
|
641EE5DE2240C5CA00173FCB /* XCUIApplication+FBTouchAction.m in Sources */,
|
|
3056
3104
|
714E14BB29805CAE00375DD7 /* XCAXClient_iOS+FBSnapshotReqParams.m in Sources */,
|
|
@@ -3106,6 +3154,7 @@
|
|
|
3106
3154
|
641EE6092240C5CA00173FCB /* XCUIElement+FBUtilities.m in Sources */,
|
|
3107
3155
|
641EE60A2240C5CA00173FCB /* FBLogger.m in Sources */,
|
|
3108
3156
|
641EE60B2240C5CA00173FCB /* FBCustomCommands.m in Sources */,
|
|
3157
|
+
71BB58E42B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */,
|
|
3109
3158
|
641EE60C2240C5CA00173FCB /* XCUIDevice+FBHelpers.m in Sources */,
|
|
3110
3159
|
641EE60D2240C5CA00173FCB /* XCTestPrivateSymbols.m in Sources */,
|
|
3111
3160
|
641EE60E2240C5CA00173FCB /* XCUIElement+FBTyping.m in Sources */,
|
|
@@ -3117,6 +3166,7 @@
|
|
|
3117
3166
|
641EE6132240C5CA00173FCB /* FBDebugLogDelegateDecorator.m in Sources */,
|
|
3118
3167
|
641EE6142240C5CA00173FCB /* FBAlertViewCommands.m in Sources */,
|
|
3119
3168
|
71414EDB2670A1EE003A8C5D /* LRUCacheNode.m in Sources */,
|
|
3169
|
+
71BB58F92B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */,
|
|
3120
3170
|
641EE6152240C5CA00173FCB /* XCUIElement+FBScrolling.m in Sources */,
|
|
3121
3171
|
641EE6162240C5CA00173FCB /* FBSessionCommands.m in Sources */,
|
|
3122
3172
|
641EE6192240C5CA00173FCB /* FBConfiguration.m in Sources */,
|
|
@@ -3128,6 +3178,7 @@
|
|
|
3128
3178
|
716C9DFD27315D21005AD475 /* FBReflectionUtils.m in Sources */,
|
|
3129
3179
|
641EE61D2240C5CA00173FCB /* FBElementCommands.m in Sources */,
|
|
3130
3180
|
641EE61E2240C5CA00173FCB /* FBExceptionHandler.m in Sources */,
|
|
3181
|
+
71BB58F22B96511800CB9BFE /* FBVideoCommands.m in Sources */,
|
|
3131
3182
|
641EE61F2240C5CA00173FCB /* FBXCodeCompatibility.m in Sources */,
|
|
3132
3183
|
71E75E70254824230099FC87 /* XCUIElementQuery+FBHelpers.m in Sources */,
|
|
3133
3184
|
641EE6212240C5CA00173FCB /* FBElementTypeTransformer.m in Sources */,
|
|
@@ -3175,6 +3226,7 @@
|
|
|
3175
3226
|
719DCF172601EAFB000E765F /* FBNotificationsHelper.m in Sources */,
|
|
3176
3227
|
E444DCAC24913C220060D7EB /* Route.m in Sources */,
|
|
3177
3228
|
713C6DD01DDC772A00285B92 /* FBElementUtils.m in Sources */,
|
|
3229
|
+
71BB58E32B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */,
|
|
3178
3230
|
7140974C1FAE1B51008FB2C5 /* FBW3CActionsSynthesizer.m in Sources */,
|
|
3179
3231
|
EE6A893B1D0B38640083E92B /* FBFailureProofTestCase.m in Sources */,
|
|
3180
3232
|
713AE576243A53BE0000D657 /* FBW3CActionsHelpers.m in Sources */,
|
|
@@ -3212,6 +3264,7 @@
|
|
|
3212
3264
|
71F5BE51252F14EB00EE9EBA /* FBExceptions.m in Sources */,
|
|
3213
3265
|
EE158ABD1CBD456F00A3E3F0 /* FBDebugCommands.m in Sources */,
|
|
3214
3266
|
716E0BCF1E917E810087A825 /* NSString+FBXMLSafeString.m in Sources */,
|
|
3267
|
+
71BB58EA2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */,
|
|
3215
3268
|
EE158ACD1CBD456F00A3E3F0 /* FBUnknownCommands.m in Sources */,
|
|
3216
3269
|
EE158AC51CBD456F00A3E3F0 /* FBOrientationCommands.m in Sources */,
|
|
3217
3270
|
716F0DA32A16CA1000CDD977 /* NSDictionary+FBUtf8SafeDictionary.m in Sources */,
|
|
@@ -3242,8 +3295,10 @@
|
|
|
3242
3295
|
71C8E55325399A6B008572C1 /* XCUIApplication+FBQuiescence.m in Sources */,
|
|
3243
3296
|
71414EDA2670A1EE003A8C5D /* LRUCacheNode.m in Sources */,
|
|
3244
3297
|
EE158AB91CBD456F00A3E3F0 /* FBAlertViewCommands.m in Sources */,
|
|
3298
|
+
71BB58F12B96511800CB9BFE /* FBVideoCommands.m in Sources */,
|
|
3245
3299
|
71F3E7D625417FF400E0C22B /* FBSettings.m in Sources */,
|
|
3246
3300
|
13DE7A57287CA1EC003243C6 /* FBXCElementSnapshotWrapper.m in Sources */,
|
|
3301
|
+
71BB58F82B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */,
|
|
3247
3302
|
EE158AB31CBD456F00A3E3F0 /* XCUIElement+FBScrolling.m in Sources */,
|
|
3248
3303
|
718226CE2587443700661B83 /* GCDAsyncSocket.m in Sources */,
|
|
3249
3304
|
EE158AC91CBD456F00A3E3F0 /* FBSessionCommands.m in Sources */,
|
|
@@ -3276,14 +3331,19 @@
|
|
|
3276
3331
|
buildActionMask = 2147483647;
|
|
3277
3332
|
files = (
|
|
3278
3333
|
71241D801FAF087500B9559F /* FBW3CMultiTouchActionsIntegrationTests.m in Sources */,
|
|
3334
|
+
71BB58DE2B9631B700CB9BFE /* FBVideoRecordingTests.m in Sources */,
|
|
3279
3335
|
71241D7E1FAF084E00B9559F /* FBW3CTouchActionsIntegrationTests.m in Sources */,
|
|
3280
3336
|
63FD950221F9D06100A3E356 /* FBImageProcessorTests.m in Sources */,
|
|
3281
3337
|
719CD8FF2126C90200C7D0C2 /* FBAutoAlertsHandlerTests.m in Sources */,
|
|
3282
3338
|
EE2202131ECC612200A29571 /* FBIntegrationTestCase.m in Sources */,
|
|
3283
3339
|
715AFAC41FFA2AAF0053896D /* FBScreenTests.m in Sources */,
|
|
3340
|
+
71BB58EC2B96328700CB9BFE /* FBScreenRecordingRequest.m in Sources */,
|
|
3284
3341
|
EE22021E1ECC618900A29571 /* FBTapTest.m in Sources */,
|
|
3285
3342
|
71930C472066434000D3AFEC /* FBPasteboardTests.m in Sources */,
|
|
3343
|
+
71BB58E52B9631F100CB9BFE /* FBScreenRecordingPromise.m in Sources */,
|
|
3344
|
+
71BB58FA2B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */,
|
|
3286
3345
|
7150FFF722476B3A00B2EE28 /* FBForceTouchTests.m in Sources */,
|
|
3346
|
+
71BB58F32B96511800CB9BFE /* FBVideoCommands.m in Sources */,
|
|
3287
3347
|
);
|
|
3288
3348
|
runOnlyForDeploymentPostprocessing = 0;
|
|
3289
3349
|
};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#import "FBCapabilities.h"
|
|
13
13
|
#import "FBConfiguration.h"
|
|
14
|
+
#import "FBExceptions.h"
|
|
14
15
|
#import "FBLogger.h"
|
|
15
16
|
#import "FBProtocolHelpers.h"
|
|
16
17
|
#import "FBRouteRequest.h"
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
traceback:nil]);
|
|
92
93
|
}
|
|
93
94
|
if (nil == (capabilities = FBParseCapabilities((NSDictionary *)request.arguments[@"capabilities"], &error))) {
|
|
94
|
-
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:error.
|
|
95
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:error.localizedDescription traceback:nil]);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
[FBConfiguration resetSessionSettings];
|
|
@@ -159,12 +160,16 @@
|
|
|
159
160
|
if (![XCUIDevice.sharedDevice fb_openUrl:initialUrl
|
|
160
161
|
withApplication:bundleID
|
|
161
162
|
error:&openError]) {
|
|
162
|
-
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@
|
|
163
|
-
initialUrl, bundleID, openError.
|
|
163
|
+
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ with the %@ application. Original error: %@",
|
|
164
|
+
initialUrl, bundleID, openError.localizedDescription];
|
|
164
165
|
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
|
|
165
166
|
}
|
|
166
167
|
} else {
|
|
167
|
-
|
|
168
|
+
@try {
|
|
169
|
+
[app launch];
|
|
170
|
+
} @catch (NSException *e) {
|
|
171
|
+
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:e.reason traceback:nil]);
|
|
172
|
+
}
|
|
168
173
|
}
|
|
169
174
|
if (!app.running) {
|
|
170
175
|
NSString *errorMsg = [NSString stringWithFormat:@"Cannot launch %@ application. Make sure the correct bundle identifier has been provided in capabilities and check the device log for possible crash report occurrences", bundleID];
|
|
@@ -178,7 +183,7 @@
|
|
|
178
183
|
withApplication:bundleID
|
|
179
184
|
error:&openError]) {
|
|
180
185
|
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@ with the %@ application. Original error: %@",
|
|
181
|
-
initialUrl, bundleID, openError.
|
|
186
|
+
initialUrl, bundleID, openError.localizedDescription];
|
|
182
187
|
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
|
|
183
188
|
}
|
|
184
189
|
} else {
|
|
@@ -191,7 +196,7 @@
|
|
|
191
196
|
NSError *openError;
|
|
192
197
|
if (![XCUIDevice.sharedDevice fb_openUrl:initialUrl error:&openError]) {
|
|
193
198
|
NSString *errorMsg = [NSString stringWithFormat:@"Cannot open the URL %@. Original error: %@",
|
|
194
|
-
initialUrl, openError.
|
|
199
|
+
initialUrl, openError.localizedDescription];
|
|
195
200
|
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:errorMsg traceback:nil]);
|
|
196
201
|
}
|
|
197
202
|
}
|
|
@@ -396,7 +401,8 @@
|
|
|
396
401
|
NSError *error;
|
|
397
402
|
if (![FBActiveAppDetectionPoint.sharedInstance setCoordinatesWithString:(NSString *)[settings objectForKey:FB_SETTING_ACTIVE_APP_DETECTION_POINT]
|
|
398
403
|
error:&error]) {
|
|
399
|
-
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.
|
|
404
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
405
|
+
traceback:nil]);
|
|
400
406
|
}
|
|
401
407
|
}
|
|
402
408
|
if (nil != [settings objectForKey:FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS]) {
|
|
@@ -427,7 +433,7 @@
|
|
|
427
433
|
NSError *error;
|
|
428
434
|
if (![FBConfiguration setScreenshotOrientation:(NSString *)[settings objectForKey:FB_SETTING_SCREENSHOT_ORIENTATION]
|
|
429
435
|
error:&error]) {
|
|
430
|
-
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.
|
|
436
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
431
437
|
traceback:nil]);
|
|
432
438
|
}
|
|
433
439
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
#import <WebDriverAgentLib/FBCommandHandler.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@interface FBVideoCommands : NSObject <FBCommandHandler>
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import "FBVideoCommands.h"
|
|
11
|
+
|
|
12
|
+
#import "FBRouteRequest.h"
|
|
13
|
+
#import "FBScreenRecordingContainer.h"
|
|
14
|
+
#import "FBScreenRecordingPromise.h"
|
|
15
|
+
#import "FBScreenRecordingRequest.h"
|
|
16
|
+
#import "FBSession.h"
|
|
17
|
+
#import "FBXCTestDaemonsProxy.h"
|
|
18
|
+
|
|
19
|
+
const NSUInteger DEFAULT_FPS = 24;
|
|
20
|
+
const NSUInteger DEFAULT_CODEC = 0;
|
|
21
|
+
|
|
22
|
+
@implementation FBVideoCommands
|
|
23
|
+
|
|
24
|
+
+ (NSArray *)routes
|
|
25
|
+
{
|
|
26
|
+
return
|
|
27
|
+
@[
|
|
28
|
+
[[FBRoute POST:@"/wda/video/start"] respondWithTarget:self action:@selector(handleStartVideoRecording:)],
|
|
29
|
+
[[FBRoute POST:@"/wda/video/stop"] respondWithTarget:self action:@selector(handleStopVideoRecording:)],
|
|
30
|
+
[[FBRoute GET:@"/wda/video"] respondWithTarget:self action:@selector(handleGetVideoRecording:)],
|
|
31
|
+
|
|
32
|
+
[[FBRoute POST:@"/wda/video/start"].withoutSession respondWithTarget:self action:@selector(handleStartVideoRecording:)],
|
|
33
|
+
[[FBRoute POST:@"/wda/video/stop"].withoutSession respondWithTarget:self action:@selector(handleStopVideoRecording:)],
|
|
34
|
+
[[FBRoute GET:@"/wda/video"].withoutSession respondWithTarget:self action:@selector(handleGetVideoRecording:)],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
+ (id<FBResponsePayload>)handleStartVideoRecording:(FBRouteRequest *)request
|
|
39
|
+
{
|
|
40
|
+
FBScreenRecordingPromise *activeScreenRecording = FBScreenRecordingContainer.sharedInstance.screenRecordingPromise;
|
|
41
|
+
if (nil != activeScreenRecording) {
|
|
42
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary] ?: [NSNull null]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
NSNumber *fps = (NSNumber *)request.arguments[@"fps"] ?: @(DEFAULT_FPS);
|
|
46
|
+
NSNumber *codec = (NSNumber *)request.arguments[@"codec"] ?: @(DEFAULT_CODEC);
|
|
47
|
+
FBScreenRecordingRequest *recordingRequest = [[FBScreenRecordingRequest alloc] initWithFps:fps.integerValue
|
|
48
|
+
codec:codec.longLongValue];
|
|
49
|
+
NSError *error;
|
|
50
|
+
FBScreenRecordingPromise* promise = [FBXCTestDaemonsProxy startScreenRecordingWithRequest:recordingRequest
|
|
51
|
+
error:&error];
|
|
52
|
+
if (nil == promise) {
|
|
53
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
54
|
+
return FBResponseWithUnknownError(error);
|
|
55
|
+
}
|
|
56
|
+
[FBScreenRecordingContainer.sharedInstance storeScreenRecordingPromise:promise
|
|
57
|
+
fps:fps.integerValue
|
|
58
|
+
codec:codec.longLongValue];
|
|
59
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
+ (id<FBResponsePayload>)handleStopVideoRecording:(FBRouteRequest *)request
|
|
63
|
+
{
|
|
64
|
+
FBScreenRecordingPromise *activeScreenRecording = FBScreenRecordingContainer.sharedInstance.screenRecordingPromise;
|
|
65
|
+
if (nil == activeScreenRecording) {
|
|
66
|
+
return FBResponseWithOK();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
NSUUID *recordingId = activeScreenRecording.identifier;
|
|
70
|
+
NSDictionary *response = [FBScreenRecordingContainer.sharedInstance toDictionary];
|
|
71
|
+
NSError *error;
|
|
72
|
+
if (![FBXCTestDaemonsProxy stopScreenRecordingWithUUID:recordingId error:&error]) {
|
|
73
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
74
|
+
return FBResponseWithUnknownError(error);
|
|
75
|
+
}
|
|
76
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
77
|
+
return FBResponseWithObject(response);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
+ (id<FBResponsePayload>)handleGetVideoRecording:(FBRouteRequest *)request
|
|
81
|
+
{
|
|
82
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary] ?: [NSNull null]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@end
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
} else if ([exception.name isEqualToString:FBTimeoutException]) {
|
|
46
46
|
commandStatus = [FBCommandStatus timeoutErrorWithMessage:exception.reason
|
|
47
47
|
traceback:traceback];
|
|
48
|
+
} else if ([exception.name isEqualToString:FBSessionCreationException]) {
|
|
49
|
+
commandStatus = [FBCommandStatus sessionNotCreatedError:exception.reason
|
|
50
|
+
traceback:traceback];
|
|
48
51
|
} else {
|
|
49
52
|
commandStatus = [FBCommandStatus unknownErrorWithMessage:exception.reason
|
|
50
53
|
traceback:traceback];
|
|
@@ -14,6 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
14
14
|
/*! Exception used to notify about missing session */
|
|
15
15
|
extern NSString *const FBSessionDoesNotExistException;
|
|
16
16
|
|
|
17
|
+
/*! Exception used to notify about session creation issues */
|
|
18
|
+
extern NSString *const FBSessionCreationException;
|
|
19
|
+
|
|
17
20
|
/*! Exception used to notify about application deadlock */
|
|
18
21
|
extern NSString *const FBApplicationDeadlockDetectedException;
|
|
19
22
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import "FBExceptions.h"
|
|
11
11
|
|
|
12
12
|
NSString *const FBInvalidArgumentException = @"FBInvalidArgumentException";
|
|
13
|
+
NSString *const FBSessionCreationException = @"FBSessionCreationException";
|
|
13
14
|
NSString *const FBSessionDoesNotExistException = @"FBSessionDoesNotExistException";
|
|
14
15
|
NSString *const FBApplicationDeadlockDetectedException = @"FBApplicationDeadlockDetectedException";
|
|
15
16
|
NSString *const FBElementAttributeUnknownException = @"FBElementAttributeUnknownException";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the BSD-style license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
8
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
@class FBScreenRecordingPromise;
|
|
16
|
+
|
|
17
|
+
@interface FBScreenRecordingContainer : NSObject
|
|
18
|
+
|
|
19
|
+
/** The amount of video FPS */
|
|
20
|
+
@property (readonly, nonatomic) NSUInteger fps;
|
|
21
|
+
/** Codec to use, where 0 is h264, 1 - HEVC */
|
|
22
|
+
@property (readonly, nonatomic) long long codec;
|
|
23
|
+
/** Keep the currently active screen resording promise. Equals to nil if no active screen recordings are running */
|
|
24
|
+
@property (readonly, nonatomic, nullable) FBScreenRecordingPromise* screenRecordingPromise;
|
|
25
|
+
/** The timestamp of the video startup as Unix float seconds */
|
|
26
|
+
@property (readonly, nonatomic, nullable) NSNumber *startedAt;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
@return singleton instance
|
|
30
|
+
*/
|
|
31
|
+
+ (instancetype)sharedInstance;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Keeps current screen recording promise
|
|
35
|
+
|
|
36
|
+
@param screenRecordingPromise a promise to set
|
|
37
|
+
@param fps FPS value
|
|
38
|
+
@param codec Codec value
|
|
39
|
+
*/
|
|
40
|
+
- (void)storeScreenRecordingPromise:(FBScreenRecordingPromise *)screenRecordingPromise
|
|
41
|
+
fps:(NSUInteger)fps
|
|
42
|
+
codec:(long long)codec;
|
|
43
|
+
/**
|
|
44
|
+
Resets the current screen recording promise
|
|
45
|
+
*/
|
|
46
|
+
- (void)reset;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Transforms the container content to a dictionary.
|
|
50
|
+
|
|
51
|
+
@return May return nil if no screen recording is currently running
|
|
52
|
+
*/
|
|
53
|
+
- (nullable NSDictionary *)toDictionary;
|
|
54
|
+
|
|
55
|
+
@end
|
|
56
|
+
|
|
57
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the BSD-style license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
8
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#import "FBScreenRecordingContainer.h"
|
|
12
|
+
|
|
13
|
+
#import "FBScreenRecordingPromise.h"
|
|
14
|
+
|
|
15
|
+
@interface FBScreenRecordingContainer ()
|
|
16
|
+
|
|
17
|
+
@property (readwrite) NSUInteger fps;
|
|
18
|
+
@property (readwrite) long long codec;
|
|
19
|
+
@property (readwrite) FBScreenRecordingPromise* screenRecordingPromise;
|
|
20
|
+
@property (readwrite) NSNumber *startedAt;
|
|
21
|
+
|
|
22
|
+
@end
|
|
23
|
+
|
|
24
|
+
@implementation FBScreenRecordingContainer
|
|
25
|
+
|
|
26
|
+
+ (instancetype)sharedInstance
|
|
27
|
+
{
|
|
28
|
+
static FBScreenRecordingContainer *instance;
|
|
29
|
+
static dispatch_once_t onceToken;
|
|
30
|
+
dispatch_once(&onceToken, ^{
|
|
31
|
+
instance = [[self alloc] init];
|
|
32
|
+
});
|
|
33
|
+
return instance;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)storeScreenRecordingPromise:(FBScreenRecordingPromise *)screenRecordingPromise
|
|
37
|
+
fps:(NSUInteger)fps
|
|
38
|
+
codec:(long long)codec;
|
|
39
|
+
{
|
|
40
|
+
self.fps = fps;
|
|
41
|
+
self.codec = codec;
|
|
42
|
+
self.screenRecordingPromise = screenRecordingPromise;
|
|
43
|
+
self.startedAt = @([NSDate.date timeIntervalSince1970]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)reset;
|
|
47
|
+
{
|
|
48
|
+
self.fps = 0;
|
|
49
|
+
self.codec = 0;
|
|
50
|
+
if (nil != self.screenRecordingPromise) {
|
|
51
|
+
[XCTContext runActivityNamed:@"Video Cleanup" block:^(id<XCTActivity> activity){
|
|
52
|
+
[activity addAttachment:(XCTAttachment *)self.screenRecordingPromise.nativePromise];
|
|
53
|
+
}];
|
|
54
|
+
self.screenRecordingPromise = nil;
|
|
55
|
+
}
|
|
56
|
+
self.startedAt = nil;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (nullable NSDictionary *)toDictionary
|
|
60
|
+
{
|
|
61
|
+
if (nil == self.screenRecordingPromise) {
|
|
62
|
+
return nil;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return @{
|
|
66
|
+
@"fps": @(self.fps),
|
|
67
|
+
@"codec": @(self.codec),
|
|
68
|
+
@"uuid": [self.screenRecordingPromise identifier].UUIDString ?: [NSNull null],
|
|
69
|
+
@"startedAt": self.startedAt ?: [NSNull null],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <XCTest/XCTest.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface FBScreenRecordingPromise : NSObject
|
|
15
|
+
|
|
16
|
+
/** Unique identiifier of the video recording, also used as the default file name */
|
|
17
|
+
@property (nonatomic, readonly) NSUUID *identifier;
|
|
18
|
+
/** Native screen recording promise */
|
|
19
|
+
@property (nonatomic, readonly) id nativePromise;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Creates a wrapper object for a native screen recording promise
|
|
23
|
+
|
|
24
|
+
@param promise Native promise object to be wrapped
|
|
25
|
+
*/
|
|
26
|
+
- (instancetype)initWithNativePromise:(id)promise;
|
|
27
|
+
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
NS_ASSUME_NONNULL_END
|