forked from kishikawakatsumi/JavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSBOpenGLESTest.m
More file actions
43 lines (30 loc) · 890 Bytes
/
JSBOpenGLESTest.m
File metadata and controls
43 lines (30 loc) · 890 Bytes
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
#import <XCTest/XCTest.h>
#import "JavaScriptBridge.h"
@import JavaScriptCore;
@interface JSBOpenGLESTests : XCTestCase
@end
@implementation JSBOpenGLESTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testInstantiation
{
JSContext *context = [[JSContext alloc] init];
[context addScriptingSupport:@"OpenGLES"];
JSValue *value = nil;
[context evaluateScript:@"var eaglsharegroup = EAGLSharegroup.alloc();"];
value = context[@"eaglsharegroup"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var eaglcontext = EAGLContext.new();"];
value = context[@"eaglcontext"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var eaglcontext = EAGLContext.new();"];
value = context[@"eaglcontext"];
XCTAssertTrue(value && !value.isUndefined);
}
@end