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
91dea4d1
Unverified
Commit
91dea4d1
authored
Mar 07, 2023
by
Yegor
Committed by
GitHub
Mar 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web] delete unhelpful image loading e2e test (#122059)
[web] delete unhelpful image loading e2e test
parent
961df985
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
128 deletions
+0
-128
test.dart
dev/bots/test.dart
+0
-5
image_loading_main.dart
...tegration_tests/web_e2e_tests/lib/image_loading_main.dart
+0
-79
image_loading_integration.dart
.../web_e2e_tests/test_driver/image_loading_integration.dart
+0
-37
image_loading_integration_test.dart
...e2e_tests/test_driver/image_loading_integration_test.dart
+0
-7
No files found.
dev/bots/test.dart
View file @
91dea4d1
...
@@ -1162,11 +1162,6 @@ Future<void> _runWebLongRunningTests() async {
...
@@ -1162,11 +1162,6 @@ Future<void> _runWebLongRunningTests() async {
),
),
],
],
// This test specifically tests how images are loaded in HTML mode, so we don't run it in CanvasKit mode.
()
=>
_runWebE2eTest
(
'image_loading_integration'
,
buildMode:
'debug'
,
renderer:
'html'
),
()
=>
_runWebE2eTest
(
'image_loading_integration'
,
buildMode:
'profile'
,
renderer:
'html'
),
()
=>
_runWebE2eTest
(
'image_loading_integration'
,
buildMode:
'release'
,
renderer:
'html'
),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
()
=>
_runWebE2eTest
(
'platform_messages_integration'
,
buildMode:
'debug'
,
renderer:
'canvaskit'
),
()
=>
_runWebE2eTest
(
'platform_messages_integration'
,
buildMode:
'debug'
,
renderer:
'canvaskit'
),
()
=>
_runWebE2eTest
(
'platform_messages_integration'
,
buildMode:
'profile'
,
renderer:
'html'
),
()
=>
_runWebE2eTest
(
'platform_messages_integration'
,
buildMode:
'profile'
,
renderer:
'html'
),
...
...
dev/integration_tests/web_e2e_tests/lib/image_loading_main.dart
deleted
100644 → 0
View file @
961df985
// Copyright 2014 The Flutter 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
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
final
Completer
<
void
>
_assetImageCompleter
=
Completer
<
void
>();
final
Completer
<
void
>
_networkImageCompleter
=
Completer
<
void
>();
/// Notifies that Image.asset used in the test app loaded the image.
@visibleForTesting
Future
<
void
>
get
whenAssetImageLoads
=>
_assetImageCompleter
.
future
;
/// Notifies that Image.network used in the test app loaded the image.
@visibleForTesting
Future
<
void
>
get
whenNetworkImageLoads
=>
_networkImageCompleter
.
future
;
Future
<
void
>
main
()
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
const
MethodChannel
channel
=
OptionalMethodChannel
(
'flutter/web_test_e2e'
,
JSONMethodCodec
());
// Artificially override the device pixel ratio to force the framework to pick the 1.5x asset variants.
await
channel
.
invokeMethod
<
void
>(
'setDevicePixelRatio'
,
'1.5'
);
runApp
(
const
MyApp
());
}
class
MyApp
extends
StatefulWidget
{
const
MyApp
({
super
.
key
});
@override
MyAppState
createState
()
=>
MyAppState
();
}
class
MyAppState
extends
State
<
MyApp
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
key:
const
Key
(
'mainapp'
),
title:
'Integration Test App'
,
home:
Column
(
children:
<
Widget
>[
const
Text
(
'Asset image:'
),
RepaintBoundary
(
child:
Image
.
asset
(
'assets/icons/material/material.png'
,
package:
'flutter_gallery_assets'
,
frameBuilder:
(
BuildContext
context
,
Widget
child
,
int
?
frame
,
bool
wasSynchronouslyLoaded
,
)
{
if
(
frame
!=
null
)
{
_assetImageCompleter
.
complete
();
}
return
child
;
},
)),
const
Text
(
'Network image:'
),
RepaintBoundary
(
child:
Image
.
network
(
'assets/packages/flutter_gallery_assets/assets/icons/material/material.png'
,
frameBuilder:
(
BuildContext
context
,
Widget
child
,
int
?
frame
,
bool
wasSynchronouslyLoaded
,
)
{
if
(
frame
!=
null
)
{
_networkImageCompleter
.
complete
();
}
return
child
;
},
)),
])
);
}
}
dev/integration_tests/web_e2e_tests/test_driver/image_loading_integration.dart
deleted
100644 → 0
View file @
961df985
// Copyright 2014 The Flutter 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
'dart:html'
as
html
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:integration_test/integration_test.dart'
;
import
'package:web_e2e_tests/common.dart'
;
import
'package:web_e2e_tests/image_loading_main.dart'
as
app
;
void
main
(
)
{
IntegrationTestWidgetsFlutterBinding
.
ensureInitialized
();
testWidgets
(
'Image loads asset variant based on device pixel ratio'
,
(
WidgetTester
tester
)
async
{
await
app
.
main
();
await
tester
.
pumpAndSettle
();
// `pumpAndSettle` only waits until no more frames are scheduled, but the
// test must wait for the image network requests to finish.
await
app
.
whenAssetImageLoads
;
await
app
.
whenNetworkImageLoads
;
// At the time the network requests are finished the engine may not have
// updated the DOM yet. Delay checking the DOM until the next event, which
// will guarantee that the current frame is done rendering.
await
Future
<
void
>.
delayed
(
Duration
.
zero
);
final
List
<
html
.
ImageElement
>
imageElements
=
findElements
(
'img'
).
cast
<
html
.
ImageElement
>();
expect
(
imageElements
.
length
,
2
);
expect
(
imageElements
[
0
].
naturalWidth
,
1.5
*
64
);
expect
(
imageElements
[
0
].
naturalHeight
,
1.5
*
64
);
expect
(
imageElements
[
0
].
width
,
64
);
expect
(
imageElements
[
0
].
height
,
64
);
expect
(
imageElements
[
1
].
width
,
isNot
(
0
));
});
}
dev/integration_tests/web_e2e_tests/test_driver/image_loading_integration_test.dart
deleted
100644 → 0
View file @
961df985
// Copyright 2014 The Flutter 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:integration_test/integration_test_driver.dart'
as
test
;
Future
<
void
>
main
()
async
=>
test
.
integrationDriver
();
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