Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/device_info_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Add 2 integration test cases.

## 1.4.0

* Add `freeDiskSize` and `totalDiskSize` using the Tizen Storage API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,32 @@ void main() {
lessThanOrEqualTo(tizenInfo.physicalRamSize),
);
}, skip: !Platform.isLinux);

testWidgets('tizenInfo is consistent across repeated calls', (
WidgetTester tester,
) async {
// Repeated calls on the same instance return the cached instance.
final plugin1 = DeviceInfoPluginTizen();
final first = await plugin1.tizenInfo;
final second = await plugin1.tizenInfo;
expect(second, same(first));

// A new instance triggers a fresh native call that must yield the same data.
final plugin2 = DeviceInfoPluginTizen();
final third = await plugin2.tizenInfo;
expect(third.modelName, first.modelName);
}, skip: !Platform.isLinux);
Comment thread
seungsoo47 marked this conversation as resolved.

testWidgets('TizenDeviceInfo.fromMap round-trips through data', (
WidgetTester tester,
) async {
final data = tizenInfo.data;
expect(data, isNotEmpty);

final rebuilt = TizenDeviceInfo.fromMap(data);
expect(rebuilt.modelName, tizenInfo.modelName);
expect(rebuilt.platformVersion, tizenInfo.platformVersion);
expect(rebuilt.screenWidth, tizenInfo.screenWidth);
expect(rebuilt.totalDiskSize, tizenInfo.totalDiskSize);
}, skip: !Platform.isLinux);
}
Loading