Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
2e07da7b
E
engine
项目概览
qq_34031325
/
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,体验更适合开发者的 AI 搜索 >>
提交
2e07da7b
编写于
3月 17, 2021
作者:
G
George Wright
提交者:
George Wright
3月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial import of DispatchStub and gtest_util.h from upstream Chromium
上级
b5091d6a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
190 addition
and
0 deletion
+190
-0
third_party/accessibility/base/test/gtest_util.h
third_party/accessibility/base/test/gtest_util.h
+107
-0
third_party/accessibility/base/win/dispatch_stub.cc
third_party/accessibility/base/win/dispatch_stub.cc
+40
-0
third_party/accessibility/base/win/dispatch_stub.h
third_party/accessibility/base/win/dispatch_stub.h
+43
-0
未找到文件。
third_party/accessibility/base/test/gtest_util.h
0 → 100644
浏览文件 @
2e07da7b
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_TEST_GTEST_UTIL_H_
#define BASE_TEST_GTEST_UTIL_H_
#include <string>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
// EXPECT/ASSERT_DCHECK_DEATH is intended to replace EXPECT/ASSERT_DEBUG_DEATH
// when the death is expected to be caused by a DCHECK. Contrary to
// EXPECT/ASSERT_DEBUG_DEATH however, it doesn't execute the statement in non-
// dcheck builds as DCHECKs are intended to catch things that should never
// happen and as such executing the statement results in undefined behavior
// (|statement| is compiled in unsupported configurations nonetheless).
// Death tests misbehave on Android.
#if DCHECK_IS_ON() && defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
// EXPECT/ASSERT_DCHECK_DEATH tests verify that a DCHECK is hit ("Check failed"
// is part of the error message), but intentionally do not expose the gtest
// death test's full |regex| parameter to avoid users having to verify the exact
// syntax of the error message produced by the DCHECK.
#define EXPECT_DCHECK_DEATH(statement) EXPECT_DEATH(statement, "Check failed")
#define ASSERT_DCHECK_DEATH(statement) ASSERT_DEATH(statement, "Check failed")
#else
// DCHECK_IS_ON() && defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
#define EXPECT_DCHECK_DEATH(statement) \
GTEST_UNSUPPORTED_DEATH_TEST(statement, "Check failed", )
#define ASSERT_DCHECK_DEATH(statement) \
GTEST_UNSUPPORTED_DEATH_TEST(statement, "Check failed", return)
#endif
// DCHECK_IS_ON() && defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
// As above, but for CHECK().
#if defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
// Official builds will eat stream parameters, so don't check the error message.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
#define EXPECT_CHECK_DEATH(statement) EXPECT_DEATH(statement, "")
#define ASSERT_CHECK_DEATH(statement) ASSERT_DEATH(statement, "")
#else
#define EXPECT_CHECK_DEATH(statement) EXPECT_DEATH(statement, "Check failed")
#define ASSERT_CHECK_DEATH(statement) ASSERT_DEATH(statement, "Check failed")
#endif // defined(OFFICIAL_BUILD) && defined(NDEBUG)
#else // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
// Note GTEST_UNSUPPORTED_DEATH_TEST takes a |regex| only to see whether it is a
// valid regex. It is never evaluated.
#define EXPECT_CHECK_DEATH(statement) \
GTEST_UNSUPPORTED_DEATH_TEST(statement, "", )
#define ASSERT_CHECK_DEATH(statement) \
GTEST_UNSUPPORTED_DEATH_TEST(statement, "", return )
#endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
namespace
base
{
class
FilePath
;
struct
TestIdentifier
{
TestIdentifier
();
TestIdentifier
(
const
TestIdentifier
&
other
);
std
::
string
test_case_name
;
std
::
string
test_name
;
std
::
string
file
;
int
line
;
};
// Constructs a full test name given a test case name and a test name,
// e.g. for test case "A" and test name "B" returns "A.B".
std
::
string
FormatFullTestName
(
const
std
::
string
&
test_case_name
,
const
std
::
string
&
test_name
);
// Returns the full test name with the "DISABLED_" prefix stripped out.
// e.g. for the full test names "A.DISABLED_B", "DISABLED_A.B", and
// "DISABLED_A.DISABLED_B", returns "A.B".
std
::
string
TestNameWithoutDisabledPrefix
(
const
std
::
string
&
full_test_name
);
// Returns a vector of gtest-based tests compiled into
// current executable.
std
::
vector
<
TestIdentifier
>
GetCompiledInTests
();
// Writes the list of gtest-based tests compiled into
// current executable as a JSON file. Returns true on success.
bool
WriteCompiledInTestsToFile
(
const
FilePath
&
path
)
WARN_UNUSED_RESULT
;
// Reads the list of gtest-based tests from |path| into |output|.
// Returns true on success.
bool
ReadTestNamesFromFile
(
const
FilePath
&
path
,
std
::
vector
<
TestIdentifier
>*
output
)
WARN_UNUSED_RESULT
;
}
// namespace base
#endif // BASE_TEST_GTEST_UTIL_H_
third_party/accessibility/base/win/dispatch_stub.cc
0 → 100644
浏览文件 @
2e07da7b
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/win/dispatch_stub.h"
namespace
base
{
namespace
win
{
namespace
test
{
IFACEMETHODIMP
DispatchStub
::
GetTypeInfoCount
(
UINT
*
)
{
return
E_NOTIMPL
;
}
IFACEMETHODIMP
DispatchStub
::
GetTypeInfo
(
UINT
,
LCID
,
ITypeInfo
**
)
{
return
E_NOTIMPL
;
}
IFACEMETHODIMP
DispatchStub
::
GetIDsOfNames
(
REFIID
,
LPOLESTR
*
,
UINT
,
LCID
,
DISPID
*
)
{
return
E_NOTIMPL
;
}
IFACEMETHODIMP
DispatchStub
::
Invoke
(
DISPID
,
REFIID
,
LCID
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
EXCEPINFO
*
,
UINT
*
)
{
return
E_NOTIMPL
;
}
}
// namespace test
}
// namespace win
}
// namespace base
third_party/accessibility/base/win/dispatch_stub.h
0 → 100644
浏览文件 @
2e07da7b
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_WIN_DISPATCH_STUB_H_
#define BASE_WIN_DISPATCH_STUB_H_
#include <wrl/client.h>
#include <wrl/implements.h>
namespace
base
{
namespace
win
{
namespace
test
{
// An unimplemented IDispatch subclass for testing purposes.
class
DispatchStub
:
public
Microsoft
::
WRL
::
RuntimeClass
<
Microsoft
::
WRL
::
RuntimeClassFlags
<
Microsoft
::
WRL
::
ClassicCom
>
,
IDispatch
>
{
public:
DispatchStub
()
=
default
;
DispatchStub
(
const
DispatchStub
&
)
=
delete
;
DispatchStub
&
operator
=
(
const
DispatchStub
&
)
=
delete
;
// IDispatch:
IFACEMETHODIMP
GetTypeInfoCount
(
UINT
*
)
override
;
IFACEMETHODIMP
GetTypeInfo
(
UINT
,
LCID
,
ITypeInfo
**
)
override
;
IFACEMETHODIMP
GetIDsOfNames
(
REFIID
,
LPOLESTR
*
,
UINT
,
LCID
,
DISPID
*
)
override
;
IFACEMETHODIMP
Invoke
(
DISPID
,
REFIID
,
LCID
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
EXCEPINFO
*
,
UINT
*
)
override
;
};
}
// namespace test
}
// namespace win
}
// namespace base
#endif // BASE_WIN_DISPATCH_STUB_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录