aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp')
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp
new file mode 100644
index 00000000..3b876e4e
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp
@@ -0,0 +1,38 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3#include "precomp.h"
4
5HRESULT RunShutdownEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 )
9{
10 HRESULT hr = S_OK;
11 TestEngine* pTestEngine = NULL;
12
13 pTestEngine = new TestEngine();
14 ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
15
16 hr = pTestEngine->Initialize(wzBundleFilePath);
17 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
18
19 hr = pTestEngine->LoadBA(wzBAFilePath);
20 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
21
22 hr = pTestEngine->SendStartupEvent();
23 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
24
25 hr = pTestEngine->SimulateQuit(0);
26 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to simulate quit.");
27
28 hr = pTestEngine->RunApplication();
29 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
30
31 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
32 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
33
34 pTestEngine->UnloadBA();
35
36LExit:
37 return hr;
38}