Skip to content
Merged
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
5 changes: 4 additions & 1 deletion dashboard/lib/logic/task_grid_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ class TaskGridFilter extends FilterPropertySource {
return false;
}

final bool showAndroid = _allProperties['showAndroid']?.value ?? false;
final LinkedHashMap<String, bool> orderedOSFilter = LinkedHashMap<String, bool>.of({
'ios': _allProperties['showiOS']?.value ?? false,
'android': _allProperties['showAndroid']?.value ?? false,
'android': showAndroid,
'mokey': showAndroid,
'pixel_7pro': showAndroid,
'mac': _allProperties['showMac']?.value ?? false,
'windows': _allProperties['showWindows']?.value ?? false,
'linux': _allProperties['showLinux']?.value ?? false,
Expand Down
1 change: 0 additions & 1 deletion dashboard/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this change but fix the warning:

info: The import of 'package:flutter/rendering.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'. (unnecessary_import at [flutter_dashboard] lib/main.dart:11)

import 'package:flutter/services.dart';

import 'build_dashboard_page.dart';
Expand Down
4 changes: 3 additions & 1 deletion dashboard/lib/widgets/task_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class TaskIcon extends StatelessWidget {
final String matchedName = qualifiedTask.task!.toLowerCase();
final bool isWebTest = matchedName.contains('_web') || matchedName.contains('web_');
final bool isToolTest = matchedName.contains('_tool') || matchedName.contains('tool_');
final bool isAndroidTest =
matchedName.contains('_android') || matchedName.contains('_mokey') || matchedName.contains('_pixel_7pro');

if (matchedName.contains('_fuchsia')) {
return Padding(
Expand All @@ -68,7 +70,7 @@ class TaskIcon extends StatelessWidget {
color: blendFilter,
),
);
} else if (matchedName.contains('_android')) {
} else if (isAndroidTest) {
return Icon(
Icons.android,
color: blendFilter,
Expand Down
11 changes: 10 additions & 1 deletion dashboard/test/logic/task_grid_filter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,21 @@ void main() {
expect(macIosBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Mac_ios')), true);
expect(macIosBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Mac')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_android')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_mokey')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_pixel_7pro')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux pixel_test')), false);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux')), false);
expect(linuxAndroidFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_android')), false);
expect(linuxAndroidFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_mokey')), false);
expect(linuxAndroidFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_pixel_7pro')), false);
expect(linuxAndroidFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux')), true);
expect(linuxAndroidBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_android')), true);
expect(linuxAndroidBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_android')), true);
expect(linuxAndroidBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_mokey')), true);
expect(
linuxAndroidBothTrueFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Linux_pixel_7pro')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Windows_android')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Windows_mokey')), true);
expect(androidLinuxFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Windows_pixel_7pro')), true);
expect(androidFalseFilter.matchesTask(QualifiedTask.fromTask(Task()..builderName = 'Anything_android')), false);
});

Expand Down
3 changes: 2 additions & 1 deletion dashboard/test/widgets/task_grid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -878,5 +878,6 @@ Future<void> expectTaskBoxColorWithMessage(WidgetTester tester, String message,
expect(pixels!.lengthInBytes, (cellPixelArea * 4).round());
const double padding = 4.0;
final int rgba = pixels.getUint32((((cellPixelSize * (cellSize + padding)) + cellSize + padding).ceil()) * 4);
expect((rgba >> 8) | (rgba << 24) & 0xFFFFFFFF, expectedColor.value);
final Color actualColor = Color((rgba >> 8) | (rgba << 24) & 0xFFFFFFFF);
expect(actualColor, isSameColorAs(expectedColor));
}
18 changes: 13 additions & 5 deletions dashboard/test/widgets/task_icon_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,23 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: TaskIcon(
qualifiedTask: QualifiedTask(stage: 'chromebot', task: 'Windows_android test', pool: 'luci.flutter.prod'),
child: Column(
children: <Widget>[
TaskIcon(
qualifiedTask: QualifiedTask(stage: 'chromebot', task: 'Windows_android test'),
),
TaskIcon(
qualifiedTask: QualifiedTask(stage: 'chromebot', task: 'Windows_pixel_7pro test'),
),
TaskIcon(
qualifiedTask: QualifiedTask(stage: 'chromebot', task: 'Windows_mokey test'),
),
],
),
),
),
);

expect(tester.widget(find.byType(Icon)) as Icon, isInstanceOf<Icon>());
expect((tester.widget(find.byType(Icon)) as Icon).icon!.codePoint, const Icon(Icons.android).icon!.codePoint);
expect(find.byIcon(Icons.android), findsExactly(3));
});

testWidgets('TaskIcon shows the right icon for LUCI mac', (WidgetTester tester) async {
Expand Down