Skip to content

Commit 05f20bf

Browse files
committed
[tizen_window_manager] Add regression integration tests
* WindowManager.getGeometry returns a map with all required keys * WindowManager.getGeometry returns integer values for all geometry fields * WindowManager.getGeometry returns positive dimensions * WindowManager.lower completes without error and window can be reactivated
1 parent 1bb8868 commit 05f20bf

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Add 4 integration test cases.
4+
15
## 0.1.0
26

37
* Initial release.

packages/tizen_window_manager/example/integration_test/tizen_window_manager_test.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,44 @@ void main() {
2929

3030
expect(WidgetsBinding.instance.lifecycleState, AppLifecycleState.resumed);
3131
});
32+
33+
group('WindowManager.getGeometry', () {
34+
testWidgets('returns a map with all required keys',
35+
(WidgetTester tester) async {
36+
final Map<String, int> geometry = await WindowManager.getGeometry();
37+
expect(geometry.containsKey('x'), isTrue);
38+
expect(geometry.containsKey('y'), isTrue);
39+
expect(geometry.containsKey('width'), isTrue);
40+
expect(geometry.containsKey('height'), isTrue);
41+
});
42+
43+
testWidgets('returns integer values for all geometry fields',
44+
(WidgetTester tester) async {
45+
final Map<String, int> geometry = await WindowManager.getGeometry();
46+
expect(geometry['x'], isA<int>());
47+
expect(geometry['y'], isA<int>());
48+
expect(geometry['width'], isA<int>());
49+
expect(geometry['height'], isA<int>());
50+
});
51+
52+
testWidgets('returns positive dimensions', (WidgetTester tester) async {
53+
final Map<String, int> geometry = await WindowManager.getGeometry();
54+
expect(geometry['width']!, greaterThan(0));
55+
expect(geometry['height']!, greaterThan(0));
56+
});
57+
});
58+
59+
group('WindowManager.lower', () {
60+
testWidgets('completes without error and window can be reactivated',
61+
(WidgetTester tester) async {
62+
await expectLater(WindowManager.lower(), completes);
63+
await Future<void>.delayed(const Duration(seconds: 1));
64+
65+
// Restore the window so subsequent tests run in a normal state.
66+
await WindowManager.activate();
67+
await Future<void>.delayed(const Duration(seconds: 2));
68+
69+
expect(WidgetsBinding.instance.lifecycleState, AppLifecycleState.resumed);
70+
});
71+
});
3272
}

0 commit comments

Comments
 (0)