diff options
Diffstat (limited to 'toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp')
-rw-r--r-- | toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp b/toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp index 0e14de6b81..8bcfe018ee 100644 --- a/toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp +++ b/toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisUtils.cpp @@ -3,13 +3,35 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "TestContentAnalysisAgent.h" +#include "TestContentAnalysisUtils.h" #include <combaseapi.h> #include <pathcch.h> #include <shlwapi.h> #include <rpc.h> #include <windows.h> +MozAgentInfo LaunchAgentNormal(const wchar_t* aToBlock) { + nsString pipeName; + GeneratePipeName(L"contentanalysissdk-gtest-", pipeName); + return LaunchAgentNormal(aToBlock, pipeName); +} + +MozAgentInfo LaunchAgentNormal(const wchar_t* aToBlock, + const nsString& pipeName) { + nsString cmdLineArguments; + if (aToBlock && aToBlock[0] != 0) { + cmdLineArguments.Append(L" --toblock=.*"); + cmdLineArguments.Append(aToBlock); + cmdLineArguments.Append(L".*"); + } + cmdLineArguments.Append(L" --user"); + cmdLineArguments.Append(L" --path="); + cmdLineArguments.Append(pipeName); + MozAgentInfo agentInfo; + LaunchAgentWithCommandLineArguments(cmdLineArguments, pipeName, agentInfo); + return agentInfo; +} + void GeneratePipeName(const wchar_t* prefix, nsString& pipeName) { pipeName = u""_ns; pipeName.Append(prefix); |