forked from kishikawakatsumi/JavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSBCoreLocationTest.m
More file actions
67 lines (48 loc) · 1.8 KB
/
JSBCoreLocationTest.m
File metadata and controls
67 lines (48 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#import <XCTest/XCTest.h>
#import "JavaScriptBridge.h"
@import JavaScriptCore;
@interface JSBCoreLocationTests : XCTestCase
@end
@implementation JSBCoreLocationTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testInstantiation
{
JSContext *context = [[JSContext alloc] init];
[context addScriptingSupport:@"CoreLocation"];
JSValue *value = nil;
[context evaluateScript:@"var clbeacon = CLBeacon.new();"];
value = context[@"clbeacon"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clgeocoder = CLGeocoder.new();"];
value = context[@"clgeocoder"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clheading = CLHeading.new();"];
value = context[@"clheading"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var cllocation = CLLocation.new();"];
value = context[@"cllocation"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var cllocationmanager = CLLocationManager.new();"];
value = context[@"cllocationmanager"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clplacemark = CLPlacemark.new();"];
value = context[@"clplacemark"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clregion = CLRegion.new();"];
value = context[@"clregion"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clbeaconregion = CLBeaconRegion.new();"];
value = context[@"clbeaconregion"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var clcircularregion = CLCircularRegion.new();"];
value = context[@"clcircularregion"];
XCTAssertTrue(value && !value.isUndefined);
}
@end