Skip to content

Commit

Permalink
Improving test infra
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Desmaisons committed Aug 12, 2016
1 parent 2b97dae commit 5f29942
Show file tree
Hide file tree
Showing 39 changed files with 243 additions and 94 deletions.
1 change: 0 additions & 1 deletion HTML.WPF.Component/Internal/HTMLControlBase.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public partial class HTMLControlBase : IWebViewLifeCycleManager, IDisposable

public bool DebugContext => IsDebug;
public Uri Source => _WPFDoubleBrowserNavigator.Url;
public bool IsLoadInjectionSuported => _WPFDoubleBrowserNavigator.HTMLWindow is IHTMLModernWindow;

public bool IsDebug
{
Expand Down
18 changes: 18 additions & 0 deletions JavascriptEngine/VueUiFrameworkManager/VueUiFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
84 changes: 44 additions & 40 deletions MVVM.CEFGlue.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HTMLEngine.Awesomium;
using HTML_WPF.Component;
using IntegratedTest.Infra.Window;
using IntegratedTest.JavascriptUIFramework;
using UIFrameworkTesterHelper;
using KnockoutUIFramework;
using KnockoutUIFramework.Test.TestHtml;
using MVVM.HTML.Core.JavascriptUIFramework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ internal class AwesomiumWindowlessSharedJavascriptEngine : IWindowlessJavascript
private readonly IJavascriptUIFrameworkManager _JavascriptUIFrameworkManager;
private readonly TaskCompletionSource<object> _EndTaskCompletionSource;
private IWebView _CurrentWebView;
public bool AllowEarlyScriptInjection => false;

public AwesomiumWindowlessSharedJavascriptEngine(IJavascriptUIFrameworkManager javascriptUIFrameworkManager)
{
Expand All @@ -36,8 +35,7 @@ private async Task InitAsync(string ipath)
WebCore.QueueWork( () =>
{
_CurrentWebView = WebCore.CreateWebView(500, 500);
ipath = ipath ?? "javascript\\index.html";
var uri = new Uri($"{Assembly.GetExecutingAssembly().GetPath()}\\{ipath}");
var uri = new Uri(ipath);
_CurrentWebView.Source = uri;
WebView = new AwesomiumWebView(_CurrentWebView);
var htmlWindowProvider = new AwesomiumTestHTMLWindowProvider(WebView, uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
<Project>{3a9a7bf2-46ab-46b6-af62-9822181cf6ca}</Project>
<Name>KnockoutUIFramework.Test</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
</ProjectReference>
<ProjectReference Include="..\MVVM.Awesomium.TestInfra\MVVM.Awesomium.TestInfra.csproj">
<Project>{8955b9f6-b6e5-4fef-a5ab-90c35afb9cc6}</Project>
<Name>MVVM.Awesomium.TestInfra</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@
<Project>{36e61349-9c50-405a-b082-8b9340cb4e61}</Project>
<Name>IntegratedTest</Name>
</ProjectReference>
<ProjectReference Include="..\..\KnockoutUIFramework.Test\KnockoutUIFramework.Test.csproj">
<Project>{3a9a7bf2-46ab-46b6-af62-9822181cf6ca}</Project>
<Name>KnockoutUIFramework.Test</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
</ProjectReference>
<ProjectReference Include="..\MVVM.Awesomium.TestInfra\MVVM.Awesomium.TestInfra.csproj">
<Project>{8955b9f6-b6e5-4fef-a5ab-90c35afb9cc6}</Project>
<Name>MVVM.Awesomium.TestInfra</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public CefGlueWindowlessSharedJavascriptEngine(IJavascriptUIFrameworkManager jav
_JavascriptUIFrameworkManager = javascriptUIFrameworkManager;
}

public bool AllowEarlyScriptInjection => true;

public void Init(string path)
{
var cc = InitTask(path).Result;
Expand All @@ -35,7 +33,7 @@ public void Init(string path)

public HTMLViewEngine ViewEngine { get; private set; }

private Task<IHTMLWindowProvider> InitTask(string ipath)
private Task<IHTMLWindowProvider> InitTask(string fullpath)
{
TaskCompletionSource<IHTMLWindowProvider> tcs = new TaskCompletionSource<IHTMLWindowProvider>();
Task.Run(async () =>
Expand All @@ -50,8 +48,8 @@ private Task<IHTMLWindowProvider> InitTask(string ipath)
// Initialize some the cust interactions with the browser process.
var cefClient = new TestCefClient();

ipath = ipath ?? "javascript\\index.html";
string fullpath = $"{Assembly.GetExecutingAssembly().GetPath()}\\{ipath}";
//ipath = ipath ?? "javascript\\index.html";
//string fullpath = $"{Assembly.GetExecutingAssembly().GetPath()}\\{ipath}";

// Start up the browser instance.
CefBrowserHost.CreateBrowser(cefWindowInfo, cefClient, cefBrowserSettings, fullpath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HTMLEngine.CefGlue;
using HTML_WPF.Component;
using IntegratedTest.Infra.Window;
using IntegratedTest.JavascriptUIFramework;
using UIFrameworkTesterHelper;
using KnockoutUIFramework;
using KnockoutUIFramework.Test.TestHtml;
using MVVM.HTML.Core.JavascriptUIFramework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
<Project>{3a9a7bf2-46ab-46b6-af62-9822181cf6ca}</Project>
<Name>KnockoutUIFramework.Test</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\CefGlue.TestInfra\CefGlue.TestInfra.csproj">
<Project>{947cc0fa-7f1c-4cf9-a908-1a29ed232f19}</Project>
<Name>CefGlue.TestInfra</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@
<Project>{36e61349-9c50-405a-b082-8b9340cb4e61}</Project>
<Name>IntegratedTest</Name>
</ProjectReference>
<ProjectReference Include="..\..\KnockoutUIFramework.Test\KnockoutUIFramework.Test.csproj">
<Project>{3a9a7bf2-46ab-46b6-af62-9822181cf6ca}</Project>
<Name>KnockoutUIFramework.Test</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
</ProjectReference>
<ProjectReference Include="..\CefGlue.TestInfra\CefGlue.TestInfra.csproj">
<Project>{947cc0fa-7f1c-4cf9-a908-1a29ed232f19}</Project>
<Name>CefGlue.TestInfra</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using HTMEngine.ChromiumFX;
using HTML_WPF.Component;
using IntegratedTest.Infra.Window;
using IntegratedTest.JavascriptUIFramework;
using KnockoutUIFramework;
using KnockoutUIFramework.Test.TestHtml;
using MVVM.HTML.Core.JavascriptUIFramework;
using UIFrameworkTesterHelper;

namespace ChromiumFX.TestInfra
namespace ChromiumFX.TestInfra
{
public class ChromiumFXWindowKoTestEnvironment : WindowTestEnvironment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HTMEngine.ChromiumFX;
using HTML_WPF.Component;
using IntegratedTest.Infra.Window;
using IntegratedTest.JavascriptUIFramework;
using UIFrameworkTesterHelper;
using MVVM.HTML.Core.JavascriptUIFramework;
using VueUiFramework;
using VueUiFramework.Test.TestHtml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class ChromiumFXWindowlessJavascriptEngine : IWindowlessJavascriptEngine

public HTMLViewEngine ViewEngine { get; private set; }
public IWebView WebView { get; private set; }
public bool AllowEarlyScriptInjection => true;

internal ChromiumFXWindowlessJavascriptEngine(WpfThread wpfThread, Task<ChromiumFXWebView> chromiumFxWebViewTask, IJavascriptUIFrameworkManager frameWork)
{
Expand All @@ -33,8 +32,6 @@ internal ChromiumFXWindowlessJavascriptEngine(WpfThread wpfThread, Task<Chromium

public void Init(string path)
{
//path = path ?? "javascript\\index.html";
path = $"{Assembly.GetExecutingAssembly().GetPath()}\\{path}";
InitAsync(path).Wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ChromiumFX.Window.Integrated.Tests</RootNamespace>
<AssemblyName>ChromiumFX.Window.Integrated.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -32,6 +33,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="ChromiumFX, Version=3.2526.3.0, Culture=neutral, processorArchitecture=x86">
<HintPath>..\..\..\packages\Unofficial.Chromiumfx.3.2526.3\lib\ChromiumFX.dll</HintPath>
Expand Down Expand Up @@ -96,6 +115,10 @@
<Project>{36e61349-9c50-405a-b082-8b9340cb4e61}</Project>
<Name>IntegratedTest</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
</ProjectReference>
<ProjectReference Include="..\ChromiumFX.TestInfra\ChromiumFX.TestInfra.csproj">
<Project>{a82d4195-0f75-48b3-8e43-5be90d061c6c}</Project>
<Name>ChromiumFX.TestInfra</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@
<Project>{3a9a7bf2-46ab-46b6-af62-9822181cf6ca}</Project>
<Name>KnockoutUIFramework.Test</Name>
</ProjectReference>
<ProjectReference Include="..\..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
</ProjectReference>
<ProjectReference Include="..\ChromiumFX.TestInfra\ChromiumFX.TestInfra.csproj">
<Project>{a82d4195-0f75-48b3-8e43-5be90d061c6c}</Project>
<Name>ChromiumFX.TestInfra</Name>
Expand Down
18 changes: 18 additions & 0 deletions Tests/HTML_WPF.Component.Test/HTML_WPF.Component.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\..\packages\FluentAssertions.4.1.1\lib\net45\FluentAssertions.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions Tests/IntegratedTest/Infra/Window/IWindowTestEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using IntegratedTest.JavascriptUIFramework;
using MVVM.HTML.Core.JavascriptUIFramework;
using UIFrameworkTesterHelper;

namespace IntegratedTest.Infra.Window
namespace IntegratedTest.Infra.Window
{
public interface IWindowTestEnvironment : IDisposable
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/IntegratedTest/Infra/Window/WindowTestEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using HTML_WPF.Component;
using IntegratedTest.JavascriptUIFramework;
using MVVM.HTML.Core.JavascriptUIFramework;
using UIFrameworkTesterHelper;

namespace IntegratedTest.Infra.Window
namespace IntegratedTest.Infra.Window
{
public abstract class WindowTestEnvironment : IWindowTestEnvironment
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace IntegratedTest.Infra.Windowless
{
public interface IWindowlessJavascriptEngine : IDisposable
{
bool AllowEarlyScriptInjection { get; }
void Init(string path);
HTMLViewEngine ViewEngine { get; }
IWebView WebView { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using MVVM.HTML.Core.JavascriptEngine.JavascriptObject;
using MVVM.HTML.Core.JavascriptEngine.Window;
using Xunit.Abstractions;
using UIFrameworkTesterHelper;

namespace IntegratedTest.Infra.Windowless
{
Expand Down Expand Up @@ -43,7 +44,7 @@ protected void Test(Action act, TestContext ipath= TestContext.Index)
public IDisposable Tester(TestContext context = TestContext.Index)
{
var tester = _TestEnvironment.Build();
var path = _TestEnvironment.HtmlProvider.GetHtlmPath(context, tester.AllowEarlyScriptInjection);
var path = _TestEnvironment.HtmlProvider.GetHtlmPath(context);
tester.Init(path);
_ViewEngine = tester.ViewEngine;
_WebView = tester.WebView;
Expand Down
2 changes: 1 addition & 1 deletion Tests/IntegratedTest/Infra/Windowless/TestInContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
using IntegratedTest.JavascriptUIFramework;
using UIFrameworkTesterHelper;
using MVVM.HTML.Core;
using MVVM.HTML.Core.Binding;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using IntegratedTest.JavascriptUIFramework;
using MVVM.HTML.Core;
using MVVM.HTML.Core.Binding;
using UIFrameworkTesterHelper;

namespace IntegratedTest.Infra.Windowless
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using MVVM.HTML.Core.JavascriptEngine.JavascriptObject;
using MVVM.HTML.Core.JavascriptEngine.Window;
using MVVM.HTML.Core.JavascriptUIFramework;
using UIFrameworkTesterHelper;

namespace IntegratedTest.Infra.Windowless
{
Expand Down
7 changes: 5 additions & 2 deletions Tests/IntegratedTest/IntegratedTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
<Compile Include="JavascriptUIFramework\FrameworkTestContext.cs" />
<Compile Include="Infra\Windowless\TestInContextAsync.cs" />
<Compile Include="Infra\Windowless\TestIUIDispatcher.cs" />
<Compile Include="JavascriptUIFramework\ITestHtmlProvider.cs" />
<Compile Include="JavascriptUIFramework\TestContext.cs" />
<Compile Include="TestData\SimpleViewModel.cs" />
<Compile Include="Tests\Windowless\Test_WebView_Dispatcher.cs" />
<Compile Include="Tests\Windowless\Test_ConvertToJSO.cs" />
Expand Down Expand Up @@ -145,6 +143,11 @@
<Project>{e35b9010-5429-4ffe-a788-e9c40e743e9c}</Project>
<Name>MVVM.ViewModel</Name>
</ProjectReference>
<ProjectReference Include="..\UIFrameworkTesterHelper\UIFrameworkTesterHelper.csproj">
<Project>{d6f39e8c-bf8f-454e-8512-b46be149c339}</Project>
<Name>UIFrameworkTesterHelper</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="javascript\src\Koaddon.js">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using MVVM.HTML.Core.JavascriptEngine.JavascriptObject;
using MVVM.HTML.Core.JavascriptUIFramework;
using UIFrameworkTesterHelper;

namespace IntegratedTest.JavascriptUIFramework
{
Expand Down

This file was deleted.

Loading

0 comments on commit 5f29942

Please sign in to comment.