Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
ece3427f
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ece3427f
编写于
3月 14, 2019
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add hang mitigating timeout to WaitForAsyncOperations
上级
d0127163
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
130 addition
and
124 deletion
+130
-124
src/Test/Diagnostics/TestingOnly_WaitingService.cs
src/Test/Diagnostics/TestingOnly_WaitingService.cs
+9
-3
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpExtractMethod.cs
...rationTest/IntegrationTests/CSharp/CSharpExtractMethod.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpFormatting.cs
...tegrationTest/IntegrationTests/CSharp/CSharpFormatting.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpImmediate.cs
...ntegrationTest/IntegrationTests/CSharp/CSharpImmediate.cs
+2
-2
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs
...st/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs
+2
-2
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpRename.cs
...o/IntegrationTest/IntegrationTests/CSharp/CSharpRename.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReplIdeFeatures.cs
...tionTest/IntegrationTests/CSharp/CSharpReplIdeFeatures.cs
+18
-18
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSendToInteractive.cs
...onTest/IntegrationTests/CSharp/CSharpSendToInteractive.cs
+2
-2
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicChangeSignatureDialog.cs
...ntegrationTests/VisualBasic/BasicChangeSignatureDialog.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicEditAndContinue.cs
...Test/IntegrationTests/VisualBasic/BasicEditAndContinue.cs
+12
-12
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicExtractMethod.cs
...onTest/IntegrationTests/VisualBasic/BasicExtractMethod.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicFormatting.cs
...ationTest/IntegrationTests/VisualBasic/BasicFormatting.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicGenerateConstructorDialog.cs
...rationTests/VisualBasic/BasicGenerateConstructorDialog.cs
+3
-3
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicGenerateEqualsAndGetHashCodeDialog.cs
...ts/VisualBasic/BasicGenerateEqualsAndGetHashCodeDialog.cs
+1
-1
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicImmediate.cs
...rationTest/IntegrationTests/VisualBasic/BasicImmediate.cs
+2
-2
src/VisualStudio/IntegrationTest/IntegrationTests/Workspace/WorkspacesNetCore.cs
...ationTest/IntegrationTests/Workspace/WorkspacesNetCore.cs
+1
-1
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/VisualStudioWorkspace_InProc.cs
...t/TestUtilities/InProcess/VisualStudioWorkspace_InProc.cs
+2
-2
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.Verifier.cs
...t/TestUtilities/OutOfProcess/Editor_OutOfProc.Verifier.cs
+2
-2
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs
...rationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs
+19
-19
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/ErrorList_OutOfProc.cs
...ionTest/TestUtilities/OutOfProcess/ErrorList_OutOfProc.cs
+12
-12
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/ExtractInterfaceDialog_OutOfProc.cs
...tilities/OutOfProcess/ExtractInterfaceDialog_OutOfProc.cs
+2
-2
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/FindReferencesWindow_OutOfProc.cs
...tUtilities/OutOfProcess/FindReferencesWindow_OutOfProc.cs
+1
-1
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/GenerateTypeDialog_OutOfProc.cs
...estUtilities/OutOfProcess/GenerateTypeDialog_OutOfProc.cs
+2
-2
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/InlineRenameDialog_OutOfProc.cs
...estUtilities/OutOfProcess/InlineRenameDialog_OutOfProc.cs
+4
-4
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/OutOfProcComponent.cs
...tionTest/TestUtilities/OutOfProcess/OutOfProcComponent.cs
+5
-5
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/PickMembersDialog_OutOfProc.cs
...TestUtilities/OutOfProcess/PickMembersDialog_OutOfProc.cs
+1
-1
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/PreviewChangesDialog_OutOfProc.cs
...tUtilities/OutOfProcess/PreviewChangesDialog_OutOfProc.cs
+1
-1
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
.../TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
+9
-9
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/TextViewWindow_OutOfProc.Verifier.cs
...ilities/OutOfProcess/TextViewWindow_OutOfProc.Verifier.cs
+4
-4
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/TextViewWindow_OutOfProc.cs
...st/TestUtilities/OutOfProcess/TextViewWindow_OutOfProc.cs
+5
-5
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/VisualStudioWorkspace_OutOfProc.cs
...Utilities/OutOfProcess/VisualStudioWorkspace_OutOfProc.cs
+3
-3
未找到文件。
src/Test/Diagnostics/TestingOnly_WaitingService.cs
浏览文件 @
ece3427f
...
...
@@ -22,22 +22,28 @@ private TestingOnly_WaitingService(IAsynchronousOperationListenerProvider provid
}
public
void
WaitForAsyncOperations
(
string
featureName
,
bool
waitForWorkspaceFirst
=
true
)
{
WaitForAsyncOperations
(
TimeSpan
.
FromMilliseconds
(-
1
),
featureName
,
waitForWorkspaceFirst
);
}
public
void
WaitForAsyncOperations
(
TimeSpan
timeout
,
string
featureName
,
bool
waitForWorkspaceFirst
=
true
)
{
var
workspaceWaiter
=
_provider
.
GetWaiter
(
FeatureAttribute
.
Workspace
);
var
featureWaiter
=
_provider
.
GetWaiter
(
featureName
);
Contract
.
ThrowIfNull
(
featureWaiter
);
using
var
cancellationTokenSource
=
new
CancellationTokenSource
(
timeout
);
// wait for each of the features specified in the featuresToWaitFor string
if
(
waitForWorkspaceFirst
)
{
// at least wait for the workspace to finish processing everything.
var
task
=
workspaceWaiter
.
CreateWaitTask
();
task
.
Wait
();
task
.
Wait
(
cancellationTokenSource
.
Token
);
}
var
waitTask
=
featureWaiter
.
CreateWaitTask
();
WaitForTask
(
waitTask
,
CancellationToken
.
None
);
WaitForTask
(
waitTask
,
cancellationTokenSource
.
Token
);
// Debugging trick: don't let the listeners collection get optimized away during execution.
// This means if the process is killed during integration tests and the test was waiting, you can
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpExtractMethod.cs
浏览文件 @
ece3427f
...
...
@@ -70,7 +70,7 @@ public int Method()
MarkupTestFile
.
GetSpans
(
expectedMarkup
,
out
var
expectedText
,
out
ImmutableArray
<
TextSpan
>
spans
);
VisualStudio
.
Editor
.
Verify
.
TextContains
(
expectedText
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
AssertEx
.
SetEqual
(
spans
,
VisualStudio
.
Editor
.
GetTagSpans
(
VisualStudio
.
InlineRenameDialog
.
ValidRenameTag
));
VisualStudio
.
Editor
.
SendKeys
(
"SayHello"
,
VirtualKey
.
Enter
);
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpFormatting.cs
浏览文件 @
ece3427f
...
...
@@ -257,7 +257,7 @@ object M(object bar)
return M$$
}
}"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Editor
.
SendKeys
(
"(ba"
,
new
KeyPress
(
VirtualKey
.
Enter
,
ShiftState
.
Shift
),
"// comment"
);
VisualStudio
.
Editor
.
Verify
.
TextContains
(
@"
class Program
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpImmediate.cs
浏览文件 @
ece3427f
...
...
@@ -45,12 +45,12 @@ static void Main(string[] args)
}
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
"Program.cs"
,
"}"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
ImmediateWindow
.
ShowImmediateWindow
(
clearAll
:
true
);
VisualStudio
.
SendKeys
.
Send
(
"?n"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
CompletionSet
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
CompletionSet
);
VisualStudio
.
SendKeys
.
Send
(
"1"
,
VirtualKey
.
Tab
,
VirtualKey
.
Enter
);
Assert
.
Contains
(
"?n1Var\r\n42"
,
VisualStudio
.
ImmediateWindow
.
GetText
());
}
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs
浏览文件 @
ece3427f
...
...
@@ -77,9 +77,9 @@ void M()
}"
;
VisualStudio
.
Editor
.
SetText
(
text
);
VisualStudio
.
Editor
.
PlaceCaret
(
"x"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
ExecuteCommand
(
"Edit.NextHighlightedReference"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Editor
.
Verify
.
CurrentLineText
(
"x$$ = 3;"
,
assertCaretPosition
:
true
,
trimWhitespace
:
true
);
}
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpRename.cs
浏览文件 @
ece3427f
...
...
@@ -463,7 +463,7 @@ class y
}"
);
VisualStudio
.
Editor
.
SendKeys
(
VirtualKey
.
Escape
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
VisualStudio
.
Editor
.
Verify
.
TextContains
(
@"
class Program
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReplIdeFeatures.cs
浏览文件 @
ece3427f
...
...
@@ -66,7 +66,7 @@ public void HighlightRefsSingleSubmissionVerifyRenameTagsShowUpWhenInvokedOnUnsu
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"int someint; someint = 22; someint = 23;"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"someint = 22"
,
charsOffset
:
-
6
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedWrittenReference
,
2
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
}
...
...
@@ -76,11 +76,11 @@ public void HighlightRefsSingleSubmissionVerifyRenameTagsGoAway()
{
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"int someint; someint = 22; someint = 23;"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"someint = 22"
,
charsOffset
:
-
6
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedWrittenReference
,
2
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"22"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
0
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
0
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedWrittenReference
,
0
);
...
...
@@ -93,7 +93,7 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpWhenInvokedOnSu
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo something = new Goo();"
);
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"something.ToString();"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"someth"
,
charsOffset
:
1
,
occurrence
:
2
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
1
);
}
...
...
@@ -105,7 +105,7 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnUnsubmittedTe
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo something = new Goo();"
);
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"something.ToString();"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"someth"
,
charsOffset
:
1
,
occurrence
:
2
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
1
);
}
...
...
@@ -117,7 +117,7 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvo
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo a;"
);
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo b;"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"Goo b"
,
charsOffset
:
-
1
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
2
);
}
...
...
@@ -129,7 +129,7 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsShowUpOnTypesWhenInvo
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo a;"
);
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"Goo b;"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"Goo b"
,
charsOffset
:
-
1
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
2
);
}
...
...
@@ -141,7 +141,7 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsGoAwayWhenInvokedOnUn
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"Goo a;"
);
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"Goo b;Something();"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"Something();"
,
charsOffset
:
-
1
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
0
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
0
);
}
...
...
@@ -152,9 +152,9 @@ public void HighlightRefsMultipleSubmisionsVerifyRenameTagsOnRedefinedVariable()
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"string abc = null;"
);
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"abc = string.Empty;"
);
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"int abc = 42;"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"abc"
,
occurrence
:
3
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ReferenceHighlighting
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedDefinition
,
1
);
VisualStudio
.
InteractiveWindow
.
VerifyTags
(
WellKnownTagNames
.
MarkerFormatDefinition_HighlightedReference
,
0
);
}
...
...
@@ -173,23 +173,23 @@ public void Method(int x)
}"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"abc"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_Rename
));
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"1 + 1"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_ExtractMethod
));
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"Class"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_ExtractInterface
));
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"field"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_EncapsulateField
));
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"Method"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_RemoveParameters
));
Assert
.
False
(
VisualStudio
.
IsCommandAvailable
(
WellKnownCommandNames
.
Refactor_ReorderParameters
));
}
...
...
@@ -199,7 +199,7 @@ public void AddUsing()
{
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"typeof(ArrayList)"
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"ArrayList"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
InteractiveWindow
.
InvokeCodeActionList
();
VisualStudio
.
InteractiveWindow
.
Verify
.
CodeActions
(
new
string
[]
{
"using System.Collections;"
,
"System.Collections.ArrayList"
},
...
...
@@ -214,9 +214,9 @@ public void AddUsing()
public
void
QualifyName
()
{
VisualStudio
.
InteractiveWindow
.
InsertCode
(
"typeof(ArrayList)"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
InteractiveWindow
.
PlaceCaret
(
"ArrayList"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
InteractiveWindow
.
Verify
.
CodeActions
(
new
string
[]
{
"using System.Collections;"
,
"System.Collections.ArrayList"
},
"System.Collections.ArrayList"
);
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSendToInteractive.cs
浏览文件 @
ece3427f
...
...
@@ -222,7 +222,7 @@ public void AddAssemblyReferenceAndTypesToInteractive()
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"public class MyClass { public string MyFunc() { return \"MyClass.MyFunc()\"; } }"
);
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"(new MyClass()).MyFunc()"
);
VisualStudio
.
InteractiveWindow
.
WaitForLastReplOutput
(
"\"MyClass.MyFunc()\""
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
}
[
WpfFact
]
...
...
@@ -250,7 +250,7 @@ public void ResetInteractiveFromProjectAndVerify()
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"System.Windows.Forms.Form f = new System.Windows.Forms.Form(); f.Text = \"goo\";"
);
VisualStudio
.
InteractiveWindow
.
SubmitText
(
"f.Text"
);
VisualStudio
.
InteractiveWindow
.
WaitForLastReplOutput
(
"\"goo\""
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
}
}
}
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicChangeSignatureDialog.cs
浏览文件 @
ece3427f
...
...
@@ -114,7 +114,7 @@ public int Method(int a, string b, double c)
VisualStudio
.
SolutionExplorer
.
AddProjectReference
(
project
,
csharpProjectReference
);
VisualStudio
.
SolutionExplorer
.
OpenFile
(
project
,
"Class1.vb"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
ChangeSignatureDialog
.
Invoke
();
ChangeSignatureDialog
.
VerifyOpen
();
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicEditAndContinue.cs
浏览文件 @
ece3427f
...
...
@@ -54,7 +54,7 @@ End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"names(0)"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Editor
.
ReplaceText
(
"names(0)"
,
"names(1)"
);
...
...
@@ -79,7 +79,7 @@ End Sub
End Sub
End Module"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"Console.WriteLine(1)"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Editor
.
ReplaceText
(
"Console.WriteLine(1)"
,
...
...
@@ -87,7 +87,7 @@ End Sub
Console.WriteLine(1)
Catch ex As Exception
End Try"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
StepOver
(
waitForBreakOrEnd
:
true
);
VisualStudio
.
Editor
.
Verify
.
CurrentLineText
(
"End Try"
);
}
...
...
@@ -106,7 +106,7 @@ Sub Main()
End Sub
End Module"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"x * x"
,
charsOffset
:
-
1
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
...
...
@@ -136,7 +136,7 @@ Sub Main()
End Sub
End Module"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"Dim x"
,
charsOffset
:
1
);
VisualStudio
.
Debugger
.
ExecuteStatement
(
"Module1.Main()"
);
...
...
@@ -185,7 +185,7 @@ End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
[
WpfFact
]
...
...
@@ -217,7 +217,7 @@ Sub Main()
End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
false
);
VisualStudio
.
ActivateMainWindow
();
VisualStudio
.
SolutionExplorer
.
OpenFile
(
project
,
module1FileName
);
...
...
@@ -231,7 +231,7 @@ End Module
// This module is referred by the loaded module, but not used. So this will not be loaded
VisualStudio
.
SolutionExplorer
.
OpenFile
(
basicLibrary
,
"Class1.vb"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
SendKeys
.
Send
(
VirtualKey
.
T
);
VisualStudio
.
Dialog
.
VerifyOpen
(
editAndContinueDialogName
);
VisualStudio
.
Dialog
.
Click
(
editAndContinueDialogName
,
"OK"
);
...
...
@@ -240,7 +240,7 @@ End Module
// This module is not referred by the loaded module. this will not be loaded
VisualStudio
.
SolutionExplorer
.
OpenFile
(
cSharpLibrary
,
"File1.cs"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
SendKeys
.
Send
(
VirtualKey
.
T
);
string
microsoftVisualStudioDialogName
=
"Microsoft Visual Studio"
;
...
...
@@ -262,7 +262,7 @@ Sub Main()
End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"End Sub"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Editor
.
ReplaceText
(
"Dim goo As String = \"abc\""
,
"Dim goo As Single = 10"
);
...
...
@@ -293,7 +293,7 @@ Return 4
End Function
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
module1FileName
,
"Function bar(ByVal moo As Long) As Decimal"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Editor
.
ReplaceText
(
"Dim lLng As Long = 5"
,
"Dim lLng As Long = 444"
);
...
...
@@ -320,7 +320,7 @@ End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
Debugger
.
CheckExpression
(
"iInt"
,
"Integer"
,
"0"
);
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicExtractMethod.cs
浏览文件 @
ece3427f
...
...
@@ -78,7 +78,7 @@ End Function
MarkupTestFile
.
GetSpans
(
expectedMarkup
,
out
var
expectedText
,
out
ImmutableArray
<
TextSpan
>
spans
);
VisualStudio
.
Editor
.
Verify
.
TextContains
(
expectedText
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
AssertEx
.
SetEqual
(
spans
,
VisualStudio
.
Editor
.
GetTagSpans
(
VisualStudio
.
InlineRenameDialog
.
ValidRenameTag
));
VisualStudio
.
Editor
.
SendKeys
(
"SayHello"
,
VirtualKey
.
Enter
);
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicFormatting.cs
浏览文件 @
ece3427f
...
...
@@ -66,7 +66,7 @@ Module Program
Return Main$$
End Function
End Module"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Editor
.
SendKeys
(
"(o"
,
new
KeyPress
(
VirtualKey
.
Enter
,
ShiftState
.
Shift
),
"'comment"
);
VisualStudio
.
Editor
.
Verify
.
TextContains
(
@"
Module Program
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicGenerateConstructorDialog.cs
浏览文件 @
ece3427f
...
...
@@ -68,7 +68,7 @@ Class C
VisualStudio
.
Editor
.
Verify
.
CodeAction
(
"Generate constructor..."
,
applyFix
:
true
,
blockUntilComplete
:
false
);
VerifyDialog
(
isOpen
:
true
);
Dialog_ClickOk
();
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
var
actualText
=
VisualStudio
.
Editor
.
GetText
();
Assert
.
Contains
(
@"
...
...
@@ -104,7 +104,7 @@ Class C
VisualStudio
.
Editor
.
DialogSendKeys
(
DialogName
,
VirtualKey
.
Tab
);
VisualStudio
.
Editor
.
PressDialogButton
(
DialogName
,
"Down"
);
Dialog_ClickOk
();
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
var
actualText
=
VisualStudio
.
Editor
.
GetText
();
Assert
.
Contains
(
@"
...
...
@@ -140,7 +140,7 @@ Class C
VisualStudio
.
Editor
.
DialogSendKeys
(
DialogName
,
VirtualKey
.
Tab
);
VisualStudio
.
Editor
.
DialogSendKeys
(
DialogName
,
VirtualKey
.
Space
);
Dialog_ClickOk
();
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
var
actualText
=
VisualStudio
.
Editor
.
GetText
();
Assert
.
Contains
(
@"
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicGenerateEqualsAndGetHashCodeDialog.cs
浏览文件 @
ece3427f
...
...
@@ -68,7 +68,7 @@ Class C
VisualStudio
.
Editor
.
Verify
.
CodeAction
(
"Generate Equals(object)..."
,
applyFix
:
true
,
blockUntilComplete
:
false
);
VerifyDialog
(
isOpen
:
true
);
Dialog_ClickOk
();
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
var
actualText
=
VisualStudio
.
Editor
.
GetText
();
var
expectedText
=
@"
Imports TestProj
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicImmediate.cs
浏览文件 @
ece3427f
...
...
@@ -43,12 +43,12 @@ End Sub
End Module
"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
Debugger
.
SetBreakPoint
(
"Module1.vb"
,
"End Sub"
);
VisualStudio
.
Debugger
.
Go
(
waitForBreakMode
:
true
);
VisualStudio
.
ImmediateWindow
.
ShowImmediateWindow
(
clearAll
:
true
);
VisualStudio
.
SendKeys
.
Send
(
"?"
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
CompletionSet
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
CompletionSet
);
VisualStudio
.
SendKeys
.
Send
(
"n1"
,
VirtualKey
.
Tab
,
VirtualKey
.
Enter
);
Assert
.
Contains
(
"?n1Var\r\n42"
,
VisualStudio
.
ImmediateWindow
.
GetText
());
}
...
...
src/VisualStudio/IntegrationTest/IntegrationTests/Workspace/WorkspacesNetCore.cs
浏览文件 @
ece3427f
...
...
@@ -39,7 +39,7 @@ public override void MetadataReference()
</Project>"
);
VisualStudio
.
SolutionExplorer
.
SaveAll
();
VisualStudio
.
SolutionExplorer
.
RestoreNuGetPackages
(
project
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudio
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudio
.
SolutionExplorer
.
OpenFile
(
project
,
"Class1.cs"
);
base
.
MetadataReference
();
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/VisualStudioWorkspace_InProc.cs
浏览文件 @
ece3427f
...
...
@@ -108,8 +108,8 @@ private static IOption GetOption(string optionName, string feature, IOptionServi
private
static
TestingOnly_WaitingService
GetWaitingService
()
=>
GetComponentModel
().
DefaultExportProvider
.
GetExport
<
TestingOnly_WaitingService
>().
Value
;
public
void
WaitForAsyncOperations
(
string
featuresToWaitFor
,
bool
waitForWorkspaceFirst
=
true
)
=>
GetWaitingService
().
WaitForAsyncOperations
(
featuresToWaitFor
,
waitForWorkspaceFirst
);
public
void
WaitForAsyncOperations
(
TimeSpan
timeout
,
string
featuresToWaitFor
,
bool
waitForWorkspaceFirst
=
true
)
=>
GetWaitingService
().
WaitForAsyncOperations
(
timeout
,
featuresToWaitFor
,
waitForWorkspaceFirst
);
public
void
WaitForAllAsyncOperations
(
TimeSpan
timeout
,
params
string
[]
featureNames
)
=>
GetWaitingService
().
WaitForAllAsyncOperations
(
timeout
,
featureNames
);
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.Verifier.cs
浏览文件 @
ece3427f
...
...
@@ -187,8 +187,8 @@ public void CurrentSignature(string content)
public
void
ErrorTags
(
params
string
[]
expectedTags
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
var
actualTags
=
_textViewWindow
.
GetErrorTags
();
Assert
.
Equal
(
expectedTags
,
actualTags
);
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -93,7 +93,7 @@ public bool IsCompletionActive()
public
void
InvokeSignatureHelp
()
{
_instance
.
ExecuteCommand
(
WellKnownCommandNames
.
Edit_ParameterInfo
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SignatureHelp
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SignatureHelp
);
}
public
bool
IsSignatureHelpActive
()
...
...
@@ -118,7 +118,7 @@ public void InvokeNavigateTo(params object[] keys)
{
_instance
.
ExecuteCommand
(
WellKnownCommandNames
.
Edit_GoToAll
);
NavigateToSendKeys
(
keys
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigateTo
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigateTo
);
}
public
void
SelectTextInCurrentDocument
(
string
text
)
...
...
@@ -189,19 +189,19 @@ public void DialogSendKeys(string dialogAutomationName, params object[] keys)
public
void
FormatDocument
()
{
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
SendKeys
(
new
KeyPress
(
VirtualKey
.
K
,
ShiftState
.
Ctrl
),
new
KeyPress
(
VirtualKey
.
D
,
ShiftState
.
Ctrl
));
}
public
void
FormatDocumentViaCommand
()
{
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
VisualStudioInstance
.
Dte
.
ExecuteCommand
(
WellKnownCommandNames
.
Edit_FormatDocument
);
}
public
void
FormatSelection
()
{
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
SendKeys
(
new
KeyPress
(
VirtualKey
.
K
,
ShiftState
.
Ctrl
),
new
KeyPress
(
VirtualKey
.
F
,
ShiftState
.
Ctrl
));
}
...
...
@@ -241,79 +241,79 @@ public List<string> GetF1Keyword()
public
void
ExpandProjectNavBar
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
ExpandNavigationBar
(
0
);
}
public
void
ExpandTypeNavBar
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
ExpandNavigationBar
(
1
);
}
public
void
ExpandMemberNavBar
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
ExpandNavigationBar
(
2
);
}
public
string
[]
GetProjectNavBarItems
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetNavBarItems
(
0
);
}
public
string
[]
GetTypeNavBarItems
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetNavBarItems
(
1
);
}
public
string
[]
GetMemberNavBarItems
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetNavBarItems
(
2
);
}
public
string
GetProjectNavBarSelection
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetSelectedNavBarItem
(
0
);
}
public
string
GetTypeNavBarSelection
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetSelectedNavBarItem
(
1
);
}
public
string
GetMemberNavBarSelection
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
GetSelectedNavBarItem
(
2
);
}
public
void
SelectProjectNavbarItem
(
string
item
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
SelectNavBarItem
(
0
,
item
);
}
public
void
SelectTypeNavBarItem
(
string
item
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
SelectNavBarItem
(
1
,
item
);
}
public
void
SelectMemberNavBarItem
(
string
item
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
_editorInProc
.
SelectNavBarItem
(
2
,
item
);
}
public
bool
IsNavBarEnabled
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
NavigationBar
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
NavigationBar
);
return
_editorInProc
.
IsNavBarEnabled
();
}
...
...
@@ -322,7 +322,7 @@ public TextSpan[] GetKeywordHighlightTags()
public
TextSpan
[]
GetOutliningSpans
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Outlining
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Outlining
);
return
Deserialize
(
_editorInProc
.
GetOutliningSpans
());
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/ErrorList_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -27,10 +27,10 @@ public int ErrorListErrorCount
public
void
ShowErrorList
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorList
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorList
);
_inProc
.
ShowErrorList
();
}
...
...
@@ -42,19 +42,19 @@ public int GetErrorListErrorCount()
public
ErrorListItem
[]
GetErrorListContents
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorList
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorList
);
return
_inProc
.
GetErrorListContents
();
}
public
ErrorListItem
NavigateToErrorListItem
(
int
itemIndex
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorList
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorSquiggles
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorList
);
return
_inProc
.
NavigateToErrorListItem
(
itemIndex
);
}
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/ExtractInterfaceDialog_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -66,7 +66,7 @@ public bool CloseWindow()
public
void
ClickOK
()
{
DialogHelpers
.
PressButton
(
GetMainWindowHWnd
(),
ExtractInterfaceDialogID
,
"OkButton"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
/// <summary>
...
...
@@ -75,7 +75,7 @@ public void ClickOK()
public
void
ClickCancel
()
{
DialogHelpers
.
PressButton
(
GetMainWindowHWnd
(),
ExtractInterfaceDialogID
,
"CancelButton"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
/// <summary>
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/FindReferencesWindow_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -32,7 +32,7 @@ public Reference[] GetContents(string windowCaption)
// Go to Definition/Go to Implementation are synchronous so we don't need to wait for them
// (and currently can't, anyway); if they are made asynchronous we will need to wait for
// them here as well.
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
FindReferences
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
FindReferences
);
return
_inProc
.
GetContents
(
windowCaption
);
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/GenerateTypeDialog_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -83,7 +83,7 @@ public void SetTargetFileToExisting(string existingFileName)
public
void
ClickOK
()
{
DialogHelpers
.
PressButtonWithName
(
GetMainWindowHWnd
(),
GenerateTypeDialogID
,
"OK"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
/// <summary>
...
...
@@ -92,7 +92,7 @@ public void ClickOK()
public
void
ClickCancel
()
{
DialogHelpers
.
PressButtonWithName
(
GetMainWindowHWnd
(),
GenerateTypeDialogID
,
"Cancel"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
public
string
[]
GetNewFileComboBoxItems
()
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/InlineRenameDialog_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -20,25 +20,25 @@ public InlineRenameDialog_OutOfProc(VisualStudioInstance visualStudioInstance)
public
void
Invoke
()
{
VisualStudioInstance
.
ExecuteCommand
(
"Refactor.Rename"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
}
public
void
ToggleIncludeComments
()
{
VisualStudioInstance
.
Editor
.
SendKeys
(
new
KeyPress
(
VirtualKey
.
C
,
ShiftState
.
Alt
));
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
}
public
void
ToggleIncludeStrings
()
{
VisualStudioInstance
.
Editor
.
SendKeys
(
new
KeyPress
(
VirtualKey
.
S
,
ShiftState
.
Alt
));
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
}
public
void
ToggleIncludeOverloads
()
{
VisualStudioInstance
.
Editor
.
SendKeys
(
new
KeyPress
(
VirtualKey
.
O
,
ShiftState
.
Alt
));
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Rename
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Rename
);
}
}
}
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/OutOfProcComponent.cs
浏览文件 @
ece3427f
...
...
@@ -22,16 +22,16 @@ internal static TInProcComponent CreateInProcComponent<TInProcComponent>(VisualS
=>
visualStudioInstance
.
ExecuteInHostProcess
<
TInProcComponent
>(
type
:
typeof
(
TInProcComponent
),
methodName
:
"Create"
);
protected
void
WaitForCompletionSet
()
=>
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
CompletionSet
);
=>
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
CompletionSet
);
protected
void
WaitForSignatureHelp
()
=>
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SignatureHelp
);
=>
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SignatureHelp
);
protected
void
WaitForQuickInfo
()
{
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
ErrorSquiggles
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
QuickInfo
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
ErrorSquiggles
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
QuickInfo
);
}
}
}
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/PickMembersDialog_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -35,7 +35,7 @@ public bool CloseWindow()
public
void
ClickCancel
()
{
DialogHelpers
.
PressButton
(
GetMainWindowHWnd
(),
PickMembersDialogID
,
"CancelButton"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
private
IntPtr
GetMainWindowHWnd
()
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/PreviewChangesDialog_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -36,7 +36,7 @@ public void VerifyClosed(string expectedTitle)
public
void
ClickApplyAndWaitForFeature
(
string
expectedTitle
,
string
featureName
)
{
DialogHelpers
.
PressButtonWithNameFromDialogWithName
(
GetMainWindowHWnd
(),
expectedTitle
,
"Apply"
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
featureName
);
VisualStudioInstance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
featureName
);
}
public
void
ClickCancel
(
string
expectedTitle
)
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -45,37 +45,37 @@ public void OpenSolution(string path, bool saveExistingSolutionIfExists = false)
public
void
AddProject
(
ProjectUtils
.
Project
projectName
,
string
projectTemplate
,
string
languageName
)
{
_inProc
.
AddProject
(
projectName
.
Name
,
projectTemplate
,
languageName
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
AddCustomProject
(
ProjectUtils
.
Project
projectName
,
string
projectFileExtension
,
string
projectFileContent
)
{
_inProc
.
AddCustomProject
(
projectName
.
Name
,
projectFileExtension
,
projectFileContent
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
AddProjectReference
(
ProjectUtils
.
Project
fromProjectName
,
ProjectUtils
.
ProjectReference
toProjectName
)
{
_inProc
.
AddProjectReference
(
fromProjectName
.
Name
,
toProjectName
.
Name
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
RemoveProjectReference
(
ProjectUtils
.
Project
projectName
,
ProjectUtils
.
ProjectReference
projectReferenceName
)
{
_inProc
.
RemoveProjectReference
(
projectName
.
Name
,
projectReferenceName
.
Name
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
AddMetadataReference
(
ProjectUtils
.
AssemblyReference
fullyQualifiedAssemblyName
,
ProjectUtils
.
Project
projectName
)
{
_inProc
.
AddMetadataReference
(
fullyQualifiedAssemblyName
.
Name
,
projectName
.
Name
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
RemoveMetadataReference
(
ProjectUtils
.
AssemblyReference
assemblyName
,
ProjectUtils
.
Project
projectName
)
{
_inProc
.
RemoveMetadataReference
(
assemblyName
.
Name
,
projectName
.
Name
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
/// <summary>
...
...
@@ -114,7 +114,7 @@ public void OpenFile(ProjectUtils.Project project, string fileName)
{
// Wireup to open files can happen asynchronously in the case we're being notified of changes on background threads.
_inProc
.
OpenFile
(
project
.
Name
,
fileName
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
UpdateFile
(
string
projectName
,
string
fileName
,
string
contents
,
bool
open
=
false
)
...
...
@@ -124,14 +124,14 @@ public void RenameFile(ProjectUtils.Project project, string oldFileName, string
{
// Wireup to open files can happen asynchronously in the case we're being notified of changes on background threads.
_inProc
.
RenameFile
(
project
.
Name
,
oldFileName
,
newFileName
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
RenameFileViaDTE
(
ProjectUtils
.
Project
project
,
string
oldFileName
,
string
newFileName
)
{
// Wireup to open files can happen asynchronously in the case we're being notified of changes on background threads.
_inProc
.
RenameFileViaDTE
(
project
.
Name
,
oldFileName
,
newFileName
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
CloseDesignerFile
(
ProjectUtils
.
Project
project
,
string
fileName
,
bool
saveFile
)
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/TextViewWindow_OutOfProc.Verifier.cs
浏览文件 @
ece3427f
...
...
@@ -77,7 +77,7 @@ public Verifier(TTextViewWindow textViewWindow, VisualStudioInstance instance)
if
(
blockUntilComplete
)
{
// wait for action to complete
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
}
}
...
...
@@ -92,9 +92,9 @@ public void CodeActionsNotShowing()
public
void
CurrentTokenType
(
string
tokenType
)
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Classification
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Classification
);
var
actualTokenTypes
=
_textViewWindow
.
GetCurrentClassifications
();
Assert
.
Equal
(
actualTokenTypes
.
Length
,
1
);
Assert
.
Contains
(
tokenType
,
actualTokenTypes
[
0
]);
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/TextViewWindow_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -84,17 +84,17 @@ public void ApplyLightBulbAction(string action, FixAllScope? fixAllScope, bool b
public
void
InvokeCompletionList
()
{
_instance
.
ExecuteCommand
(
WellKnownCommandNames
.
Edit_ListMembers
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
CompletionSet
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
CompletionSet
);
}
public
void
InvokeCodeActionList
()
{
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
DiagnosticService
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
SolutionCrawler
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
DiagnosticService
);
ShowLightBulb
();
WaitForLightBulbSession
();
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
LightBulb
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
LightBulb
);
}
/// <summary>
...
...
@@ -110,7 +110,7 @@ public void InvokeCodeActionListWithoutWaiting()
public
void
InvokeQuickInfo
()
{
_instance
.
ExecuteCommand
(
WellKnownCommandNames
.
Edit_QuickInfo
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
QuickInfo
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
QuickInfo
);
}
}
}
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/VisualStudioWorkspace_OutOfProc.cs
浏览文件 @
ece3427f
...
...
@@ -22,7 +22,7 @@ internal VisualStudioWorkspace_OutOfProc(VisualStudioInstance visualStudioInstan
public
void
SetOptionInfer
(
string
projectName
,
bool
value
)
{
_inProc
.
SetOptionInfer
(
projectName
,
value
);
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
WaitForAsyncOperations
(
Helper
.
HangMitigatingTimeout
,
FeatureAttribute
.
Workspace
);
}
public
void
SetPersistenceOption
(
bool
value
)
...
...
@@ -40,8 +40,8 @@ public void SetPerLanguageOption(string optionName, string feature, string langu
public
void
SetOption
(
string
optionName
,
string
feature
,
object
value
)
=>
_inProc
.
SetOption
(
optionName
,
feature
,
value
);
public
void
WaitForAsyncOperations
(
string
featuresToWaitFor
,
bool
waitForWorkspaceFirst
=
true
)
=>
_inProc
.
WaitForAsyncOperations
(
featuresToWaitFor
,
waitForWorkspaceFirst
);
public
void
WaitForAsyncOperations
(
TimeSpan
timeout
,
string
featuresToWaitFor
,
bool
waitForWorkspaceFirst
=
true
)
=>
_inProc
.
WaitForAsyncOperations
(
timeout
,
featuresToWaitFor
,
waitForWorkspaceFirst
);
public
void
WaitForAllAsyncOperations
(
TimeSpan
timeout
,
params
string
[]
featureNames
)
=>
_inProc
.
WaitForAllAsyncOperations
(
timeout
,
featureNames
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录