提交 b9d0f4ca 编写于 作者: D Dustin Campbell

Update integration test waiters to MEF v2

上级 ae5bf1ae
......@@ -15,6 +15,33 @@
<RestorePackages>true</RestorePackages>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup Label="File References">
<Reference Include="System.Collections.Immutable">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Composition.AttributedModel">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Convention">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Hosting">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Runtime">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Composition.TypedParts">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
......@@ -60,11 +87,6 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Collections.Immutable">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
......
......@@ -2,21 +2,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Roslyn.Test.Utilities;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Export]
[Export, Shared]
public class TestingOnly_WaitingService
{
[ImportMany]
private IEnumerable<Lazy<IAsynchronousOperationWaiter, FeatureMetadata>> _waiters = null;
private readonly IEnumerable<Lazy<IAsynchronousOperationWaiter, FeatureMetadata>> _waiters;
[ImportingConstructor]
private TestingOnly_WaitingService([ImportMany] IEnumerable<Lazy<IAsynchronousOperationWaiter, FeatureMetadata>> waiters)
{
this._waiters = waiters;
}
private void WaitForAsyncOperations(
Func<FeatureMetadata, bool> predicate,
......@@ -105,8 +108,7 @@ public IEnumerable<string> GetTotalFeatures()
public IEnumerable<string> GetActiveFeatures()
{
var activeFeatures = from w in _waiters where w.Value.HasPendingWork select w.Metadata.FeatureName;
return activeFeatures;
return from w in _waiters where w.Value.HasPendingWork select w.Metadata.FeatureName;
}
public void EnableActiveTokenTracking(bool enable)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.AutomaticPairCompletion)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.AutomaticEndConstructCorrection)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.BraceHighlighting)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.Classification)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.CompletionSet)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.DesignerAttribute)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.DiagnosticService)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.ErrorList)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.ErrorSquiggles)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.EventHookup)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.GlobalOperation)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.GraphProvider)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.KeywordHighlighting)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.LightBulb)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
// This doesn't need to be an EditorAdornmentWaiter, since we control our own
// adornment layer
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.LineSeparators)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.NavigateTo)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.NavigationBar)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.Outlining)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.QuickInfo)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.ReferenceHighlighting)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.Rename)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.SignatureHelp)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.SolutionCrawler)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.TodoCommentList)]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
namespace Roslyn.Hosting.Diagnostics.Waiters
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.Workspace)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册