Add skia perf links to Cocoon home page and sidebar (#687)
diff --git a/app_flutter/lib/index_page.dart b/app_flutter/lib/index_page.dart
index 630d20d..7253577 100644
--- a/app_flutter/lib/index_page.dart
+++ b/app_flutter/lib/index_page.dart
@@ -117,6 +117,17 @@
SizedBox(
width: 300,
child: RaisedButton(
+ child: const Text('Benchmarks on Skia Perf'),
+ onPressed: () => launch('https://flutter-perf.skia.org/'),
+ padding: const EdgeInsets.all(20),
+ color: Colors.blueAccent,
+ textColor: Colors.white,
+ ),
+ ),
+ Container(height: 25),
+ SizedBox(
+ width: 300,
+ child: RaisedButton(
child: const Text('Repository'),
onPressed: () => launch('/repository.html'),
padding: const EdgeInsets.all(20),
diff --git a/app_flutter/lib/navigation_drawer.dart b/app_flutter/lib/navigation_drawer.dart
index 3ecae38..b6a1672 100644
--- a/app_flutter/lib/navigation_drawer.dart
+++ b/app_flutter/lib/navigation_drawer.dart
@@ -40,6 +40,12 @@
selected: currentRoute == '/build',
),
ListTile(
+ key: const Key('nav-link-skia-perf'),
+ title: const Text('Benchmarks on Skia Perf'),
+ leading: Icon(Icons.show_chart),
+ onTap: () => launch('https://flutter-perf.skia.org/'),
+ ),
+ ListTile(
key: const Key('nav-link-benchmarks'),
title: const Text('Benchmarks'),
leading: Icon(Icons.show_chart),
diff --git a/app_flutter/test/index_page_test.dart b/app_flutter/test/index_page_test.dart
index 9a80a56..3ad6919 100644
--- a/app_flutter/test/index_page_test.dart
+++ b/app_flutter/test/index_page_test.dart
@@ -27,6 +27,7 @@
expect(find.text('Build'), findsOneWidget);
expect(find.text('Performance'), findsOneWidget);
+ expect(find.text('Benchmarks on Skia Perf'), findsOneWidget);
expect(find.text('Repository'), findsOneWidget);
expect(find.text('Infra Agents'), findsOneWidget);
});
diff --git a/app_flutter/test/navigation_drawer_test.dart b/app_flutter/test/navigation_drawer_test.dart
index 56da0dd..62c0389 100644
--- a/app_flutter/test/navigation_drawer_test.dart
+++ b/app_flutter/test/navigation_drawer_test.dart
@@ -112,6 +112,40 @@
);
});
+ testWidgets('skia perf opens skia perf url', (WidgetTester tester) async {
+ const MethodChannel urlLauncherChannel =
+ MethodChannel('plugins.flutter.io/url_launcher');
+ final List<MethodCall> log = <MethodCall>[];
+ urlLauncherChannel.setMockMethodCallHandler(
+ (MethodCall methodCall) async => log.add(methodCall));
+
+ await tester.pumpWidget(
+ const MaterialApp(
+ home: NavigationDrawer(),
+ ),
+ );
+
+ const String skiaPerfText = 'Benchmarks on Skia Perf';
+ expect(find.text(skiaPerfText), findsOneWidget);
+ await tester.tap(find.text(skiaPerfText));
+ await tester.pump();
+
+ expect(
+ log,
+ <Matcher>[
+ isMethodCall('launch', arguments: <String, Object>{
+ 'url': 'https://flutter-perf.skia.org/',
+ 'useSafariVC': true,
+ 'useWebView': false,
+ 'enableJavaScript': false,
+ 'enableDomStorage': false,
+ 'universalLinksOnly': false,
+ 'headers': <String, String>{}
+ })
+ ],
+ );
+ });
+
testWidgets('repository opens repository html url',
(WidgetTester tester) async {
const MethodChannel urlLauncherChannel =