From acd1f1dd610e388373385bfb50dc6b6ac79f8bc9 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Thu, 15 Dec 2016 05:46:21 -0800 Subject: [PATCH] rename following PR feedback --- .../Remote/InProcRemostHostClient.cs | 16 ++++++++-------- .../Mocks/InProcRemoteHostClientFactory.cs | 2 +- .../Services/ServiceHubServicesTests.cs | 6 +++--- .../Remote/RemoteHostClientFactory.cs | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs b/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs index b958139dec0..5a6f76dd383 100644 --- a/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs +++ b/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs @@ -21,9 +21,9 @@ internal class InProcRemoteHostClient : RemoteHostClient private readonly InProcRemoteServices _inprocServices; private readonly JsonRpc _rpc; - public static async Task CreateAsync(Workspace workspace, bool forTesting, CancellationToken cancellationToken) + public static async Task CreateAsync(Workspace workspace, bool runCacheCleanup, CancellationToken cancellationToken) { - var inprocServices = new InProcRemoteServices(forTesting); + var inprocServices = new InProcRemoteServices(runCacheCleanup); var remoteHostStream = await inprocServices.RequestServiceAsync(WellKnownRemoteHostServices.RemoteHostService, cancellationToken).ConfigureAwait(false); @@ -88,11 +88,11 @@ public class ServiceProvider : IServiceProvider private readonly AssetStorage _storage; - public ServiceProvider(bool forTesting) + public ServiceProvider(bool runCacheCleanup) { - _storage = forTesting ? - new AssetStorage() : - new AssetStorage(cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1)); + _storage = runCacheCleanup ? + new AssetStorage(cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1)) : + new AssetStorage(); } public AssetStorage AssetStorage => _storage; @@ -117,9 +117,9 @@ private class InProcRemoteServices { private readonly ServiceProvider _serviceProvider; - public InProcRemoteServices(bool forTesting) + public InProcRemoteServices(bool runCacheCleanup) { - _serviceProvider = new ServiceProvider(forTesting); + _serviceProvider = new ServiceProvider(runCacheCleanup); } public AssetStorage AssetStorage => _serviceProvider.AssetStorage; diff --git a/src/VisualStudio/Core/Test.Next/Mocks/InProcRemoteHostClientFactory.cs b/src/VisualStudio/Core/Test.Next/Mocks/InProcRemoteHostClientFactory.cs index f8e5b523886..995c41d48eb 100644 --- a/src/VisualStudio/Core/Test.Next/Mocks/InProcRemoteHostClientFactory.cs +++ b/src/VisualStudio/Core/Test.Next/Mocks/InProcRemoteHostClientFactory.cs @@ -15,7 +15,7 @@ internal class InProcRemoteHostClientFactory : IRemoteHostClientFactory { public Task CreateAsync(Workspace workspace, CancellationToken cancellationToken) { - return InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: cancellationToken); + return InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: cancellationToken); } } } diff --git a/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs b/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs index 104e4309c38..2344c644346 100644 --- a/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs +++ b/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs @@ -45,7 +45,7 @@ public async Task TestRemoteHostSynchronize() using (var workspace = await TestWorkspace.CreateCSharpAsync(code)) { - var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: CancellationToken.None)); + var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: CancellationToken.None)); var solution = workspace.CurrentSolution; @@ -63,7 +63,7 @@ public async Task TestRemoteHostSynchronizeIncrementalUpdate() { using (var workspace = await TestWorkspace.CreateCSharpAsync(Array.Empty(), metadataReferences: null)) { - var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: CancellationToken.None)); + var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: CancellationToken.None)); var solution = Populate(workspace.CurrentSolution.RemoveProject(workspace.CurrentSolution.ProjectIds.First())); @@ -284,7 +284,7 @@ private static Solution AddProject(Solution solution, string language, string[] private static RemoteHostService CreateService() { var stream = new MemoryStream(); - return new RemoteHostService(stream, new InProcRemoteHostClient.ServiceProvider(forTesting: true)); + return new RemoteHostService(stream, new InProcRemoteHostClient.ServiceProvider(runCacheCleanup: false)); } public static void SetEqual(IEnumerable expected, IEnumerable actual) diff --git a/src/VisualStudio/RemoteHostClientMock/Remote/RemoteHostClientFactory.cs b/src/VisualStudio/RemoteHostClientMock/Remote/RemoteHostClientFactory.cs index df82b83ebef..ed853385305 100644 --- a/src/VisualStudio/RemoteHostClientMock/Remote/RemoteHostClientFactory.cs +++ b/src/VisualStudio/RemoteHostClientMock/Remote/RemoteHostClientFactory.cs @@ -21,7 +21,7 @@ public async Task CreateAsync(Workspace workspace, Cancellatio // this is the point where we can create different kind of remote host client in future (cloud or etc) if (workspace.Options.GetOption(RemoteHostClientFactoryOptions.RemoteHost_InProc)) { - return await InProcRemoteHostClient.CreateAsync(workspace, forTesting: false, cancellationToken: cancellationToken).ConfigureAwait(false); + return await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: true, cancellationToken: cancellationToken).ConfigureAwait(false); } return await ServiceHubRemoteHostClient.CreateAsync(workspace, cancellationToken).ConfigureAwait(false); -- GitLab