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
88
tests/Paca.Tests/Core/RemoteClipboardBridgeGateTests.cs
Normal file
88
tests/Paca.Tests/Core/RemoteClipboardBridgeGateTests.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using Paca.Mobile.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Core;
|
||||
|
||||
public class RemoteClipboardBridgeGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate309_RemoteClipboardBridge_SanitizesAndBlocksDangerousSchemes()
|
||||
{
|
||||
// Allowed HTTP / HTTPS
|
||||
var validHttps = "https://www.youtube.com/watch?v=remote123";
|
||||
Assert.True(RemoteClipboardBridge.IsValidMediaUrl(validHttps, out var cleanUrl1));
|
||||
Assert.Equal(validHttps, cleanUrl1);
|
||||
|
||||
// Block javascript: injection
|
||||
var dangerous1 = "javascript:alert(1)";
|
||||
Assert.False(RemoteClipboardBridge.IsValidMediaUrl(dangerous1, out _));
|
||||
|
||||
// Block local file scheme
|
||||
var dangerous2 = "file:///C:/Windows/System32/calc.exe";
|
||||
Assert.False(RemoteClipboardBridge.IsValidMediaUrl(dangerous2, out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate310_RemoteClipboardBridge_SerializesAndDeserializes_Correctly()
|
||||
{
|
||||
var payload = new RemoteClipboardPayload(
|
||||
Url: "https://instagram.com/reel/abc999",
|
||||
SourceDeviceName: "Galaxy S24",
|
||||
TargetDeviceName: "Paca Desktop",
|
||||
AutoStartDownload: true,
|
||||
SentAt: new DateTime(2026, 9, 4, 20, 30, 0, DateTimeKind.Utc)
|
||||
);
|
||||
|
||||
var json = RemoteClipboardBridge.Serialize(payload);
|
||||
Assert.Contains("instagram.com", json);
|
||||
Assert.Contains("Galaxy S24", json);
|
||||
|
||||
var restored = RemoteClipboardBridge.Deserialize(json);
|
||||
Assert.NotNull(restored);
|
||||
Assert.Equal(payload.Url, restored!.Url);
|
||||
Assert.Equal(payload.SourceDeviceName, restored.SourceDeviceName);
|
||||
Assert.True(restored.AutoStartDownload);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate311_RemoteClipboardBridge_BuildsPushRequest_WithGatewayEndpoint()
|
||||
{
|
||||
var payload = new RemoteClipboardPayload(
|
||||
Url: "https://tiktok.com/@creator/video/111",
|
||||
SourceDeviceName: "iPhone 15",
|
||||
TargetDeviceName: "Office PC",
|
||||
AutoStartDownload: true,
|
||||
SentAt: DateTime.UtcNow
|
||||
);
|
||||
|
||||
var targetGateway = "http://192.168.1.100:52100";
|
||||
var pairingToken = "PACA-SEC-998877";
|
||||
|
||||
var (requestUri, bodyJson, authHeader) = RemoteClipboardBridge.BuildPushRequest(
|
||||
payload, targetGateway, pairingToken);
|
||||
|
||||
Assert.Equal("http://192.168.1.100:52100/api/remote-clipboard", requestUri);
|
||||
Assert.Equal("Bearer PACA-SEC-998877", authHeader);
|
||||
Assert.Contains("tiktok.com", bodyJson);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate312_RemoteClipboardBridge_HandlesIncomingPayload_AndDeterminesAutoDownload()
|
||||
{
|
||||
var payload = new RemoteClipboardPayload(
|
||||
Url: "https://www.youtube.com/watch?v=goodvideo",
|
||||
SourceDeviceName: "Mobile",
|
||||
TargetDeviceName: "Desktop",
|
||||
AutoStartDownload: true,
|
||||
SentAt: DateTime.UtcNow
|
||||
);
|
||||
|
||||
var result = RemoteClipboardBridge.ProcessIncomingPayload(payload);
|
||||
|
||||
Assert.True(result.Success);
|
||||
Assert.True(result.ShouldTriggerDownload);
|
||||
Assert.Equal("https://www.youtube.com/watch?v=goodvideo", result.MediaUrl);
|
||||
Assert.Equal("Mobile 기기에서 보낸 링크를 즉시 다운로드합니다.", result.UserStatusMessage);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue