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
ca14af6b
Unverified
Commit
ca14af6b
authored
Jun 11, 2019
by
Jonah Williams
Committed by
GitHub
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compatibility pass on flutter/rendering tests for JavaScript compilation. (5) (#33355)
parent
1b3fc535
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
26 additions
and
22 deletions
+26
-22
test.dart
dev/bots/test.dart
+1
-0
debug_test.dart
packages/flutter/test/rendering/debug_test.dart
+2
-2
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+7
-7
layers_test.dart
packages/flutter/test/rendering/layers_test.dart
+1
-1
paragraph_test.dart
packages/flutter/test/rendering/paragraph_test.dart
+8
-8
positioned_box_test.dart
packages/flutter/test/rendering/positioned_box_test.dart
+1
-1
proxy_box_test.dart
packages/flutter/test/rendering/proxy_box_test.dart
+1
-1
sliver_cache_test.dart
packages/flutter/test/rendering/sliver_cache_test.dart
+1
-1
viewport_test.dart
packages/flutter/test/rendering/viewport_test.dart
+1
-1
web_compilation_delegate.dart
..._tools/lib/src/build_runner/web_compilation_delegate.dart
+3
-0
No files found.
dev/bots/test.dart
View file @
ca14af6b
...
...
@@ -343,6 +343,7 @@ Future<void> _runTests() async {
Future
<
void
>
_runWebTests
()
async
{
await
_runFlutterWebTest
(
path
.
join
(
flutterRoot
,
'packages'
,
'flutter'
),
expectFailure:
false
,
tests:
<
String
>[
'test/foundation/'
,
'test/rendering/'
,
'test/services/'
,
'test/painting/'
,
'test/scheduler/'
,
...
...
packages/flutter/test/rendering/debug_test.dart
View file @
ca14af6b
...
...
@@ -14,12 +14,12 @@ void main() {
test
(
'Describe transform control test'
,
()
{
final
Matrix4
identity
=
Matrix4
.
identity
();
final
List
<
String
>
description
=
debugDescribeTransform
(
identity
);
expect
(
description
,
equals
(
<
String
>[
expect
(
description
,
<
String
>[
'[0] 1.0,0.0,0.0,0.0'
,
'[1] 0.0,1.0,0.0,0.0'
,
'[2] 0.0,0.0,1.0,0.0'
,
'[3] 0.0,0.0,0.0,1.0'
,
])
)
;
]);
});
test
(
'transform property test'
,
()
{
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
ca14af6b
...
...
@@ -72,7 +72,7 @@ void main() {
' ╚═══════════
\n
'
),
);
});
}
,
skip:
isBrowser
);
// Test that clipping will be used even when the text fits within the visible
// region if the start position of the text is offset (e.g. during scrolling
...
...
@@ -168,7 +168,7 @@ void main() {
pumpFrame
();
expect
(
editable
,
paintsExactlyCountTimes
(
#drawRRect
,
0
));
});
}
,
skip:
isBrowser
);
test
(
'Cursor with ideographic script'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
...
...
@@ -241,7 +241,7 @@ void main() {
pumpFrame
();
expect
(
editable
,
paintsExactlyCountTimes
(
#drawRRect
,
0
));
});
}
,
skip:
isBrowser
);
test
(
'text is painted above selection'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
...
...
@@ -327,7 +327,7 @@ void main() {
..
paragraph
(),
);
expect
(
editable
,
paintsExactlyCountTimes
(
#drawRect
,
1
));
});
}
,
skip:
isBrowser
);
test
(
'selects correct place with offsets'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
...
...
@@ -407,7 +407,7 @@ void main() {
expect
(
currentSelection
.
isCollapsed
,
false
);
expect
(
currentSelection
.
baseOffset
,
5
);
expect
(
currentSelection
.
extentOffset
,
9
);
});
}
,
skip:
isBrowser
);
test
(
'selects correct place when offsets are flipped'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
...
...
@@ -439,7 +439,7 @@ void main() {
expect
(
currentSelection
.
isCollapsed
,
isFalse
);
expect
(
currentSelection
.
baseOffset
,
1
);
expect
(
currentSelection
.
extentOffset
,
3
);
});
}
,
skip:
isBrowser
);
test
(
'selection does not flicker as user is dragging'
,
()
{
int
selectionChangedCount
=
0
;
...
...
@@ -494,7 +494,7 @@ void main() {
expect
(
updatedSelection
.
baseOffset
,
3
);
expect
(
updatedSelection
.
extentOffset
,
5
);
expect
(
selectionChangedCount
,
1
);
});
}
,
skip:
isBrowser
);
test
(
'editable hasFocus correctly initialized'
,
()
{
// Regression test for https://github.com/flutter/flutter/issues/21640
...
...
packages/flutter/test/rendering/layers_test.dart
View file @
ca14af6b
...
...
@@ -455,5 +455,5 @@ void main() {
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
1
);
});
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/rendering/paragraph_test.dart
View file @
ca14af6b
...
...
@@ -48,7 +48,7 @@ void main() {
final
TextPosition
positionBelow
=
paragraph
.
getPositionForOffset
(
const
Offset
(
5.0
,
20.0
));
expect
(
positionBelow
.
offset
,
greaterThan
(
position40
.
offset
));
});
}
,
skip:
isBrowser
);
test
(
'getBoxesForSelection control test'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -71,7 +71,7 @@ void main() {
expect
(
boxes
.
any
((
ui
.
TextBox
box
)
=>
box
.
right
==
100
&&
box
.
top
==
10
),
isTrue
);
},
// Ahem-based tests don't yet quite work on Windows or some MacOS environments
skip:
isLinux
);
skip:
isLinux
||
isBrowser
);
test
(
'getWordBoundary control test'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -88,7 +88,7 @@ void main() {
final
TextRange
range85
=
paragraph
.
getWordBoundary
(
const
TextPosition
(
offset:
75
));
expect
(
range85
.
textInside
(
_kText
),
equals
(
'Queen
\'
s'
));
});
}
,
skip:
isBrowser
);
test
(
'overflow test'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -164,7 +164,7 @@ void main() {
relayoutWith
(
maxLines:
100
,
softWrap:
true
,
overflow:
TextOverflow
.
fade
);
expect
(
paragraph
.
debugHasOverflowShader
,
isFalse
);
});
}
,
skip:
isBrowser
);
test
(
'maxLines'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -193,7 +193,7 @@ void main() {
layoutAt
(
3
);
expect
(
paragraph
.
size
.
height
,
30.0
);
},
skip:
isWindows
);
// Ahem-based tests don't yet quite work on Windows
},
skip:
isWindows
||
isBrowser
);
// Ahem-based tests don't yet quite work on Windows
test
(
'changing color does not do layout'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -280,7 +280,7 @@ void main() {
expect
(
boxes
[
2
].
toRect
().
height
,
closeTo
(
26.0
,
0.0001
));
expect
(
boxes
[
3
].
toRect
().
width
,
anyOf
(
14.0
,
13.0
));
expect
(
boxes
[
3
].
toRect
().
height
,
closeTo
(
13.0
,
0.0001
));
});
}
,
skip:
isBrowser
);
test
(
'toStringDeep'
,
()
{
final
RenderParagraph
paragraph
=
RenderParagraph
(
...
...
@@ -361,7 +361,7 @@ void main() {
expect
(
boxes
[
3
],
const
TextBox
.
fromLTRBD
(
38.0
,
4.0
,
48.0
,
14.0
,
TextDirection
.
ltr
));
expect
(
boxes
[
4
],
const
TextBox
.
fromLTRBD
(
48.0
,
0.0
,
62.0
,
14.0
,
TextDirection
.
ltr
));
// Ahem-based tests don't yet quite work on Windows or some MacOS environments
},
skip:
isWindows
||
isMacOS
);
},
skip:
isWindows
||
isMacOS
||
isBrowser
);
test
(
'inline widgets multiline test'
,
()
{
const
TextSpan
text
=
TextSpan
(
...
...
@@ -413,5 +413,5 @@ void main() {
expect
(
boxes
[
7
],
const
TextBox
.
fromLTRBD
(
0.0
,
28.0
,
14.0
,
42.0
,
TextDirection
.
ltr
));
expect
(
boxes
[
8
],
const
TextBox
.
fromLTRBD
(
14.0
,
28.0
,
28.0
,
42.0
,
TextDirection
.
ltr
));
// Ahem-based tests don't yet quite work on Windows or some MacOS environments
},
skip:
isWindows
||
isMacOS
);
},
skip:
isWindows
||
isMacOS
||
isBrowser
);
}
packages/flutter/test/rendering/positioned_box_test.dart
View file @
ca14af6b
...
...
@@ -69,5 +69,5 @@ void main() {
expect
(
positioner
.
size
.
width
,
equals
(
200.0
));
expect
(
positioner
.
size
.
height
,
equals
(
200.0
));
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/rendering/proxy_box_test.dart
View file @
ca14af6b
...
...
@@ -229,7 +229,7 @@ void main() {
expect
(
getPixel
(
20
,
20
),
equals
(
0x00000080
));
expect
(
getPixel
(
image
.
width
-
1
,
0
),
equals
(
0x00000000
));
expect
(
getPixel
(
image
.
width
-
1
,
20
),
equals
(
0xffffffff
));
});
}
,
skip:
isBrowser
);
test
(
'RenderOpacity does not composite if it is transparent'
,
()
{
final
RenderOpacity
renderOpacity
=
RenderOpacity
(
...
...
packages/flutter/test/rendering/sliver_cache_test.dart
View file @
ca14af6b
...
...
@@ -478,7 +478,7 @@ void main() {
);
expect
(
children
.
sublist
(
0
,
21
).
any
((
RenderBox
r
)
=>
r
.
attached
),
false
);
expect
(
children
.
sublist
(
21
,
30
).
every
((
RenderBox
r
)
=>
r
.
attached
),
true
);
});
}
,
skip:
isBrowser
);
test
(
'RenderSliverGrid calculates correct geometry'
,
()
{
// Viewport is 800x600, each grid element is 400x100, giving us space for 12 visible children
...
...
packages/flutter/test/rendering/viewport_test.dart
View file @
ca14af6b
...
...
@@ -190,7 +190,7 @@ void main() {
revealed
=
viewport
.
getOffsetToReveal
(
target
,
1.0
,
rect:
const
Rect
.
fromLTWH
(
40.0
,
40.0
,
10.0
,
10.0
));
expect
(
revealed
.
offset
,
360.0
);
expect
(
revealed
.
rect
,
const
Rect
.
fromLTWH
(
0.0
,
40.0
,
10.0
,
10.0
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Viewport getOffsetToReveal Sliver - down'
,
(
WidgetTester
tester
)
async
{
final
List
<
Widget
>
children
=
<
Widget
>[];
...
...
packages/flutter_tools/lib/src/build_runner/web_compilation_delegate.dart
View file @
ca14af6b
...
...
@@ -479,6 +479,9 @@ Future<void> main() async {
// we don't have an embedder yet this is the lowest-most layer we can put
// this stuff in.
await
ui
.
webOnlyInitializeEngine
();
// TODO(flutterweb): remove need for dynamic cast.
(
ui
.
window
as
dynamic
).
debugOverrideDevicePixelRatio
(
3.0
);
(
ui
.
window
as
dynamic
).
webOnlyDebugPhysicalSizeOverride
=
const
ui
.
Size
(
2400
,
1800
);
internalBootstrapBrowserTest
(()
=>
test
.
main
);
}
...
...
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