Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
2e4f0a4a
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
未验证
提交
2e4f0a4a
编写于
4月 20, 2019
作者:
C
Chinmay Garde
提交者:
GitHub
4月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Put the testing lib in the flutter namespace. (#8661)
上级
1239df96
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
122 addition
and
94 deletion
+122
-94
runtime/dart_isolate_unittests.cc
runtime/dart_isolate_unittests.cc
+17
-17
runtime/runtime_test.cc
runtime/runtime_test.cc
+3
-3
runtime/runtime_test.h
runtime/runtime_test.h
+2
-2
shell/common/shell_test.cc
shell/common/shell_test.cc
+29
-4
shell/common/shell_test.h
shell/common/shell_test.h
+25
-2
shell/common/shell_unittests.cc
shell/common/shell_unittests.cc
+23
-55
shell/platform/embedder/tests/embedder_a11y_unittests.cc
shell/platform/embedder/tests/embedder_a11y_unittests.cc
+1
-1
shell/platform/embedder/tests/embedder_context.cc
shell/platform/embedder/tests/embedder_context.cc
+3
-3
shell/platform/embedder/tests/embedder_context.h
shell/platform/embedder/tests/embedder_context.h
+1
-1
shell/platform/embedder/tests/embedder_test.cc
shell/platform/embedder/tests/embedder_test.cc
+1
-1
testing/build/gen_fixtures_location_symbol.py
testing/build/gen_fixtures_location_symbol.py
+1
-1
testing/run_all_unittests.cc
testing/run_all_unittests.cc
+1
-1
testing/test_dart_native_resolver.cc
testing/test_dart_native_resolver.cc
+2
-0
testing/test_dart_native_resolver.h
testing/test_dart_native_resolver.h
+3
-1
testing/testing.cc
testing/testing.cc
+3
-1
testing/testing.h
testing/testing.h
+2
-0
testing/thread_test.cc
testing/thread_test.cc
+2
-0
testing/thread_test.h
testing/thread_test.h
+3
-1
未找到文件。
runtime/dart_isolate_unittests.cc
浏览文件 @
2e4f0a4a
...
...
@@ -29,7 +29,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) {
ASSERT_TRUE
(
vm_ref
);
auto
vm_data
=
vm_ref
.
GetVMData
();
ASSERT_TRUE
(
vm_data
);
TaskRunners
task_runners
(
::
testing
::
GetCurrentTestName
(),
//
TaskRunners
task_runners
(
GetCurrentTestName
(),
//
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
(),
//
...
...
@@ -62,7 +62,7 @@ TEST_F(DartIsolateTest, IsolateShutdownCallbackIsInIsolateScope) {
ASSERT_TRUE
(
vm_ref
);
auto
vm_data
=
vm_ref
.
GetVMData
();
ASSERT_TRUE
(
vm_data
);
TaskRunners
task_runners
(
::
testing
::
GetCurrentTestName
(),
//
TaskRunners
task_runners
(
GetCurrentTestName
(),
//
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
(),
//
...
...
@@ -164,7 +164,7 @@ static void RunDartCodeInIsolate(DartVMRef& vm_ref,
return
;
}
TaskRunners
task_runners
(
::
testing
::
GetCurrentTestName
(),
//
TaskRunners
task_runners
(
GetCurrentTestName
(),
//
task_runner
,
//
task_runner
,
//
task_runner
,
//
...
...
@@ -206,8 +206,8 @@ static void RunDartCodeInIsolate(DartVMRef& vm_ref,
}
if
(
!
DartVM
::
IsRunningPrecompiledCode
())
{
auto
kernel_file_path
=
fml
::
paths
::
JoinPaths
(
{
::
testing
::
GetFixturesPath
(),
"kernel_blob.bin"
});
auto
kernel_file_path
=
fml
::
paths
::
JoinPaths
({
GetFixturesPath
(),
"kernel_blob.bin"
});
if
(
!
fml
::
IsFile
(
kernel_file_path
))
{
FML_LOG
(
ERROR
)
<<
"Could not locate kernel file."
;
...
...
runtime/runtime_test.cc
浏览文件 @
2e4f0a4a
...
...
@@ -11,7 +11,7 @@ namespace flutter {
namespace
testing
{
RuntimeTest
::
RuntimeTest
()
:
native_resolver_
(
std
::
make_shared
<
::
testing
::
TestDartNativeResolver
>
())
{}
:
native_resolver_
(
std
::
make_shared
<
TestDartNativeResolver
>
())
{}
RuntimeTest
::~
RuntimeTest
()
=
default
;
...
...
@@ -69,8 +69,8 @@ Settings RuntimeTest::CreateSettingsForFixture() {
// |testing::ThreadTest|
void
RuntimeTest
::
SetUp
()
{
assets_dir_
=
fml
::
OpenDirectory
(
::
testing
::
GetFixturesPath
(),
false
,
fml
::
FilePermission
::
kRead
);
assets_dir_
=
fml
::
OpenDirectory
(
GetFixturesPath
(),
false
,
fml
::
FilePermission
::
kRead
);
ThreadTest
::
SetUp
();
}
...
...
runtime/runtime_test.h
浏览文件 @
2e4f0a4a
...
...
@@ -15,7 +15,7 @@
namespace
flutter
{
namespace
testing
{
class
RuntimeTest
:
public
::
testing
::
ThreadTest
{
class
RuntimeTest
:
public
ThreadTest
{
public:
RuntimeTest
();
...
...
@@ -34,7 +34,7 @@ class RuntimeTest : public ::testing::ThreadTest {
private:
fml
::
UniqueFD
assets_dir_
;
std
::
shared_ptr
<
::
testing
::
TestDartNativeResolver
>
native_resolver_
;
std
::
shared_ptr
<
TestDartNativeResolver
>
native_resolver_
;
void
SetSnapshotsAndAssets
(
Settings
&
settings
);
};
...
...
shell/common/shell_test.cc
浏览文件 @
2e4f0a4a
...
...
@@ -14,7 +14,7 @@ namespace flutter {
namespace
testing
{
ShellTest
::
ShellTest
()
:
native_resolver_
(
std
::
make_shared
<
::
testing
::
TestDartNativeResolver
>
())
{}
:
native_resolver_
(
std
::
make_shared
<
TestDartNativeResolver
>
())
{}
ShellTest
::~
ShellTest
()
=
default
;
...
...
@@ -87,10 +87,10 @@ TaskRunners ShellTest::GetTaskRunnersForFixture() {
// |testing::ThreadTest|
void
ShellTest
::
SetUp
()
{
ThreadTest
::
SetUp
();
assets_dir_
=
fml
::
OpenDirectory
(
::
testing
::
GetFixturesPath
(),
false
,
fml
::
FilePermission
::
kRead
);
assets_dir_
=
fml
::
OpenDirectory
(
GetFixturesPath
(),
false
,
fml
::
FilePermission
::
kRead
);
thread_host_
=
std
::
make_unique
<
ThreadHost
>
(
"io.flutter.test."
+
::
testing
::
GetCurrentTestName
()
+
"."
,
"io.flutter.test."
+
GetCurrentTestName
()
+
"."
,
ThreadHost
::
Type
::
Platform
|
ThreadHost
::
Type
::
IO
|
ThreadHost
::
Type
::
UI
|
ThreadHost
::
Type
::
GPU
);
}
...
...
@@ -107,5 +107,30 @@ void ShellTest::AddNativeCallback(std::string name,
native_resolver_
->
AddNativeCallback
(
std
::
move
(
name
),
callback
);
}
ShellTestPlatformView
::
ShellTestPlatformView
(
PlatformView
::
Delegate
&
delegate
,
TaskRunners
task_runners
)
:
PlatformView
(
delegate
,
std
::
move
(
task_runners
))
{}
ShellTestPlatformView
::~
ShellTestPlatformView
()
=
default
;
// |PlatformView|
std
::
unique_ptr
<
Surface
>
ShellTestPlatformView
::
CreateRenderingSurface
()
{
return
std
::
make_unique
<
GPUSurfaceSoftware
>
(
this
);
}
// |GPUSurfaceSoftwareDelegate|
sk_sp
<
SkSurface
>
ShellTestPlatformView
::
AcquireBackingStore
(
const
SkISize
&
size
)
{
SkImageInfo
image_info
=
SkImageInfo
::
MakeN32Premul
(
size
.
width
(),
size
.
height
(),
SkColorSpace
::
MakeSRGB
());
return
SkSurface
::
MakeRaster
(
image_info
);
}
// |GPUSurfaceSoftwareDelegate|
bool
ShellTestPlatformView
::
PresentBackingStore
(
sk_sp
<
SkSurface
>
backing_store
)
{
return
true
;
}
}
// namespace testing
}
// namespace flutter
shell/common/shell_test.h
浏览文件 @
2e4f0a4a
...
...
@@ -10,14 +10,16 @@
#include "flutter/common/settings.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/common/run_configuration.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/thread_host.h"
#include "flutter/shell/gpu/gpu_surface_software.h"
#include "flutter/testing/test_dart_native_resolver.h"
#include "flutter/testing/thread_test.h"
namespace
flutter
{
namespace
testing
{
class
ShellTest
:
public
::
testing
::
ThreadTest
{
class
ShellTest
:
public
ThreadTest
{
public:
ShellTest
();
...
...
@@ -38,12 +40,33 @@ class ShellTest : public ::testing::ThreadTest {
private:
fml
::
UniqueFD
assets_dir_
;
std
::
shared_ptr
<
::
testing
::
TestDartNativeResolver
>
native_resolver_
;
std
::
shared_ptr
<
TestDartNativeResolver
>
native_resolver_
;
std
::
unique_ptr
<
ThreadHost
>
thread_host_
;
void
SetSnapshotsAndAssets
(
Settings
&
settings
);
};
class
ShellTestPlatformView
:
public
PlatformView
,
public
GPUSurfaceSoftwareDelegate
{
public:
ShellTestPlatformView
(
PlatformView
::
Delegate
&
delegate
,
TaskRunners
task_runners
);
~
ShellTestPlatformView
()
override
;
private:
// |PlatformView|
std
::
unique_ptr
<
Surface
>
CreateRenderingSurface
()
override
;
// |GPUSurfaceSoftwareDelegate|
virtual
sk_sp
<
SkSurface
>
AcquireBackingStore
(
const
SkISize
&
size
)
override
;
// |GPUSurfaceSoftwareDelegate|
virtual
bool
PresentBackingStore
(
sk_sp
<
SkSurface
>
backing_store
)
override
;
FML_DISALLOW_COPY_AND_ASSIGN
(
ShellTestPlatformView
);
};
}
// namespace testing
}
// namespace flutter
...
...
shell/common/shell_unittests.cc
浏览文件 @
2e4f0a4a
...
...
@@ -14,43 +14,13 @@
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/shell_test.h"
#include "flutter/shell/common/thread_host.h"
#include "flutter/shell/gpu/gpu_surface_software.h"
#include "flutter/testing/testing.h"
#include "gtest/gtest.h"
namespace
flutter
{
namespace
testing
{
class
TestPlatformView
:
public
PlatformView
,
public
GPUSurfaceSoftwareDelegate
{
public:
TestPlatformView
(
PlatformView
::
Delegate
&
delegate
,
TaskRunners
task_runners
)
:
PlatformView
(
delegate
,
std
::
move
(
task_runners
))
{}
private:
// |PlatformView|
std
::
unique_ptr
<
Surface
>
CreateRenderingSurface
()
override
{
return
std
::
make_unique
<
GPUSurfaceSoftware
>
(
this
);
}
// |GPUSurfaceSoftwareDelegate|
virtual
sk_sp
<
SkSurface
>
AcquireBackingStore
(
const
SkISize
&
size
)
override
{
SkImageInfo
image_info
=
SkImageInfo
::
MakeN32Premul
(
size
.
width
(),
size
.
height
(),
SkColorSpace
::
MakeSRGB
());
return
SkSurface
::
MakeRaster
(
image_info
);
}
// |GPUSurfaceSoftwareDelegate|
virtual
bool
PresentBackingStore
(
sk_sp
<
SkSurface
>
backing_store
)
override
{
return
true
;
}
FML_DISALLOW_COPY_AND_ASSIGN
(
TestPlatformView
);
};
static
bool
ValidateShell
(
Shell
*
shell
)
{
if
(
!
shell
)
{
return
false
;
...
...
@@ -90,7 +60,7 @@ TEST_F(ShellTest, InitializeWithInvalidThreads) {
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -103,8 +73,7 @@ TEST_F(ShellTest, InitializeWithInvalidThreads) {
TEST_F
(
ShellTest
,
InitializeWithDifferentThreads
)
{
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
Settings
settings
=
CreateSettingsForFixture
();
ThreadHost
thread_host
(
"io.flutter.test."
+
::
testing
::
GetCurrentTestName
()
+
"."
,
ThreadHost
thread_host
(
"io.flutter.test."
+
GetCurrentTestName
()
+
"."
,
ThreadHost
::
Type
::
Platform
|
ThreadHost
::
Type
::
GPU
|
ThreadHost
::
Type
::
IO
|
ThreadHost
::
Type
::
UI
);
TaskRunners
task_runners
(
"test"
,
thread_host
.
platform_thread
->
GetTaskRunner
(),
...
...
@@ -114,7 +83,7 @@ TEST_F(ShellTest, InitializeWithDifferentThreads) {
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -129,8 +98,7 @@ TEST_F(ShellTest, InitializeWithDifferentThreads) {
TEST_F
(
ShellTest
,
InitializeWithSingleThread
)
{
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
Settings
settings
=
CreateSettingsForFixture
();
ThreadHost
thread_host
(
"io.flutter.test."
+
::
testing
::
GetCurrentTestName
()
+
"."
,
ThreadHost
thread_host
(
"io.flutter.test."
+
GetCurrentTestName
()
+
"."
,
ThreadHost
::
Type
::
Platform
);
auto
task_runner
=
thread_host
.
platform_thread
->
GetTaskRunner
();
TaskRunners
task_runners
(
"test"
,
task_runner
,
task_runner
,
task_runner
,
...
...
@@ -138,7 +106,7 @@ TEST_F(ShellTest, InitializeWithSingleThread) {
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -160,7 +128,7 @@ TEST_F(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) {
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -177,7 +145,7 @@ TEST_F(ShellTest,
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
Settings
settings
=
CreateSettingsForFixture
();
ThreadHost
thread_host
(
"io.flutter.test."
+
::
testing
::
GetCurrentTestName
()
+
"."
,
"io.flutter.test."
+
GetCurrentTestName
()
+
"."
,
ThreadHost
::
Type
::
GPU
|
ThreadHost
::
Type
::
IO
|
ThreadHost
::
Type
::
UI
);
fml
::
MessageLoop
::
EnsureInitializedForCurrentThread
();
TaskRunners
task_runners
(
"test"
,
...
...
@@ -188,7 +156,7 @@ TEST_F(ShellTest,
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -204,7 +172,7 @@ TEST_F(ShellTest, InitializeWithGPUAndPlatformThreadsTheSame) {
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
Settings
settings
=
CreateSettingsForFixture
();
ThreadHost
thread_host
(
"io.flutter.test."
+
::
testing
::
GetCurrentTestName
()
+
"."
,
"io.flutter.test."
+
GetCurrentTestName
()
+
"."
,
ThreadHost
::
Type
::
Platform
|
ThreadHost
::
Type
::
IO
|
ThreadHost
::
Type
::
UI
);
TaskRunners
task_runners
(
"test"
,
...
...
@@ -216,7 +184,7 @@ TEST_F(ShellTest, InitializeWithGPUAndPlatformThreadsTheSame) {
auto
shell
=
Shell
::
Create
(
std
::
move
(
task_runners
),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -234,7 +202,7 @@ TEST_F(ShellTest, FixturesAreFunctional) {
auto
shell
=
Shell
::
Create
(
GetTaskRunnersForFixture
(),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
@@ -274,7 +242,7 @@ TEST_F(ShellTest, SecondaryIsolateBindingsAreSetupViaShellSettings) {
auto
shell
=
Shell
::
Create
(
GetTaskRunnersForFixture
(),
settings
,
[](
Shell
&
shell
)
{
return
std
::
make_unique
<
TestPlatformView
>
(
shell
,
return
std
::
make_unique
<
Shell
TestPlatformView
>
(
shell
,
shell
.
GetTaskRunners
());
},
[](
Shell
&
shell
)
{
...
...
shell/platform/embedder/tests/embedder_a11y_unittests.cc
浏览文件 @
2e4f0a4a
...
...
@@ -34,7 +34,7 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
})));
// Called by test fixture on UI thread to pass data back to this test.
::
testing
::
NativeEntry
callback
;
NativeEntry
callback
;
context
.
AddNativeCallback
(
"NotifyTestData"
,
CREATE_NATIVE_ENTRY
(([
&
callback
](
Dart_NativeArguments
args
)
{
...
...
shell/platform/embedder/tests/embedder_context.cc
浏览文件 @
2e4f0a4a
...
...
@@ -11,7 +11,7 @@ namespace testing {
EmbedderContext
::
EmbedderContext
(
std
::
string
assets_path
)
:
assets_path_
(
std
::
move
(
assets_path
)),
native_resolver_
(
std
::
make_shared
<
::
testing
::
TestDartNativeResolver
>
())
{
native_resolver_
(
std
::
make_shared
<
TestDartNativeResolver
>
())
{
auto
assets_dir
=
fml
::
OpenDirectory
(
assets_path_
.
c_str
(),
false
,
fml
::
FilePermission
::
kRead
);
vm_snapshot_data_
=
...
...
@@ -27,8 +27,8 @@ EmbedderContext::EmbedderContext(std::string assets_path)
}
isolate_create_callbacks_
.
push_back
(
[
weak_resolver
=
std
::
weak_ptr
<::
testing
::
TestDartNativeResolver
>
{
native_resolver_
}]()
{
[
weak_resolver
=
std
::
weak_ptr
<
TestDartNativeResolver
>
{
native_resolver_
}]()
{
if
(
auto
resolver
=
weak_resolver
.
lock
())
{
resolver
->
SetNativeResolverForIsolate
();
}
...
...
shell/platform/embedder/tests/embedder_context.h
浏览文件 @
2e4f0a4a
...
...
@@ -58,7 +58,7 @@ class EmbedderContext {
std
::
unique_ptr
<
fml
::
Mapping
>
isolate_snapshot_data_
;
std
::
unique_ptr
<
fml
::
Mapping
>
isolate_snapshot_instructions_
;
std
::
vector
<
fml
::
closure
>
isolate_create_callbacks_
;
std
::
shared_ptr
<
::
testing
::
TestDartNativeResolver
>
native_resolver_
;
std
::
shared_ptr
<
TestDartNativeResolver
>
native_resolver_
;
SemanticsNodeCallback
update_semantics_node_callback_
;
SemanticsActionCallback
update_semantics_custom_action_callback_
;
...
...
shell/platform/embedder/tests/embedder_test.cc
浏览文件 @
2e4f0a4a
...
...
@@ -12,7 +12,7 @@ EmbedderTest::EmbedderTest() = default;
EmbedderTest
::~
EmbedderTest
()
=
default
;
std
::
string
EmbedderTest
::
GetFixturesDirectory
()
const
{
return
::
testing
::
GetFixturesPath
();
return
GetFixturesPath
();
}
EmbedderContext
&
EmbedderTest
::
GetEmbedderContext
()
{
...
...
testing/build/gen_fixtures_location_symbol.py
浏览文件 @
2e4f0a4a
...
...
@@ -19,7 +19,7 @@ def main():
args
=
parser
.
parse_args
()
with
open
(
args
.
fixtures_location_file
,
'w'
)
as
file
:
file
.
write
(
'namespace
testing {const char* GetFixturesPath() {return "%s";
}}'
file
.
write
(
'namespace
flutter {namespace testing {const char* GetFixturesPath() {return "%s";}
}}'
%
args
.
fixtures_location
)
...
...
testing/run_all_unittests.cc
浏览文件 @
2e4f0a4a
...
...
@@ -5,6 +5,6 @@
#include "gtest/gtest.h"
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
testing/test_dart_native_resolver.cc
浏览文件 @
2e4f0a4a
...
...
@@ -12,6 +12,7 @@
#include "third_party/tonic/logging/dart_error.h"
#include "tonic/converter/dart_converter.h"
namespace
flutter
{
namespace
testing
{
TestDartNativeResolver
::
TestDartNativeResolver
()
=
default
;
...
...
@@ -89,3 +90,4 @@ void TestDartNativeResolver::SetNativeResolverForIsolate() {
}
}
// namespace testing
}
// namespace flutter
testing/test_dart_native_resolver.h
浏览文件 @
2e4f0a4a
...
...
@@ -14,7 +14,7 @@
#define CREATE_NATIVE_ENTRY(native_entry) \
([&]() { \
static ::
testing::NativeEntry closure;
\
static ::
flutter::testing::NativeEntry closure;
\
static Dart_NativeFunction entrypoint = [](Dart_NativeArguments args) { \
closure(args); \
}; \
...
...
@@ -22,6 +22,7 @@
return entrypoint; \
})()
namespace
flutter
{
namespace
testing
{
using
NativeEntry
=
std
::
function
<
void
(
Dart_NativeArguments
)
>
;
...
...
@@ -51,5 +52,6 @@ class TestDartNativeResolver
};
}
// namespace testing
}
// namespace flutter
#endif // FLUTTER_TESTING_TEST_DART_NATIVE_RESOLVER_H_
testing/testing.cc
浏览文件 @
2e4f0a4a
...
...
@@ -4,10 +4,12 @@
#include "testing.h"
namespace
flutter
{
namespace
testing
{
std
::
string
GetCurrentTestName
()
{
return
UnitTest
::
GetInstance
()
->
current_test_info
()
->
name
();
return
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
name
();
}
}
// namespace testing
}
// namespace flutter
testing/testing.h
浏览文件 @
2e4f0a4a
...
...
@@ -9,6 +9,7 @@
#include "gtest/gtest.h"
namespace
flutter
{
namespace
testing
{
// Returns the directory containing the test fixture for the target if this
...
...
@@ -19,5 +20,6 @@ const char* GetFixturesPath();
std
::
string
GetCurrentTestName
();
}
// namespace testing
}
// namespace flutter
#endif // TESTING_TESTING_H_
testing/thread_test.cc
浏览文件 @
2e4f0a4a
...
...
@@ -6,6 +6,7 @@
#include "flutter/testing/thread_test.h"
namespace
flutter
{
namespace
testing
{
// |testing::Test|
...
...
@@ -33,3 +34,4 @@ fml::RefPtr<fml::TaskRunner> ThreadTest::GetThreadTaskRunner() {
}
}
// namespace testing
}
// namespace flutter
testing/thread_test.h
浏览文件 @
2e4f0a4a
...
...
@@ -13,9 +13,10 @@
#include "flutter/fml/thread.h"
#include "gtest/gtest.h"
namespace
flutter
{
namespace
testing
{
class
ThreadTest
:
public
Test
{
class
ThreadTest
:
public
::
testing
::
Test
{
public:
fml
::
RefPtr
<
fml
::
TaskRunner
>
GetCurrentTaskRunner
();
...
...
@@ -35,5 +36,6 @@ class ThreadTest : public Test {
};
}
// namespace testing
}
// namespace flutter
#endif // FLUTTER_TESTING_THREAD_TEST_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录