Merge remote-tracking branch 'origin/dev' into feat/custom-themes
This commit is contained in:
commit
f0ca703dfb
51 files changed
+207
-365
No files matched your search
@@ -51,18 +51,18 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('resolves ipfs cid links with the default ipfs.io gateway', () async {
|
||||
test('resolves ipfs cid links with the default Filebase gateway', () async {
|
||||
expect(
|
||||
await MessageUrlImageHelper.parse(
|
||||
'my picture: ipfs://bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly text',
|
||||
),
|
||||
'https://ipfs.io/ipfs/bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly',
|
||||
'https://ipfs.filebase.io/ipfs/bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly',
|
||||
);
|
||||
expect(
|
||||
await MessageUrlImageHelper.parse(
|
||||
'my picture: ipfs:bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly text',
|
||||
),
|
||||
'https://ipfs.io/ipfs/bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly',
|
||||
'https://ipfs.filebase.io/ipfs/bafybeibq75ws6nwk6wi473dch42wwy6woyj4dwdfy7nfz3buqx2caieoly',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -457,12 +457,12 @@ void main() {
|
||||
expect(AppSettings.fromJson(saved).showLinkImagesByDefault, isTrue);
|
||||
});
|
||||
|
||||
test('public IPFS gateway defaults to ipfs.io when never set', () {
|
||||
test('public IPFS gateway defaults to Filebase when never set', () {
|
||||
expect(
|
||||
AppSettings.fromJson({}).publicIpfsGateway,
|
||||
'https://ipfs.io/ipfs/',
|
||||
'https://ipfs.filebase.io/ipfs/',
|
||||
);
|
||||
expect(AppSettings().publicIpfsGateway, 'https://ipfs.io/ipfs/');
|
||||
expect(AppSettings().publicIpfsGateway, 'https://ipfs.filebase.io/ipfs/');
|
||||
});
|
||||
|
||||
test('public IPFS gateway keeps a saved empty value as deactivated', () {
|
||||
@@ -470,12 +470,8 @@ void main() {
|
||||
expect(AppSettings.fromJson(saved).publicIpfsGateway, isEmpty);
|
||||
});
|
||||
|
||||
test('public IPFS gateway keeps saved ipfs.io and dweb.link values', () {
|
||||
for (final gateway in [
|
||||
'https://ipfs.io/ipfs/',
|
||||
'https://dweb.link/ipfs/',
|
||||
'https://gateway.example.com/ipfs/',
|
||||
]) {
|
||||
test('public IPFS gateway keeps saved custom values', () {
|
||||
for (final gateway in ['https://gateway.example.com/ipfs/']) {
|
||||
final saved = AppSettings(publicIpfsGateway: gateway).toJson();
|
||||
expect(AppSettings.fromJson(saved).publicIpfsGateway, gateway);
|
||||
}
|
||||
|
||||
@@ -61,34 +61,30 @@ int _readIntOption(Socket socket, int level, int option) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'connect enables TCP keepalive with short probe timings',
|
||||
() async {
|
||||
final server = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
|
||||
final overrides = _CapturingConnectOverrides();
|
||||
final service = TcpTransportService();
|
||||
try {
|
||||
await IOOverrides.runZoned(
|
||||
() => service.connect(
|
||||
host: InternetAddress.loopbackIPv4.address,
|
||||
port: server.port,
|
||||
),
|
||||
socketConnect: overrides.socketConnect,
|
||||
);
|
||||
final socket = overrides.socket!;
|
||||
// Linux values: SO_KEEPALIVE 9, TCP_KEEPIDLE 4, TCP_KEEPINTVL 5,
|
||||
// TCP_KEEPCNT 6.
|
||||
expect(_readIntOption(socket, RawSocketOption.levelSocket, 9), 1);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 4), 30);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 5), 10);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 6), 3);
|
||||
} finally {
|
||||
await service.disconnect();
|
||||
await server.close();
|
||||
}
|
||||
},
|
||||
skip: Platform.isLinux ? false : 'Option numbers checked are Linux ones',
|
||||
);
|
||||
test('connect enables TCP keepalive with short probe timings', () async {
|
||||
final server = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
|
||||
final overrides = _CapturingConnectOverrides();
|
||||
final service = TcpTransportService();
|
||||
try {
|
||||
await IOOverrides.runZoned(
|
||||
() => service.connect(
|
||||
host: InternetAddress.loopbackIPv4.address,
|
||||
port: server.port,
|
||||
),
|
||||
socketConnect: overrides.socketConnect,
|
||||
);
|
||||
final socket = overrides.socket!;
|
||||
// Linux values: SO_KEEPALIVE 9, TCP_KEEPIDLE 4, TCP_KEEPINTVL 5,
|
||||
// TCP_KEEPCNT 6.
|
||||
expect(_readIntOption(socket, RawSocketOption.levelSocket, 9), 1);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 4), 30);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 5), 10);
|
||||
expect(_readIntOption(socket, RawSocketOption.levelTcp, 6), 3);
|
||||
} finally {
|
||||
await service.disconnect();
|
||||
await server.close();
|
||||
}
|
||||
}, skip: Platform.isLinux ? false : 'Option numbers checked are Linux ones');
|
||||
|
||||
test('connect/disconnect updates TCP transport state', () async {
|
||||
final server = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
|
||||
|
||||
Reference in new issue
Block a user