@@ -55,4 +55,32 @@ void main() {
5555 lessThanOrEqualTo (tizenInfo.physicalRamSize),
5656 );
5757 }, skip: ! Platform .isLinux);
58+
59+ testWidgets ('tizenInfo is consistent across repeated calls' , (
60+ WidgetTester tester,
61+ ) async {
62+ // Repeated calls on the same instance return the cached instance.
63+ final plugin1 = DeviceInfoPluginTizen ();
64+ final first = await plugin1.tizenInfo;
65+ final second = await plugin1.tizenInfo;
66+ expect (second, same (first));
67+
68+ // A new instance triggers a fresh native call that must yield the same data.
69+ final plugin2 = DeviceInfoPluginTizen ();
70+ final third = await plugin2.tizenInfo;
71+ expect (third.modelName, first.modelName);
72+ }, skip: ! Platform .isLinux);
73+
74+ testWidgets ('TizenDeviceInfo.fromMap round-trips through data' , (
75+ WidgetTester tester,
76+ ) async {
77+ final data = tizenInfo.data;
78+ expect (data, isNotEmpty);
79+
80+ final rebuilt = TizenDeviceInfo .fromMap (data);
81+ expect (rebuilt.modelName, tizenInfo.modelName);
82+ expect (rebuilt.platformVersion, tizenInfo.platformVersion);
83+ expect (rebuilt.screenWidth, tizenInfo.screenWidth);
84+ expect (rebuilt.totalDiskSize, tizenInfo.totalDiskSize);
85+ }, skip: ! Platform .isLinux);
5886}
0 commit comments