Version 5.3.4: Updated test code for V8ScriptEngine script interruption crash fix.

This commit is contained in:
ClearScript 2013-07-10 10:25:11 -04:00
Родитель bb907f56a6
Коммит c24c7ac12c
7 изменённых файлов: 30 добавлений и 37 удалений

Просмотреть файл

@ -63,5 +63,5 @@
#pragma once
#define CLEARSCRIPT_VERSION_STRING "5.3.3.0"
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 5,3,3,0
#define CLEARSCRIPT_VERSION_STRING "5.3.4.0"
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 5,3,4,0

Просмотреть файл

@ -73,5 +73,5 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("ClearScriptTest")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("5.3.3.0")]
[assembly: AssemblyFileVersion("5.3.3.0")]
[assembly: AssemblyVersion("5.3.4.0")]
[assembly: AssemblyFileVersion("5.3.4.0")]

Просмотреть файл

@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("© Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("5.3.3.0")]
[assembly: AssemblyFileVersion("5.3.3.0")]
[assembly: AssemblyVersion("5.3.4.0")]
[assembly: AssemblyFileVersion("5.3.4.0")]

Просмотреть файл

@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("© Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("5.3.3.0")]
[assembly: AssemblyFileVersion("5.3.3.0")]
[assembly: AssemblyVersion("5.3.4.0")]
[assembly: AssemblyFileVersion("5.3.4.0")]

Просмотреть файл

@ -146,33 +146,27 @@ namespace Microsoft.ClearScript.Test
[TestMethod, TestCategory("BugFix")]
public void BugFix_V8_ScriptInterruptCrash()
{
// A V8 fatal error on a background thread may not kill the process, so a single run is
// inconclusive. It will kill the V8 runtime, however, causing subsequent runs to fail.
// run the test several times to verify post-interrupt engine functionality
for (var iteration = 0; iteration < 16; iteration++)
{
var context = new PropertyBag();
engine.AddHostObject("context", context);
var startEvent = new ManualResetEventSlim(false);
var thread = new Thread(() =>
using (var startEvent = new ManualResetEventSlim(false))
{
context["startEvent"] = startEvent;
context["counter"] = 0;
var interrupted = false;
var thread = new Thread(() =>
{
try
{
engine.Execute(
@"
for (var i = 0; i < 10000000; i++ )
{
context.counter++;
context.startEvent.Set();
}
");
engine.Execute("while (true) { context.startEvent.Set(); }");
}
catch (ScriptInterruptedException)
{
interrupted = true;
}
});
@ -180,9 +174,8 @@ namespace Microsoft.ClearScript.Test
startEvent.Wait();
engine.Interrupt();
thread.Join();
var counter = (int)context["counter"];
Assert.IsTrue((counter > 0) && (counter < 10000000));
Assert.IsTrue(interrupted);
}
}
}

Просмотреть файл

@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("© Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("5.3.3.0")]
[assembly: AssemblyFileVersion("5.3.3.0")]
[assembly: AssemblyVersion("5.3.4.0")]
[assembly: AssemblyFileVersion("5.3.4.0")]

Просмотреть файл

@ -1 +1 @@
<# var version = new Version(5, 3, 3, 0); #>
<# var version = new Version(5, 3, 4, 0); #>