47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
using System.IO;
|
|
using Paca.Browser;
|
|
using Paca.Tests.Infrastructure;
|
|
using Xunit;
|
|
|
|
namespace Paca.Tests.Browser;
|
|
|
|
public class ChromeParityMilestone32Tests
|
|
{
|
|
[Theory]
|
|
[InlineData("chrome://print", ChromeInternalAction.Print)]
|
|
[InlineData("paca://print", ChromeInternalAction.Print)]
|
|
[InlineData("chrome://newtab", ChromeInternalAction.NewTab)]
|
|
[InlineData("paca://newtab", ChromeInternalAction.NewTab)]
|
|
[InlineData("chrome://new-tab", ChromeInternalAction.NewTab)]
|
|
public void ChromeInternalUrlRouter_Maps_Print_And_NewTab(string url, ChromeInternalAction expected)
|
|
{
|
|
var action = ChromeInternalUrlRouter.Route(url);
|
|
Assert.Equal(expected, action);
|
|
}
|
|
|
|
[Fact]
|
|
public void GetSuggestions_Includes_Print_And_NewTab()
|
|
{
|
|
var printSuggestions = ChromeInternalUrlRouter.GetSuggestions("chrome://pri");
|
|
Assert.Single(printSuggestions);
|
|
Assert.Equal("chrome://print", printSuggestions[0].Url);
|
|
Assert.Contains("인쇄", printSuggestions[0].Title);
|
|
|
|
var newTabSuggestions = ChromeInternalUrlRouter.GetSuggestions("paca://new");
|
|
Assert.Single(newTabSuggestions);
|
|
Assert.Equal("paca://newtab", newTabSuggestions[0].Url);
|
|
Assert.Contains("새 탭", newTabSuggestions[0].Title);
|
|
}
|
|
|
|
[Fact]
|
|
public void MainWindow_Handles_Print_And_NewTab_Actions()
|
|
{
|
|
var csPath = SourceTree.AppPath("MainWindow.xaml.cs");
|
|
Assert.True(File.Exists(csPath), "MainWindow.xaml.cs 파일이 존재해야 합니다.");
|
|
var code = File.ReadAllText(csPath);
|
|
|
|
Assert.Contains("ChromeInternalAction.Print", code);
|
|
Assert.Contains("ChromeInternalAction.NewTab", code);
|
|
}
|
|
}
|