Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
add_recipes_cq: "true"
target_file: dart_unit_tests.yaml
channel: master
Expand All @@ -155,6 +159,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: dart_unit_tests.yaml
channel: master
version_file: flutter_master.version
Expand All @@ -169,6 +177,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: dart_unit_tests.yaml
channel: stable
version_file: flutter_stable.version
Expand All @@ -183,6 +195,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: dart_unit_tests.yaml
channel: stable
version_file: flutter_stable.version
Expand All @@ -197,6 +213,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
add_recipes_cq: "true"
target_file: web_dart_unit_tests.yaml
channel: master
Expand All @@ -212,6 +232,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: web_dart_unit_tests.yaml
channel: master
version_file: flutter_master.version
Expand All @@ -226,6 +250,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: web_dart_unit_tests.yaml
channel: stable
version_file: flutter_stable.version
Expand All @@ -240,6 +268,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: web_dart_unit_tests.yaml
channel: stable
version_file: flutter_stable.version
Expand All @@ -255,6 +287,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
add_recipes_cq: "true"
target_file: web_dart_unit_tests_wasm.yaml
channel: master
Expand All @@ -270,6 +306,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: web_dart_unit_tests_wasm.yaml
channel: master
version_file: flutter_master.version
Expand Down Expand Up @@ -1316,6 +1356,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: windows_dart_unit_tests.yaml
channel: master
version_file: flutter_master.version
Expand All @@ -1330,6 +1374,10 @@ targets:
recipe: packages/packages
timeout: 60
properties:
dependencies: >-
[
{"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}
]
target_file: windows_dart_unit_tests.yaml
channel: master
version_file: flutter_master.version
Expand Down
2 changes: 2 additions & 0 deletions packages/two_dimensional_scrollables/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dependencies:
sdk: flutter

dev_dependencies:
flutter_goldens:
sdk: flutter
flutter_test:
sdk: flutter

Expand Down
13 changes: 13 additions & 0 deletions packages/two_dimensional_scrollables/test/common/span_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';

void main() {

testWidgets('Inconsequential golden test', (WidgetTester tester) async {
// The test validates the Flutter Gold integration. Any changes to the
// golden file can be approved at any time.
await tester.pumpWidget(RepaintBoundary(child: Container(color: const Color(0xAFF61145))));

await tester.pumpAndSettle();
await expectLater(
find.byType(RepaintBoundary),
matchesGoldenFile('inconsequential_golden_file.png'),
);
});

group('SpanExtent', () {
test('FixedSpanExtent', () {
var extent = const FixedSpanExtent(150);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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.


// Initial testing of instance only, not for merging.
// Plenty to do next (if this works):
// - verify service accounts used by Luci in pre/post submit tests in flutter/packages, auth works
// - Get new Gold frontend up
// - document how to enable golden file testing for a package
// - update flutter/cocoon to add flutter-gold check for triage

import 'dart:async';

import 'goldens_io.dart'
if (dart.library.js_interop) 'goldens_web.dart'
as flutter_goldens;

Future<void> testExecutable(FutureOr<void> Function() testMain) {
// Enable golden file testing using Skia Gold.
return flutter_goldens.testExecutable(testMain, namePrefix: 'two_dimensional_scrollables');
}
5 changes: 5 additions & 0 deletions packages/two_dimensional_scrollables/test/goldens_io.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// 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.

export 'package:flutter_goldens/flutter_goldens.dart' show testExecutable;
9 changes: 9 additions & 0 deletions packages/two_dimensional_scrollables/test/goldens_web.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 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';

// package:flutter_goldens is not used as part of the test process for web.
Future<void> testExecutable(FutureOr<void> Function() testMain, {String? namePrefix}) async =>
testMain();