forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSecondRuntimeTest.js
More file actions
24 lines (21 loc) · 850 Bytes
/
SecondRuntimeTest.js
File metadata and controls
24 lines (21 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export async function runSecondRuntimeAndTestStaticState() {
const { dotnet: dotnet2 } = await import('./_framework/dotnet.js?instance=2');
const runtime2 = await dotnet2
.withStartupMemoryCache(false)
.withConfig({
assetUniqueQuery: "?instance=2",
})
.create();
const increment1 = await getIncrementStateFunction(App.runtime);
const increment2 = await getIncrementStateFunction(runtime2);
increment1();
increment1();
increment2();
increment2();
const state2 = increment2();
return state2;
}
async function getIncrementStateFunction(runtime) {
const exports = await runtime.getAssemblyExports("System.Runtime.InteropServices.JavaScript.Tests.dll");
return exports.System.Runtime.InteropServices.JavaScript.Tests.SecondRuntimeTest.Interop.IncrementState;
}