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
62
tests/Paca.Tests/App/ChromeTabDiscardingMegaTests.cs
Normal file
62
tests/Paca.Tests/App/ChromeTabDiscardingMegaTests.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using Paca.Browser.Tabs;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.App;
|
||||
|
||||
public class ChromeTabDiscardingMegaTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("메모리 절약")]
|
||||
[InlineData("절전 모드")]
|
||||
[InlineData("memory saver")]
|
||||
[InlineData("discard tabs")]
|
||||
public void Omnibox_Matches_DiscardTabs_Action(string query)
|
||||
{
|
||||
var actions = OmniboxActionEvaluator.GetMatchingActions(query);
|
||||
Assert.NotEmpty(actions);
|
||||
Assert.Contains(actions, a => a.ActionId == "action:discard-tabs");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DiscardPolicy_ProtectsPinnedAndAudioTabs()
|
||||
{
|
||||
var mgr = new TabManager(() => new TabItem());
|
||||
var activeTab = mgr.NewTab("https://example.com/1");
|
||||
var audioTab = mgr.NewTab("https://youtube.com", activate: false);
|
||||
audioTab.IsAudioPlaying = true;
|
||||
var pinnedTab = mgr.NewTab("https://mail.google.com", activate: false);
|
||||
pinnedTab.IsPinned = true;
|
||||
var normalTab = mgr.NewTab("https://news.ycombinator.com", activate: false);
|
||||
|
||||
Assert.False(mgr.CanDiscardTab(activeTab));
|
||||
Assert.False(mgr.CanDiscardTab(audioTab));
|
||||
Assert.False(mgr.CanDiscardTab(pinnedTab));
|
||||
Assert.True(mgr.CanDiscardTab(normalTab));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TabManager_DiscardOtherTabs_DiscardsOnlyEligibleTabs()
|
||||
{
|
||||
var mgr = new TabManager(() => new TabItem());
|
||||
var tab1 = mgr.NewTab("https://tab1.com"); // active
|
||||
var tab2 = mgr.NewTab("https://tab2.com", activate: false);
|
||||
tab2.IsPinned = true;
|
||||
var tab3 = mgr.NewTab("https://tab3.com", activate: false);
|
||||
tab3.IsAudioPlaying = true;
|
||||
var tab4 = mgr.NewTab("https://tab4.com", activate: false);
|
||||
var tab5 = mgr.NewTab("https://tab5.com", activate: false);
|
||||
|
||||
int discarded = mgr.DiscardOtherTabs();
|
||||
Assert.Equal(2, discarded);
|
||||
Assert.False(tab1.IsSuspended);
|
||||
Assert.False(tab2.IsSuspended);
|
||||
Assert.False(tab3.IsSuspended);
|
||||
Assert.True(tab4.IsSuspended);
|
||||
Assert.True(tab5.IsSuspended);
|
||||
|
||||
// Activating a suspended tab automatically resumes it
|
||||
mgr.Activate(tab4);
|
||||
Assert.False(tab4.IsSuspended);
|
||||
Assert.True(tab4.IsActive);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue