Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions Microsoft.DotNet.Wpf.Test.sln
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementLayoutData", "src\Te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementLayoutTestPart1", "src\Test\ElementLayout\FeatureTests\Part1\ElementLayoutTestPart1.csproj", "{4A3C635A-23B8-4440-8000-AAFA3B83997D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RibbonApplicationScopeStyleApp_v45", "src\Test\Controls\FeatureTests\StandaloneProjects\v4.5\RibbonApplicationScopeStyle\RibbonApplicationScopeStyleApp_v45.csproj", "{8E3A5E91-B0FD-406E-962B-13E673EC15CC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RibbonQATApp_v45", "src\Test\Controls\FeatureTests\StandaloneProjects\v4.5\RibbonQAT\RibbonQATApp_v45.csproj", "{9F54E843-C5F1-4D3E-A88F-6D746874A8F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIAutomationTestApp_v45", "src\Test\Controls\FeatureTests\StandaloneProjects\v4.5\UIAutomation\UIAutomationTestApp_v45.csproj", "{01046683-A57C-4714-9844-9BBCCF0B09D4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsAutomationTest", "src\Test\Controls\FeatureTests\Automation\ControlsAutomationTest.csproj", "{A1F29E75-E416-4F39-BB70-DADB95F0551A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsTest", "src\Test\Controls\FeatureTests\ControlsTest\ControlsTest.csproj", "{D79EB389-2DB3-4659-80AE-CB6739B4D659}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeplexControls", "src\Test\Controls\FeatureTests\Samples\CodePlexControls\CodeplexControls.csproj", "{1CDF37DA-A84A-426B-AA1E-1A7C68A535BB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsCommon", "src\Test\Controls\FeatureTests\Common\ControlsCommon\ControlsCommon.csproj", "{4D081C66-6FD1-46F9-87D5-A0F420934D68}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsData", "src\Test\Controls\FeatureTests\Data\ControlsData.csproj", "{1B75529F-E632-4BB8-8657-4740F675709E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementServicesTest", "src\Test\ElementServices\FeatureTests\BuildSources\ElementServicesTest.csproj", "{8E9541C8-C7FB-4D27-B2F4-9C47F475F6E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreTestsTrusted", "src\Test\ElementServices\FeatureTests\Trusted\CoreTestsTrusted.csproj", "{1A7495C0-26CF-4FD7-8D16-7773CDA46B93}"
Expand Down
41 changes: 41 additions & 0 deletions src/Test/BranchCommon/data/DiscoveryInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,47 @@
</DefaultTestInfo>
</Target>

<!-- Area : Controls -->
<Target Adaptor="XtcAdaptor" Path="FeatureTests\Controls\*.xtc">
<DefaultTestInfo Area="Controls" Disabled="False" Priority="0" Type="Functional" UacElevation="Elevated">
<Driver Executable="sti.exe" />
<DriverParameters Assembly="ControlsCommon.dll" Class="Microsoft.Test.Controls.ControlsLoader" Method="RunTest" DefaultResult="Unknown" SecurityLevel="FullTrust" />
<SupportFiles>
<SupportFile Source="FeatureTests\Controls\ControlsCommon.dll" />
<SupportFile Source="FeatureTests\Controls\ControlsTest.dll" />
<SupportFile Source="Common\TestRuntime.dll" />
<SupportFile Source="Infra\TestApiCore.dll" />
<SupportFile Source="Infra\TestApiWpf.dll" />
<supportFile Source="Samples\Controls\CodePlexControls.dll" />
<SupportFile Source="FeatureTests\Controls\*.pict" />
<SupportFile Source="Common\Effects\pict*.exe" />
<SupportFile Source="FeatureTests\Controls\*.xtc" />
</SupportFiles>
<Versions>
<Version>3.0+</Version>
<Version>4.0Client+</Version>
</Versions>
</DefaultTestInfo>
</Target>

<Target Adaptor="VariationAttributeAdaptor" Path="FeatureTests\Controls\ControlsTest.dll">
<DefaultTestInfo Area="Controls" Disabled="False" Type="Functional" UacElevation="Elevated" Timeout="120">
<Driver Executable="sti.exe" />
<DriverParameters Method="Run" SecurityLevel="FullTrust" />
<SupportFiles>
<SupportFile Source="FeatureTests\Controls\ControlsCommon.dll" />
<SupportFile Source="FeatureTests\Controls\ControlsTest.dll" />
<SupportFile Source="Common\TestRuntime.dll" />
<SupportFile Source="Infra\TestApiCore.dll" />
<SupportFile Source="Infra\TestApiWpf.dll" />
<SupportFile Source="FeatureTests\Controls\ControlsAutomationTest.exe" />
</SupportFiles>
<Versions>
<Version>3.0+</Version>
<Version>4.0Client+</Version>
</Versions>
</DefaultTestInfo>
</Target>
<!-- Area : Diagnostics -->
<!-- VisualDiagnostics -->
<Target Adaptor="TestAttributeAdaptor" Path="FeatureTests\Diagnostics\VisualDiagnostics\VisualDiagnosticsLibrary.dll">
Expand Down
12 changes: 12 additions & 0 deletions src/Test/Common/Code/Microsoft/Test/Win32/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,18 @@ public static int GetShortPathName(string lpszLongPath, StringBuilder lpszShortP

[DllImport(ExternDll.Kernel32, SetLastError = true)]
public static extern bool FreeLibrary(IntPtr hModule);


/// <summary>Opens the clipboard for examination and prevents other applications from modifying the clipboard content.</summary>
/// <param name="hwndNewOwner">Handle to the window to be associated with the open clipboard. If this parameter is NULL, the open clipboard is associated with the current task.</param>
/// <returns>true if successfull, false otherwise.</returns>
[DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError = true)]
public static extern bool OpenClipboard(IntPtr hwndNewOwner);

/// <summary>Closes the clipboard.</summary>
/// <returns>true if successfull, false otherwise.</returns>
[DllImport(ExternDll.User32, ExactSpelling=true, CharSet=CharSet.Auto, SetLastError = true)]
public static extern bool CloseClipboard();
}


Expand Down
8 changes: 0 additions & 8 deletions src/Test/Controls/Controls.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApiCore", "..\Infra\Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternalUtilities", "..\Infra\TestUtilities\InternalUtilities\InternalUtilities.csproj", "{D48A1270-FD9B-4B5E-B7AF-6ACBC780F17B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsTestDev10", "FeatureTests\dev10\ControlsTestDev10.csproj", "{437EB163-8B50-474E-BFDE-33EC5C54E0EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlsData", "FeatureTests\Data\ControlsData.csproj", "{FFB69E5A-C6C9-46CA-AE08-AB116C31AE0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win8ThemeControlStatesTest", "FeatureTests\Win8ThemeTest\Win8ThemeControlStatesTest\Win8ThemeControlStatesTest.csproj", "{9E2141CC-429B-40E5-BF6F-D071842B9332}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win8AeroLiteTestApp", "FeatureTests\StandaloneProjects\v4.5\Win8AeroLiteTheme\Win8AeroLiteTestApp.csproj", "{3A32ED6F-0D50-4567-8FBA-58073BC637E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework.Design", "FeatureTests\dev10\PresentationFrameworkDesign\PresentationFramework.Design.csproj", "{DC6EB323-8178-426C-9386-BC8FBE67AE12}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
16 changes: 0 additions & 16 deletions src/Test/Controls/DRT/Controls/2-app/dirs.proj

This file was deleted.

21 changes: 0 additions & 21 deletions src/Test/Controls/DRT/Controls/dirs.proj

This file was deleted.

8 changes: 8 additions & 0 deletions src/Test/Controls/FeatureTests/Automation/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application x:Class="Microsoft.Test.Controls.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>

</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions src/Test/Controls/FeatureTests/Automation/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Windows;

namespace Microsoft.Test.Controls
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Page x:Class="Microsoft.Test.Controls.ButtonTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1">
<StackPanel>
<Button Content="Test" Name="button" Click="Button_Click"/>
<Label Name="result" Content="Wait for result..."/>
</StackPanel>
</Page>
21 changes: 21 additions & 0 deletions src/Test/Controls/FeatureTests/Automation/Button/Button.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Windows;
using System.Windows.Controls;

namespace Microsoft.Test.Controls
{
/// <summary>
/// Interaction logic for Page1.xaml
/// </summary>
public partial class ButtonTest : Page
{
public ButtonTest()
{
InitializeComponent();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
result.Content = "Pass";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="Microsoft.Test.Controls.CalendarTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Calendar">
<StackPanel>
<Calendar Name="calendar" DisplayDate="2003/2/2" SelectionMode="MultipleRange" />
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Windows.Controls;

namespace Microsoft.Test.Controls
{
/// <summary>
/// Interaction logic for Calendar.xaml
/// </summary>
public partial class CalendarTest : Page
{
public CalendarTest()
{
InitializeComponent();
calendar.SelectedDates.AddRange(startDate, endDate);
}

private DateTime startDate = new DateTime(2003, 2, 10);
private DateTime endDate = new DateTime(2003, 3, 30);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Page x:Class="Microsoft.Test.Controls.CalendarRegressionTest1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Calendar">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
<Button Name="result" Content="Pass" />
<Button Name="runTest" Content="Test" Click="RunTest_Click"/>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;

namespace Microsoft.Test.Controls
{
/// <summary>
/// Interaction logic for Calendar.xaml
/// Regression Test
/// </summary>
public partial class CalendarRegressionTest1 : Page
{
public CalendarRegressionTest1()
{
InitializeComponent();
}

// Ensure no exception occurs when create calendar and datepicker on separate STA threads
private void RunTest_Click(object sender, RoutedEventArgs e)
{
ThreadStart CreateCalendarAndDatePickerOnWorkerThread = () =>
{
Window window = new Window();
StackPanel panel = new StackPanel();
Calendar calendar = new Calendar();
DatePicker datepicker = new DatePicker();
panel.Children.Add(calendar);
panel.Children.Add(datepicker);
window.Content = panel;
window.ShowDialog();
};

TestOnSeparateSTAThreads(CreateCalendarAndDatePickerOnWorkerThread);

InputHelper.MouseClickCenter(result, MouseButton.Left);
}

// We need two threads to repro the bugs. That's why we use two threads for regression test.
private void TestOnSeparateSTAThreads(ThreadStart starter)
{
Thread thread1 = new Thread(starter);
thread1.SetApartmentState(ApartmentState.STA);
thread1.Start();

// We need to wait for one second to create another thread
DispatcherOperations.WaitFor(TimeSpan.FromSeconds(1));

Thread thread2 = new Thread(starter);
thread2.SetApartmentState(ApartmentState.STA);
thread2.Start();

// wait for one second to clean up the threads
DispatcherOperations.WaitFor(TimeSpan.FromSeconds(1));

// Clean up
Cleanup(thread1);
Cleanup(thread2);
}

void Cleanup(Thread thread)
{
Dispatcher dispatcher = Dispatcher.FromThread(thread);
dispatcher.InvokeShutdown();
thread.Join();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Window x:Class="Microsoft.Test.Controls.CalendarRegressionTest2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Microsoft.Test.Controls"
AutomationProperties.AutomationId="mainWindow"
Title="Window1" Height="500" Width="500">
<Grid x:Name="grid">
<Calendar AutomationProperties.AutomationId="testCalendar" SelectionMode="MultipleRange" />
</Grid>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System;
using System.Globalization;
using System.Diagnostics;

namespace Microsoft.Test.Controls
{
public partial class CalendarRegressionTest2 : Window
{
public CalendarRegressionTest2()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="Microsoft.Test.Controls.CalendarRegressionTest3"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="OnLoaded"
Title="Calendar">
<StackPanel Name="panel"/>
</Page>

Loading