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
beebd5c4
Commit
beebd5c4
authored
Apr 19, 2019
by
Kate Lovett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress.
parent
7e542fc3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
26 deletions
+23
-26
date_picker_test.dart
packages/flutter/test/cupertino/date_picker_test.dart
+0
-1
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+6
-8
flutter_goldens_test.dart
packages/flutter_goldens/test/flutter_goldens_test.dart
+17
-16
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+0
-1
No files found.
packages/flutter/test/cupertino/date_picker_test.dart
View file @
beebd5c4
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
show
Platform
;
import
'dart:ui'
;
import
'package:flutter/cupertino.dart'
;
...
...
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
beebd5c4
...
...
@@ -79,18 +79,16 @@ class FlutterGoldenFileComparator implements GoldenFileComparator {
@override
Future
<
bool
>
compare
(
Uint8List
imageBytes
,
Uri
golden
)
async
{
final
bool
authorized
=
await
_skiaClient
.
auth
(
fs
.
directory
(
basedir
));
if
(!
authorized
)
{
//TODO(katelovett): Clean up for final CI implementation
return
true
;
}
final
File
goldenFile
=
_getGoldenFile
(
golden
);
if
(!
goldenFile
.
existsSync
())
{
throw
test_package
.
TestFailure
(
'Could not be compared against non-existent file: "
$golden
"'
);
}
if
(!
authorized
)
throw
test_package
.
TestFailure
(
'Could not authorize golctl.'
);
final
bool
authorized
=
await
_skiaClient
.
auth
(
fs
.
directory
(
basedir
));
if
(!
authorized
)
{
//TODO(katelovett): Clean up for final implementation
return
true
;
//throw test_package.TestFailure('Could not authorize golctl.');
}
return
await
_skiaClient
.
imgtest
(
golden
.
path
,
goldenFile
);
}
...
...
packages/flutter_goldens/test/flutter_goldens_test.dart
View file @
beebd5c4
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
as
io
;
import
'dart:typed_data'
;
import
'package:file/file.dart'
;
...
...
@@ -29,7 +28,7 @@ void main() {
fs
=
MemoryFileSystem
();
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
//TODO Add other env vars for testing
//TODO
(katelovett):
Add other env vars for testing
});
process
=
MockProcessManager
();
flutter
=
await
fs
.
directory
(
_kFlutterRoot
).
create
(
recursive:
true
);
...
...
@@ -50,7 +49,9 @@ void main() {
});
group
(
'auth'
,
()
{
// check for successful auth - return true
// check for unsuccessful auth - throw NonZeroExitCode
// check for unavailable auth (not on CI) - return false
});
group
(
'imgtest'
,
()
{
...
...
@@ -88,18 +89,6 @@ void main() {
group
(
'compare'
,
()
{
test
(
'throws if goldctl has not been authorized'
,
()
async
{
// Create file
//final File goldenFile = fs.file('/path/to/flutter/bin/cache/goldens/test/foo/bar/test.png')
//s ..createSync(recursive: true);
try
{
await
comparator
.
compare
(
Uint8List
.
fromList
(<
int
>[
1
,
2
,
3
]),
Uri
.
parse
(
'test.png'
));
fail
(
'TestFailure expected but not thrown'
);
}
on
TestFailure
catch
(
error
)
{
expect
(
error
.
message
,
contains
(
'Could not authorize goldctl.'
));
}
});
test
(
'throws if golden file is not found'
,
()
async
{
try
{
await
comparator
.
compare
(
Uint8List
.
fromList
(<
int
>[
1
,
2
,
3
]),
Uri
.
parse
(
'test.png'
));
...
...
@@ -109,6 +98,18 @@ void main() {
}
});
// TODO(katelovett): This is currently disabled in flutter_goldens.dart
// test('throws if goldctl has not been authorized', () async {
// // See that preceding test does not leave auth behind [52]
// try {
// await comparator.compare(Uint8List.fromList(<int>[1, 2, 3]), Uri.parse('test.png'));
// fail('TestFailure expected but not thrown');
// } on TestFailure catch (error) {
// expect(error.message, contains('Could not authorize goldctl.'));
// }
// });
// TODO(katelovett): Add methods to Mock SkiaGoldClient to inform the comparator
// TODO... and test for proper behavior. See matcher_test.dart for model
// test('returns false if skia gold test fails', () async {
// final File goldenFile = fs.file('/path/to/flutter/bin/cache/goldens/test/foo/bar/test.png')
// ..createSync(recursive: true);
...
...
@@ -116,7 +117,7 @@ void main() {
// final bool result = await comparator.compare(Uint8List.fromList(<int>[1, 2, 3]), Uri.parse('test.png'));
// expect(result, isFalse);
// });
//
// test('returns true if skia gold test passes', () async {
// final File goldenFile = fs.file('/path/to/flutter/bin/cache/goldens/test/foo/bar/test.png')
// ..createSync(recursive: true);
...
...
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
beebd5c4
...
...
@@ -6,7 +6,6 @@ import 'dart:async';
import
'dart:collection'
;
import
'package:meta/meta.dart'
;
import
'package:flutter_goldens_client/client.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
...
...
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