test(app): cover routing and secure socks migrations
Cover legacy Auto and ASS preference migration, authenticated SOCKS session generation and the stock-runtime Xray SOCKS schema so future runtime changes cannot silently restore the old fixed-port/no-auth behavior.
This commit is contained in:
1 parent
8ead3ff249
commit
6c99366602
4 files changed
+140
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:revoltvpn/logic/connection_settings.dart';
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
test('legacy ASS migrates to SOCKS5 selected-only without losing packages', () async {
|
||||
SharedPreferences.setMockInitialValues(<String, Object>{
|
||||
'connection_mode': 'ass',
|
||||
'app_routing_mode': 'selected',
|
||||
'app_routing_packages': <String>[
|
||||
'com.android.chrome',
|
||||
'com.discord',
|
||||
],
|
||||
});
|
||||
|
||||
await ConnectionSettings.initialize();
|
||||
|
||||
expect(ConnectionSettings.mode, ConnectionMode.proxy);
|
||||
expect(ConnectionSettings.routingMode, AppRoutingMode.selected);
|
||||
expect(
|
||||
ConnectionSettings.appPackages,
|
||||
<String>['com.android.chrome', 'com.discord'],
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user