Browse Source

Add "Switch Layout" stress test.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5538 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
6f0b7e852a
  1. 44
      src/Tools/StressTest/StressTest/UserControl.xaml
  2. 15
      src/Tools/StressTest/StressTest/UserControl.xaml.cs

44
src/Tools/StressTest/StressTest/UserControl.xaml

@ -4,22 +4,34 @@ @@ -4,22 +4,34 @@
<ScrollViewer>
<StackPanel>
<StackPanel Orientation="Horizontal"><Label>Repetitions:</Label><TextBox Name="repetitionsTextBox" Text="1" Width="40"/></StackPanel>
<Button
Content="Open File"
Height="23"
Click="openFileButton_Click" />
<Button
Content="Type Comment in C# File"
Height="23"
Click="TypeTextButton_Click" />
<Button
Content="Erasing Text in C# code"
Height="23"
Click="EraseTextButton_Click" />
<Button
Content="Typing C# code"
Height="23"
Click="TypeCodeButton_Click" />
<Expander Header="Editor" IsExpanded="True">
<StackPanel>
<Button
Content="Open File"
Height="23"
Click="openFileButton_Click" />
<Button
Content="Type Comment in C# File"
Height="23"
Click="TypeTextButton_Click" />
<Button
Content="Erasing Text in C# code"
Height="23"
Click="EraseTextButton_Click" />
<Button
Content="Typing C# code"
Height="23"
Click="TypeCodeButton_Click" />
</StackPanel>
</Expander>
<Expander Header="Workbench" IsExpanded="True">
<StackPanel>
<Button
Content="Switch Layout"
Height="23"
Click="SwitchLayoutButton_Click" />
</StackPanel>
</Expander>
</StackPanel>
</ScrollViewer>
</UserControl>

15
src/Tools/StressTest/StressTest/UserControl.xaml.cs

@ -136,5 +136,20 @@ namespace StressTest @@ -136,5 +136,20 @@ namespace StressTest
}
vc.WorkbenchWindow.CloseWindow(true);
}
void SwitchLayoutButton_Click(object sender, RoutedEventArgs e)
{
Run("Switch Layout", SwitchLayout());
}
IEnumerable<DispatcherPriority> SwitchLayout()
{
for (int i = 0; i < Repetitions; i++) {
LayoutConfiguration.CurrentLayoutName = "Debug";
yield return DispatcherPriority.SystemIdle;
LayoutConfiguration.CurrentLayoutName = "Default";
yield return DispatcherPriority.SystemIdle;
}
}
}
}
Loading…
Cancel
Save