appium-webdriveragent 3.9.2 → 3.12.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.
Files changed (65) hide show
  1. package/PrivateHeaders/.DS_Store +0 -0
  2. package/PrivateHeaders/XCTest/XCTestManager_ManagerInterface-Protocol.h +3 -0
  3. package/README.md +0 -1
  4. package/WebDriverAgent.xcodeproj/project.pbxproj +56 -56
  5. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/elf.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  6. package/WebDriverAgent.xcodeproj/xcuserdata/elf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +51 -0
  7. package/WebDriverAgent.xcodeproj/xcuserdata/{kazuaki.xcuserdatad → elf.xcuserdatad}/xcschemes/xcschememanagement.plist +23 -8
  8. package/WebDriverAgentLib/.DS_Store +0 -0
  9. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +0 -17
  10. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +0 -16
  11. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +28 -14
  12. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.h +37 -0
  13. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +51 -0
  14. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +8 -2
  15. package/WebDriverAgentLib/Commands/FBElementCommands.m +3 -1
  16. package/WebDriverAgentLib/Commands/FBOrientationCommands.m +20 -9
  17. package/WebDriverAgentLib/Commands/FBSessionCommands.m +119 -99
  18. package/WebDriverAgentLib/FBApplication.m +1 -1
  19. package/WebDriverAgentLib/Routing/FBElementCache.m +42 -11
  20. package/WebDriverAgentLib/Routing/FBResponsePayload.m +9 -3
  21. package/WebDriverAgentLib/Routing/FBSession.h +6 -0
  22. package/WebDriverAgentLib/Routing/FBSession.m +45 -55
  23. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.h +1 -3
  24. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +6 -13
  25. package/WebDriverAgentLib/Utilities/FBCapabilities.h +23 -0
  26. package/WebDriverAgentLib/Utilities/FBCapabilities.m +23 -0
  27. package/WebDriverAgentLib/Utilities/FBConfiguration.m +6 -1
  28. package/WebDriverAgentLib/Utilities/FBScreenshot.m +125 -14
  29. package/WebDriverAgentLib/Utilities/FBSettings.h +23 -23
  30. package/WebDriverAgentLib/Utilities/FBSettings.m +23 -23
  31. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +16 -0
  32. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +16 -0
  33. package/WebDriverAgentLib/Utilities/FBXPath.m +15 -44
  34. package/WebDriverAgentLib/Utilities/LRUCache/.DS_Store +0 -0
  35. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.h +59 -0
  36. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.m +104 -0
  37. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.h +43 -0
  38. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.m +59 -0
  39. package/WebDriverAgentLib/Vendor/.DS_Store +0 -0
  40. package/WebDriverAgentRunner/.DS_Store +0 -0
  41. package/WebDriverAgentRunner-Runner.app.zip +0 -0
  42. package/WebDriverAgentTests/IntegrationApp/Resources/.DS_Store +0 -0
  43. package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +20 -16
  44. package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +2 -1
  45. package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +11 -0
  46. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.h +3 -0
  47. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.m +15 -0
  48. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +1 -0
  49. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +1 -0
  50. package/WebDriverAgentTests/UnitTests/FBSessionTests.m +11 -1
  51. package/WebDriverAgentTests/UnitTests/FBXPathTests.m +3 -1
  52. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +1 -0
  53. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +1 -0
  54. package/package.json +3 -3
  55. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  56. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/WorkspaceSettings.xcsettings +0 -20
  57. package/WebDriverAgent.xcodeproj/xcuserdata/kazuaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -906
  58. package/WebDriverAgentLib/Vendor/YYCache/YYCache.h +0 -206
  59. package/WebDriverAgentLib/Vendor/YYCache/YYCache.m +0 -140
  60. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.h +0 -412
  61. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.m +0 -462
  62. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.h +0 -325
  63. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.m +0 -1068
  64. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.h +0 -213
  65. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.m +0 -508
@@ -1,412 +0,0 @@
1
- //
2
- // YYDiskCache.h
3
- // YYCache <https://github.com/ibireme/YYCache>
4
- //
5
- // Created by ibireme on 15/2/11.
6
- // Copyright (c) 2015 ibireme.
7
- //
8
- // This source code is licensed under the MIT-style license found in the
9
- // LICENSE file in the root directory of this source tree.
10
- //
11
-
12
- #import <Foundation/Foundation.h>
13
-
14
- NS_ASSUME_NONNULL_BEGIN
15
-
16
- /**
17
- YYDiskCache is a thread-safe cache that stores key-value pairs backed by SQLite
18
- and file system (similar to NSURLCache's disk cache).
19
-
20
- YYDiskCache has these features:
21
-
22
- * It use LRU (least-recently-used) to remove objects.
23
- * It can be controlled by cost, count, and age.
24
- * It can be configured to automatically evict objects when there's no free disk space.
25
- * It can automatically decide the storage type (sqlite/file) for each object to get
26
- better performance.
27
-
28
- You may compile the latest version of sqlite and ignore the libsqlite3.dylib in
29
- iOS system to get 2x~4x speed up.
30
- */
31
- @interface YYDiskCache : NSObject
32
-
33
- #pragma mark - Attribute
34
- ///=============================================================================
35
- /// @name Attribute
36
- ///=============================================================================
37
-
38
- /** The name of the cache. Default is nil. */
39
- @property (nullable, copy) NSString *name;
40
-
41
- /** The path of the cache (read-only). */
42
- @property (readonly) NSString *path;
43
-
44
- /**
45
- If the object's data size (in bytes) is larger than this value, then object will
46
- be stored as a file, otherwise the object will be stored in sqlite.
47
-
48
- 0 means all objects will be stored as separated files, NSUIntegerMax means all
49
- objects will be stored in sqlite.
50
-
51
- The default value is 20480 (20KB).
52
- */
53
- @property (readonly) NSUInteger inlineThreshold;
54
-
55
- /**
56
- If this block is not nil, then the block will be used to archive object instead
57
- of NSKeyedArchiver. You can use this block to support the objects which do not
58
- conform to the `NSCoding` protocol.
59
-
60
- The default value is nil.
61
- */
62
- @property (nullable, copy) NSData *(^customArchiveBlock)(id object);
63
-
64
- /**
65
- If this block is not nil, then the block will be used to unarchive object instead
66
- of NSKeyedUnarchiver. You can use this block to support the objects which do not
67
- conform to the `NSCoding` protocol.
68
-
69
- The default value is nil.
70
- */
71
- @property (nullable, copy) id (^customUnarchiveBlock)(NSData *data);
72
-
73
- /**
74
- When an object needs to be saved as a file, this block will be invoked to generate
75
- a file name for a specified key. If the block is nil, the cache use md5(key) as
76
- default file name.
77
-
78
- The default value is nil.
79
- */
80
- @property (nullable, copy) NSString *(^customFileNameBlock)(NSString *key);
81
-
82
-
83
-
84
- #pragma mark - Limit
85
- ///=============================================================================
86
- /// @name Limit
87
- ///=============================================================================
88
-
89
- /**
90
- The maximum number of objects the cache should hold.
91
-
92
- @discussion The default value is NSUIntegerMax, which means no limit.
93
- This is not a strict limit — if the cache goes over the limit, some objects in the
94
- cache could be evicted later in background queue.
95
- */
96
- @property NSUInteger countLimit;
97
-
98
- /**
99
- The maximum total cost that the cache can hold before it starts evicting objects.
100
-
101
- @discussion The default value is NSUIntegerMax, which means no limit.
102
- This is not a strict limit — if the cache goes over the limit, some objects in the
103
- cache could be evicted later in background queue.
104
- */
105
- @property NSUInteger costLimit;
106
-
107
- /**
108
- The maximum expiry time of objects in cache.
109
-
110
- @discussion The default value is DBL_MAX, which means no limit.
111
- This is not a strict limit — if an object goes over the limit, the objects could
112
- be evicted later in background queue.
113
- */
114
- @property NSTimeInterval ageLimit;
115
-
116
- /**
117
- The minimum free disk space (in bytes) which the cache should kept.
118
-
119
- @discussion The default value is 0, which means no limit.
120
- If the free disk space is lower than this value, the cache will remove objects
121
- to free some disk space. This is not a strict limit—if the free disk space goes
122
- over the limit, the objects could be evicted later in background queue.
123
- */
124
- @property NSUInteger freeDiskSpaceLimit;
125
-
126
- /**
127
- The auto trim check time interval in seconds. Default is 60 (1 minute).
128
-
129
- @discussion The cache holds an internal timer to check whether the cache reaches
130
- its limits, and if the limit is reached, it begins to evict objects.
131
- */
132
- @property NSTimeInterval autoTrimInterval;
133
-
134
- /**
135
- Set `YES` to enable error logs for debug.
136
- */
137
- @property (atomic) BOOL errorLogsEnabled;
138
-
139
- #pragma mark - Initializer
140
- ///=============================================================================
141
- /// @name Initializer
142
- ///=============================================================================
143
- - (instancetype)init UNAVAILABLE_ATTRIBUTE;
144
- + (instancetype)new UNAVAILABLE_ATTRIBUTE;
145
-
146
- /**
147
- Create a new cache based on the specified path.
148
-
149
- @param path Full path of a directory in which the cache will write data.
150
- Once initialized you should not read and write to this directory.
151
-
152
- @return A new cache object, or nil if an error occurs.
153
-
154
- @warning If the cache instance for the specified path already exists in memory,
155
- this method will return it directly, instead of creating a new instance.
156
- */
157
- - (nullable instancetype)initWithPath:(NSString *)path;
158
-
159
- /**
160
- The designated initializer.
161
-
162
- @param path Full path of a directory in which the cache will write data.
163
- Once initialized you should not read and write to this directory.
164
-
165
- @param threshold The data store inline threshold in bytes. If the object's data
166
- size (in bytes) is larger than this value, then object will be stored as a
167
- file, otherwise the object will be stored in sqlite. 0 means all objects will
168
- be stored as separated files, NSUIntegerMax means all objects will be stored
169
- in sqlite. If you don't know your object's size, 20480 is a good choice.
170
- After first initialized you should not change this value of the specified path.
171
-
172
- @return A new cache object, or nil if an error occurs.
173
-
174
- @warning If the cache instance for the specified path already exists in memory,
175
- this method will return it directly, instead of creating a new instance.
176
- */
177
- - (nullable instancetype)initWithPath:(NSString *)path
178
- inlineThreshold:(NSUInteger)threshold NS_DESIGNATED_INITIALIZER;
179
-
180
-
181
- #pragma mark - Access Methods
182
- ///=============================================================================
183
- /// @name Access Methods
184
- ///=============================================================================
185
-
186
- /**
187
- Returns a boolean value that indicates whether a given key is in cache.
188
- This method may blocks the calling thread until file read finished.
189
-
190
- @param key A string identifying the value. If nil, just return NO.
191
- @return Whether the key is in cache.
192
- */
193
- - (BOOL)containsObjectForKey:(NSString *)key;
194
-
195
- /**
196
- Returns a boolean value with the block that indicates whether a given key is in cache.
197
- This method returns immediately and invoke the passed block in background queue
198
- when the operation finished.
199
-
200
- @param key A string identifying the value. If nil, just return NO.
201
- @param block A block which will be invoked in background queue when finished.
202
- */
203
- - (void)containsObjectForKey:(NSString *)key withBlock:(void(^)(NSString *key, BOOL contains))block;
204
-
205
- /**
206
- Returns the value associated with a given key.
207
- This method may blocks the calling thread until file read finished.
208
-
209
- @param key A string identifying the value. If nil, just return nil.
210
- @return The value associated with key, or nil if no value is associated with key.
211
- */
212
- - (nullable id<NSCoding>)objectForKey:(NSString *)key;
213
-
214
- /**
215
- Returns the value associated with a given key.
216
- This method returns immediately and invoke the passed block in background queue
217
- when the operation finished.
218
-
219
- @param key A string identifying the value. If nil, just return nil.
220
- @param block A block which will be invoked in background queue when finished.
221
- */
222
- - (void)objectForKey:(NSString *)key withBlock:(void(^)(NSString *key, id<NSCoding> _Nullable object))block;
223
-
224
- /**
225
- Sets the value of the specified key in the cache.
226
- This method may blocks the calling thread until file write finished.
227
-
228
- @param object The object to be stored in the cache. If nil, it calls `removeObjectForKey:`.
229
- @param key The key with which to associate the value. If nil, this method has no effect.
230
- */
231
- - (void)setObject:(nullable id<NSCoding>)object forKey:(NSString *)key;
232
-
233
- /**
234
- Sets the value of the specified key in the cache.
235
- This method returns immediately and invoke the passed block in background queue
236
- when the operation finished.
237
-
238
- @param object The object to be stored in the cache. If nil, it calls `removeObjectForKey:`.
239
- @param block A block which will be invoked in background queue when finished.
240
- */
241
- - (void)setObject:(nullable id<NSCoding>)object forKey:(NSString *)key withBlock:(void(^)(void))block;
242
-
243
- /**
244
- Removes the value of the specified key in the cache.
245
- This method may blocks the calling thread until file delete finished.
246
-
247
- @param key The key identifying the value to be removed. If nil, this method has no effect.
248
- */
249
- - (void)removeObjectForKey:(NSString *)key;
250
-
251
- /**
252
- Removes the value of the specified key in the cache.
253
- This method returns immediately and invoke the passed block in background queue
254
- when the operation finished.
255
-
256
- @param key The key identifying the value to be removed. If nil, this method has no effect.
257
- @param block A block which will be invoked in background queue when finished.
258
- */
259
- - (void)removeObjectForKey:(NSString *)key withBlock:(void(^)(NSString *key))block;
260
-
261
- /**
262
- Empties the cache.
263
- This method may blocks the calling thread until file delete finished.
264
- */
265
- - (void)removeAllObjects;
266
-
267
- /**
268
- Empties the cache.
269
- This method returns immediately and invoke the passed block in background queue
270
- when the operation finished.
271
-
272
- @param block A block which will be invoked in background queue when finished.
273
- */
274
- - (void)removeAllObjectsWithBlock:(void(^)(void))block;
275
-
276
- /**
277
- Empties the cache with block.
278
- This method returns immediately and executes the clear operation with block in background.
279
-
280
- @warning You should not send message to this instance in these blocks.
281
- @param progress This block will be invoked during removing, pass nil to ignore.
282
- @param end This block will be invoked at the end, pass nil to ignore.
283
- */
284
- - (void)removeAllObjectsWithProgressBlock:(nullable void(^)(int removedCount, int totalCount))progress
285
- endBlock:(nullable void(^)(BOOL error))end;
286
-
287
-
288
- /**
289
- Returns the number of objects in this cache.
290
- This method may blocks the calling thread until file read finished.
291
-
292
- @return The total objects count.
293
- */
294
- - (NSInteger)totalCount;
295
-
296
- /**
297
- Get the number of objects in this cache.
298
- This method returns immediately and invoke the passed block in background queue
299
- when the operation finished.
300
-
301
- @param block A block which will be invoked in background queue when finished.
302
- */
303
- - (void)totalCountWithBlock:(void(^)(NSInteger totalCount))block;
304
-
305
- /**
306
- Returns the total cost (in bytes) of objects in this cache.
307
- This method may blocks the calling thread until file read finished.
308
-
309
- @return The total objects cost in bytes.
310
- */
311
- - (NSInteger)totalCost;
312
-
313
- /**
314
- Get the total cost (in bytes) of objects in this cache.
315
- This method returns immediately and invoke the passed block in background queue
316
- when the operation finished.
317
-
318
- @param block A block which will be invoked in background queue when finished.
319
- */
320
- - (void)totalCostWithBlock:(void(^)(NSInteger totalCost))block;
321
-
322
-
323
- #pragma mark - Trim
324
- ///=============================================================================
325
- /// @name Trim
326
- ///=============================================================================
327
-
328
- /**
329
- Removes objects from the cache use LRU, until the `totalCount` is below the specified value.
330
- This method may blocks the calling thread until operation finished.
331
-
332
- @param count The total count allowed to remain after the cache has been trimmed.
333
- */
334
- - (void)trimToCount:(NSUInteger)count;
335
-
336
- /**
337
- Removes objects from the cache use LRU, until the `totalCount` is below the specified value.
338
- This method returns immediately and invoke the passed block in background queue
339
- when the operation finished.
340
-
341
- @param count The total count allowed to remain after the cache has been trimmed.
342
- @param block A block which will be invoked in background queue when finished.
343
- */
344
- - (void)trimToCount:(NSUInteger)count withBlock:(void(^)(void))block;
345
-
346
- /**
347
- Removes objects from the cache use LRU, until the `totalCost` is below the specified value.
348
- This method may blocks the calling thread until operation finished.
349
-
350
- @param cost The total cost allowed to remain after the cache has been trimmed.
351
- */
352
- - (void)trimToCost:(NSUInteger)cost;
353
-
354
- /**
355
- Removes objects from the cache use LRU, until the `totalCost` is below the specified value.
356
- This method returns immediately and invoke the passed block in background queue
357
- when the operation finished.
358
-
359
- @param cost The total cost allowed to remain after the cache has been trimmed.
360
- @param block A block which will be invoked in background queue when finished.
361
- */
362
- - (void)trimToCost:(NSUInteger)cost withBlock:(void(^)(void))block;
363
-
364
- /**
365
- Removes objects from the cache use LRU, until all expiry objects removed by the specified value.
366
- This method may blocks the calling thread until operation finished.
367
-
368
- @param age The maximum age of the object.
369
- */
370
- - (void)trimToAge:(NSTimeInterval)age;
371
-
372
- /**
373
- Removes objects from the cache use LRU, until all expiry objects removed by the specified value.
374
- This method returns immediately and invoke the passed block in background queue
375
- when the operation finished.
376
-
377
- @param age The maximum age of the object.
378
- @param block A block which will be invoked in background queue when finished.
379
- */
380
- - (void)trimToAge:(NSTimeInterval)age withBlock:(void(^)(void))block;
381
-
382
-
383
- #pragma mark - Extended Data
384
- ///=============================================================================
385
- /// @name Extended Data
386
- ///=============================================================================
387
-
388
- /**
389
- Get extended data from an object.
390
-
391
- @discussion See 'setExtendedData:toObject:' for more information.
392
-
393
- @param object An object.
394
- @return The extended data.
395
- */
396
- + (nullable NSData *)getExtendedDataFromObject:(id)object;
397
-
398
- /**
399
- Set extended data to an object.
400
-
401
- @discussion You can set any extended data to an object before you save the object
402
- to disk cache. The extended data will also be saved with this object. You can get
403
- the extended data later with "getExtendedDataFromObject:".
404
-
405
- @param extendedData The extended data (pass nil to remove).
406
- @param object The object.
407
- */
408
- + (void)setExtendedData:(nullable NSData *)extendedData toObject:(id)object;
409
-
410
- @end
411
-
412
- NS_ASSUME_NONNULL_END