Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixed Issue #10792. Created an Out Of Browser enabled integration tes…
…t project. Fixed some poor XML parsing of the AppManifest.xaml (there's prob better way to parse it than this fix - but it seems to work)
- Loading branch information
1 parent
4f29ab8
commit 52a1e54
Showing
10 changed files
with
261 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="StatLight.IntegrationTests.OutOfBrowser.App" | ||
> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using System.Windows; | ||
using Microsoft.Silverlight.Testing; | ||
|
||
namespace StatLight.IntegrationTests.OutOfBrowser | ||
{ | ||
public partial class App : Application | ||
{ | ||
|
||
public App() | ||
{ | ||
this.Startup += this.Application_Startup; | ||
this.Exit += this.Application_Exit; | ||
this.UnhandledException += this.Application_UnhandledException; | ||
|
||
InitializeComponent(); | ||
} | ||
|
||
private void Application_Startup(object sender, StartupEventArgs e) | ||
{ | ||
this.RootVisual = UnitTestSystem.CreateTestPage(); | ||
} | ||
|
||
private void Application_Exit(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) | ||
{ | ||
// If the app is running outside of the debugger then report the exception using | ||
// the browser's exception mechanism. On IE this will display it a yellow alert | ||
// icon in the status bar and Firefox will display a script error. | ||
if (!System.Diagnostics.Debugger.IsAttached) | ||
{ | ||
|
||
// NOTE: This will allow the application to continue running after an exception has been thrown | ||
// but not handled. | ||
// For production applications this error handling should be replaced with something that will | ||
// report the error to the website and stop the application. | ||
e.Handled = true; | ||
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); | ||
} | ||
} | ||
|
||
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) | ||
{ | ||
try | ||
{ | ||
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; | ||
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); | ||
|
||
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/StatLight.IntegrationTests.OutOfBrowser/Properties/AppManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Deployment.Parts> | ||
</Deployment.Parts> | ||
</Deployment> |
35 changes: 35 additions & 0 deletions
35
src/StatLight.IntegrationTests.OutOfBrowser/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("StatLight.IntegrationTests.OutOfBrowser")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("StatLight.IntegrationTests.OutOfBrowser")] | ||
[assembly: AssemblyCopyright("Copyright © 2010")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("08c5d1b0-afd1-4025-b5bb-ec86610a6d38")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
7 changes: 7 additions & 0 deletions
7
src/StatLight.IntegrationTests.OutOfBrowser/Properties/OutOfBrowserSettings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<OutOfBrowserSettings ShortName="StatLight.IntegrationTests.OutOfBrowser Application" EnableGPUAcceleration="False" ShowInstallMenuItem="True"> | ||
<OutOfBrowserSettings.Blurb>StatLight.IntegrationTests.OutOfBrowser Application on your desktop; at home, at work or on the go.</OutOfBrowserSettings.Blurb> | ||
<OutOfBrowserSettings.WindowSettings> | ||
<WindowSettings Title="StatLight.IntegrationTests.OutOfBrowser Application" /> | ||
</OutOfBrowserSettings.WindowSettings> | ||
<OutOfBrowserSettings.Icons /> | ||
</OutOfBrowserSettings> |
111 changes: 111 additions & 0 deletions
111
src/StatLight.IntegrationTests.OutOfBrowser/StatLight.IntegrationTests.OutOfBrowser.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.50727</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{CB2B6883-2461-4115-848C-DA79D20A3E0A}</ProjectGuid> | ||
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>StatLight.IntegrationTests.OutOfBrowser</RootNamespace> | ||
<AssemblyName>StatLight.IntegrationTests.OutOfBrowser</AssemblyName> | ||
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> | ||
<SilverlightApplication>true</SilverlightApplication> | ||
<SupportedCultures> | ||
</SupportedCultures> | ||
<XapOutputs>true</XapOutputs> | ||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest> | ||
<XapFilename>StatLight.IntegrationTests.OutOfBrowser.xap</XapFilename> | ||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate> | ||
<SilverlightAppEntry>StatLight.IntegrationTests.OutOfBrowser.App</SilverlightAppEntry> | ||
<TestPageFileName>StatLight.IntegrationTests.OutOfBrowserTestPage.html</TestPageFileName> | ||
<CreateTestPage>true</CreateTestPage> | ||
<ValidateXaml>true</ValidateXaml> | ||
<EnableOutOfBrowser>true</EnableOutOfBrowser> | ||
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile> | ||
<UsePlatformExtensions>false</UsePlatformExtensions> | ||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation> | ||
<LinkedServerProject> | ||
</LinkedServerProject> | ||
</PropertyGroup> | ||
<!-- This property group is only here to support building this project using the | ||
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs | ||
to set the TargetFrameworkVersion to v3.5 --> | ||
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>Bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> | ||
<NoStdLib>true</NoStdLib> | ||
<NoConfig>true</NoConfig> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>Bin\Release</OutputPath> | ||
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants> | ||
<NoStdLib>true</NoStdLib> | ||
<NoConfig>true</NoConfig> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Silverlight.Testing"> | ||
<HintPath>..\..\lib\Silverlight\Microsoft\April2010\Microsoft.Silverlight.Testing.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight"> | ||
<HintPath>..\..\lib\Silverlight\Microsoft\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath> | ||
</Reference> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="System.Windows" /> | ||
<Reference Include="system" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Net" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Windows.Browser" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
</Compile> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Tests.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="App.xaml"> | ||
<SubType>Designer</SubType> | ||
<Generator>MSBuild:Compile</Generator> | ||
</ApplicationDefinition> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Properties\AppManifest.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Properties\OutOfBrowserSettings.xml" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> | ||
<SilverlightProjectProperties /> | ||
</FlavorProperties> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace StatLight.IntegrationTests.OutOfBrowser | ||
{ | ||
[TestClass] | ||
public class Tests | ||
{ | ||
[TestMethod] | ||
public void Should_Run_this_passing_test() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters