Enable widget load assets in its own package in test (#35991)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
[0-9]+:[0-9]+ [+]1: All tests passed!
|
||||
20
dev/automated_tests/flutter_test/package_assets_test.dart
Normal file
20
dev/automated_tests/flutter_test/package_assets_test.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Rendering Error', (WidgetTester tester) async {
|
||||
// Assets can load with its package name.
|
||||
await tester.pumpWidget(
|
||||
Image.asset('icon/test.png',
|
||||
width: 54,
|
||||
height: 54,
|
||||
fit: BoxFit.none,
|
||||
package: 'flutter_automated_tests'
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
BIN
dev/automated_tests/icon/test.png
Normal file
BIN
dev/automated_tests/icon/test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 423 B |
@@ -64,5 +64,6 @@ dependencies:
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
assets:
|
||||
- icon/
|
||||
# PUBSPEC CHECKSUM: 4625
|
||||
|
||||
Reference in New Issue
Block a user