Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
e2289396
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e2289396
编写于
8月 12, 2019
作者:
D
Dan Field
提交者:
GitHub
8月 12, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Expose isolateId for engine (#10823)
上级
a18fa372
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
0 deletion
+52
-0
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
+7
-0
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
+10
-0
testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj
...rio_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj
+4
-0
testing/scenario_app/ios/Scenarios/ScenariosTests/FlutterEngineTest.m
...ario_app/ios/Scenarios/ScenariosTests/FlutterEngineTest.m
+31
-0
未找到文件。
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
浏览文件 @
e2289396
...
...
@@ -242,6 +242,13 @@ FLUTTER_EXPORT
*/
@property
(
nonatomic
,
readonly
)
NSObject
<
FlutterBinaryMessenger
>*
binaryMessenger
;
/**
* The UI Isolate ID of of the engine.
*
* This property will be nil if the engine is not running.
*/
@property
(
nonatomic
,
readonly
,
copy
)
NSString
*
isolateId
;
@end
#endif // FLUTTER_FLUTTERENGINE_H_
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
浏览文件 @
e2289396
...
...
@@ -31,6 +31,8 @@
// Maintains a dictionary of plugin names that have registered with the engine. Used by
// FlutterEngineRegistrar to implement a FlutterPluginRegistrar.
@property
(
nonatomic
,
readonly
)
NSMutableDictionary
*
pluginPublications
;
@property
(
nonatomic
,
readwrite
,
copy
)
NSString
*
isolateId
;
@end
@interface
FlutterEngineRegistrar
:
NSObject
<
FlutterPluginRegistrar
>
...
...
@@ -171,6 +173,7 @@
-
(
void
)
destroyContext
{
[
self
resetChannels
];
self
.
isolateId
=
nil
;
_shell
.
reset
();
_threadHost
.
Reset
();
_platformViewsController
.
reset
();
...
...
@@ -233,6 +236,13 @@
// Channels get a reference to the engine, and therefore need manual
// cleanup for proper collection.
-
(
void
)
setupChannels
{
// This will be invoked once the shell is done setting up and the isolate ID
// for the UI isolate is available.
[
_binaryMessenger
setMessageHandlerOnChannel
:
@"flutter/isolate"
binaryMessageHandler:
^
(
NSData
*
message
,
FlutterBinaryReply
reply
)
{
self
.
isolateId
=
[[
FlutterStringCodec
sharedInstance
]
decode
:
message
];
}];
_localizationChannel
.
reset
([[
FlutterMethodChannel
alloc
]
initWithName:
@"flutter/localization"
binaryMessenger:
self
.
binaryMessenger
...
...
testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj
浏览文件 @
e2289396
...
...
@@ -23,6 +23,7 @@
248D76DA22E388380012F0C1
/* main.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
248D76D922E388380012F0C1
/* main.m */
;
};
248D76E422E388380012F0C1
/* ScenariosTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
248D76E322E388380012F0C1
/* ScenariosTests.m */
;
};
248D76EF22E388380012F0C1
/* ScenariosUITests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
248D76EE22E388380012F0C1
/* ScenariosUITests.m */
;
};
248FDFC422FE7CD0009CC7CD
/* FlutterEngineTest.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
248FDFC322FE7CD0009CC7CD
/* FlutterEngineTest.m */
;
};
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
...
...
@@ -95,6 +96,7 @@
248D76EA22E388380012F0C1
/* ScenariosUITests.xctest */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.cfbundle
;
includeInIndex
=
0
;
path
=
ScenariosUITests.xctest
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
248D76EE22E388380012F0C1
/* ScenariosUITests.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ScenariosUITests.m
;
sourceTree
=
"<group>"
;
};
248D76F022E388380012F0C1
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
248FDFC322FE7CD0009CC7CD
/* FlutterEngineTest.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FlutterEngineTest.m
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -162,6 +164,7 @@
248D76E222E388380012F0C1
/* ScenariosTests */
=
{
isa
=
PBXGroup
;
children
=
(
248FDFC322FE7CD0009CC7CD
/* FlutterEngineTest.m */
,
0DB781FC22EA2C0300E9B371
/* FlutterViewControllerTest.m */
,
248D76E322E388380012F0C1
/* ScenariosTests.m */
,
248D76E522E388380012F0C1
/* Info.plist */
,
...
...
@@ -329,6 +332,7 @@
files
=
(
248D76E422E388380012F0C1
/* ScenariosTests.m in Sources */
,
0DB7820222EA493B00E9B371
/* FlutterViewControllerTest.m in Sources */
,
248FDFC422FE7CD0009CC7CD
/* FlutterEngineTest.m in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
testing/scenario_app/ios/Scenarios/ScenariosTests/FlutterEngineTest.m
0 → 100644
浏览文件 @
e2289396
// 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 <Flutter/Flutter.h>
#import <XCTest/XCTest.h>
#import "AppDelegate.h"
@interface
FlutterEngineTest
:
XCTestCase
@end
@implementation
FlutterEngineTest
-
(
void
)
testIsolateId
{
FlutterEngine
*
engine
=
[[
FlutterEngine
alloc
]
initWithName
:
@"test"
project
:
nil
];
XCTAssertNil
(
engine
.
isolateId
);
[
self
keyValueObservingExpectationForObject
:
engine
keyPath
:
@"isolateId"
handler
:
nil
];
XCTAssertTrue
([
engine
runWithEntrypoint
:
nil
]);
[
self
waitForExpectationsWithTimeout
:
30
.
0
handler
:
nil
];
XCTAssertNotNil
(
engine
.
isolateId
);
XCTAssertTrue
([
engine
.
isolateId
hasPrefix
:
@"isolates/"
]);
[
engine
destroyContext
];
XCTAssertNil
(
engine
.
isolateId
);
}
@end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录