Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3205736f
Unverified
Commit
3205736f
authored
Feb 15, 2019
by
Jonah Williams
Committed by
GitHub
Feb 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ui.Window fallback to TestViewConfiguration (#27987)
parent
9bc56566
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
binding.dart
packages/flutter_test/lib/src/binding.dart
+8
-2
bindings_test.dart
packages/flutter_test/test/bindings_test.dart
+17
-0
No files found.
packages/flutter_test/lib/src/binding.dart
View file @
3205736f
...
...
@@ -1319,10 +1319,16 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
/// size onto the actual display using the [BoxFit.contain] algorithm.
class
TestViewConfiguration
extends
ViewConfiguration
{
/// Creates a [TestViewConfiguration] with the given size. Defaults to 800x600.
TestViewConfiguration
({
///
/// If a [window] instance is not provided it defaults to [ui.window].
factory
TestViewConfiguration
({
Size
size
=
_kDefaultTestViewportSize
,
ui
.
Window
window
,
})
})
{
return
TestViewConfiguration
.
_
(
size
,
window
??
ui
.
window
);
}
TestViewConfiguration
.
_
(
Size
size
,
ui
.
Window
window
)
:
_paintMatrix
=
_getMatrix
(
size
,
window
.
devicePixelRatio
,
window
),
_hitTestMatrix
=
_getMatrix
(
size
,
1.0
,
window
),
super
(
size:
size
);
...
...
packages/flutter_test/test/bindings_test.dart
0 → 100644
View file @
3205736f
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
group
(
TestViewConfiguration
,
()
{
test
(
'is initialized with top-level window if one is not provided'
,
()
{
// The code below will throw without the default.
TestViewConfiguration
(
size:
const
Size
(
1280.0
,
800.0
));
});
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment