mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 06:47:25 +08:00
Added back a modified test case
Added a simple test for Ctrl+Shift+T.
This commit is contained in:
parent
16a1039522
commit
bd32dbdc2f
@ -208,6 +208,41 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddAssert("All channels closed", () => !channelManager.JoinedChannels.Any());
|
||||
}
|
||||
|
||||
// Control-Shift-T should reopen the most recently closed tab that has not
|
||||
// already been reopened
|
||||
private void pressControlShiftT()
|
||||
{
|
||||
AddStep("Press and hold Control", () => InputManager.PressKey(Key.ControlLeft));
|
||||
AddStep("Press and hold Shift", () => InputManager.PressKey(Key.ShiftLeft));
|
||||
AddStep("Press T", () => InputManager.Key(Key.T));
|
||||
AddStep("Release Control", () => InputManager.ReleaseKey(Key.ControlLeft));
|
||||
AddStep("Release Shift", () => InputManager.ReleaseKey(Key.ShiftLeft));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtrlShiftTShortcut1()
|
||||
{
|
||||
AddStep("Join 2 channels", () =>
|
||||
{
|
||||
channelManager.JoinChannel(channel1);
|
||||
channelManager.JoinChannel(channel2);
|
||||
});
|
||||
|
||||
// Close channel 2
|
||||
AddStep("Select channel 2", () => clickDrawable(chatOverlay.TabMap[channel2]));
|
||||
AddStep("Close channel 2", () => clickDrawable(((TestPrivateChannelTabItem)chatOverlay.TabMap[channel2]).CloseButton.Child));
|
||||
AddAssert("channel 1 open", () => channelManager.JoinedChannels.Contains(channel1));
|
||||
AddAssert("channel 2 closed", () => !channelManager.JoinedChannels.Contains(channel2));
|
||||
|
||||
AddStep("Select channel 1", () => clickDrawable(chatOverlay.TabMap[channel1]));
|
||||
|
||||
pressControlShiftT();
|
||||
|
||||
// Channel 2 should now be open again
|
||||
AddAssert("channel 1 open", () => channelManager.JoinedChannels.Contains(channel1));
|
||||
AddAssert("channel 2 open", () => channelManager.JoinedChannels.Contains(channel2));
|
||||
}
|
||||
|
||||
private void pressChannelHotkey(int number)
|
||||
{
|
||||
var channelKey = Key.Number0 + number;
|
||||
|
Loading…
Reference in New Issue
Block a user