blob: dd34a667f80c1a3bb70833761aa39657f5237b15 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngineGroup.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Test.h"
FLUTTER_ASSERT_ARC
@interface FlutterEngineGroupTest : XCTestCase
@end
@implementation FlutterEngineGroupTest
- (void)testMake {
FlutterEngineGroup* group = [[FlutterEngineGroup alloc] initWithName:@"foo" project:nil];
FlutterEngine* engine = [group makeEngineWithEntrypoint:nil libraryURI:nil];
XCTAssertNotNil(engine);
}
- (void)testSpawn {
FlutterEngineGroup* group = [[FlutterEngineGroup alloc] initWithName:@"foo" project:nil];
FlutterEngine* spawner = [group makeEngineWithEntrypoint:nil libraryURI:nil];
FlutterEngine* spawnee = [group makeEngineWithEntrypoint:nil libraryURI:nil];
XCTAssertNotNil(spawner);
XCTAssertNotNil(spawnee);
XCTAssertEqual(&spawner.threadHost, &spawnee.threadHost);
}
- (void)testDeleteLastEngine {
FlutterEngineGroup* group = [[FlutterEngineGroup alloc] initWithName:@"foo" project:nil];
@autoreleasepool {
FlutterEngine* spawner = [group makeEngineWithEntrypoint:nil libraryURI:nil];
XCTAssertNotNil(spawner);
}
FlutterEngine* spawnee = [group makeEngineWithEntrypoint:nil libraryURI:nil];
XCTAssertNotNil(spawnee);
}
@end