feat(ads/seo/release): v1.2.0 with live Google Ads, isolated ad profile, ads.txt, and SEO/AEO/GEO optimization
This commit is contained in:
parent
a88aafa1e5
commit
0e568f1f0a
975 changed files with 130593 additions and 16783 deletions
65
tests/Paca.Tests/App/DesktopOmniboxIntegrationGateTests.cs
Normal file
65
tests/Paca.Tests/App/DesktopOmniboxIntegrationGateTests.cs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
using Paca.Browser.Search;
|
||||
using Paca.Browser.Url;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.App;
|
||||
|
||||
public class DesktopOmniboxIntegrationGateTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("yt 아이유", "https://www.youtube.com/results?search_query=")]
|
||||
[InlineData("w 인공지능", "https://en.wikipedia.org/wiki/Special:Search?search=")]
|
||||
[InlineData("g PACA", "https://www.google.com/search?q=")]
|
||||
[InlineData("n 네이버페이", "https://search.naver.com/search.naver?query=")]
|
||||
[InlineData("c 치지직라이브", "https://chzzk.naver.com/search?query=")]
|
||||
public void Gate_DesktopOmnibox_KeywordEngine_ResolvesBangs_IntoDestinationUrl(string input, string expectedUrlPrefix)
|
||||
{
|
||||
var engine = new OmniboxKeywordEngine();
|
||||
bool resolved = engine.TryResolve(input, out var result);
|
||||
|
||||
Assert.True(resolved, $"입력 '{input}'이 검색엔진 키워드로 해석되어야 한다.");
|
||||
Assert.NotNull(result);
|
||||
Assert.StartsWith(expectedUrlPrefix, result.ResolvedUrl);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("@tabs paca", OmniboxSearchScope.Tabs, "paca")]
|
||||
[InlineData("@기록 유튜브", OmniboxSearchScope.History, "유튜브")]
|
||||
[InlineData("@bookmarks 깃허브", OmniboxSearchScope.Bookmarks, "깃허브")]
|
||||
public void Gate_DesktopOmnibox_ScopeFilter_DetectsScopesAndQueries(string input, OmniboxSearchScope expectedScope, string expectedQuery)
|
||||
{
|
||||
var filter = new OmniboxScopeFilter();
|
||||
var res = filter.Parse(input);
|
||||
|
||||
Assert.True(res.IsScoped);
|
||||
Assert.Equal(expectedScope, res.Scope);
|
||||
Assert.Equal(expectedQuery, res.Query);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate_DesktopOmnibox_HardRefresh_RecognizesCtrlF5_AndCtrlShiftR()
|
||||
{
|
||||
var ctrlF5 = HardRefreshEngine.EvaluateRefresh(ctrl: true, shift: false, isF5: true);
|
||||
Assert.Equal(RefreshType.HardClearCache, ctrlF5);
|
||||
|
||||
var ctrlShiftR = HardRefreshEngine.EvaluateRefresh(ctrl: true, shift: true, isF5: false, isR: true);
|
||||
Assert.Equal(RefreshType.HardClearCache, ctrlShiftR);
|
||||
|
||||
var req = HardRefreshEngine.CreateRequest("https://paca.stream", ctrlF5);
|
||||
Assert.True(req.ClearMemoryCache);
|
||||
Assert.True(req.ClearDiskCache);
|
||||
Assert.True(req.Headers.ContainsKey("Cache-Control"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate_DesktopOmnibox_CleanLinkExtractor_RemovesTrackingAndAmp()
|
||||
{
|
||||
var dirtyUrl = "https://www.google.com/amp/s/example.com/article?utm_source=twitter&utm_medium=social&fbclid=IwAR123";
|
||||
var res = CleanLinkExtractor.ExtractCleanUrl(dirtyUrl);
|
||||
|
||||
Assert.NotNull(res);
|
||||
Assert.DoesNotContain("utm_source", res.CleanedUrl);
|
||||
Assert.DoesNotContain("fbclid", res.CleanedUrl);
|
||||
Assert.DoesNotContain("google.com/amp", res.CleanedUrl);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue