From 7f1c93d7320d1e5205c20550389e17367dc33de8 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 00:21:25 +0000 Subject: [PATCH] Reverts "Platform view devicelab ad banner scroll list real ads (#144745)" (#145189) Reverts: flutter/flutter#144745 Initiated by: gspencergoog Reason for reverting: appears to have broken the build. Original PR Author: hellohuanlin Reviewed By: {jmagman, jonahwilliams} This change reverts the following previous change: This benchmark is to measure the platform view performance improvement. It is similar to https://github.com/lucalooz/flutter_ads_list_perf There's still a pending issue https://github.com/flutter/flutter/issues/144339 *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* Fixes https://github.com/flutter/flutter/issues/143534 Fixes https://github.com/flutter/flutter/issues/143257 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* --- .ci.yaml | 10 --- TESTOWNERS | 1 - .../ios/Flutter/Debug.xcconfig | 1 - .../ios/Flutter/Release.xcconfig | 1 - .../platform_views_layout/ios/Podfile | 38 ---------- .../ios/Runner.xcodeproj/project.pbxproj | 71 +------------------ .../contents.xcworkspacedata | 3 - .../ios/Runner/Info.plist | 10 ++- .../lib/main_ad_banners.dart | 67 ----------------- .../platform_views_layout/pubspec.yaml | 9 +-- .../scroll_perf_ad_banners_test.dart | 59 --------------- .../scroll_perf_non_intersecting_test.dart | 3 +- .../test_driver/scroll_perf_test.dart | 3 +- .../uikit_view_scroll_perf_ad_banners.dart | 13 ---- ...oll_perf_ad_banners__timeline_summary.dart | 12 ---- dev/devicelab/lib/tasks/perf_tests.dart | 11 --- 16 files changed, 11 insertions(+), 301 deletions(-) delete mode 100644 dev/benchmarks/platform_views_layout/ios/Podfile delete mode 100644 dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart delete mode 100644 dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart delete mode 100644 dev/benchmarks/platform_views_layout/test_driver/uikit_view_scroll_perf_ad_banners.dart delete mode 100644 dev/devicelab/bin/tasks/platform_views_scroll_perf_ad_banners__timeline_summary.dart diff --git a/.ci.yaml b/.ci.yaml index 36ed613a68..18af383071 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -4626,16 +4626,6 @@ targets: ["devicelab", "ios", "mac"] task_name: platform_views_scroll_perf_ios__timeline_summary - - name: Mac_ios platform_views_scroll_perf_ad_banners__timeline_summary - recipe: devicelab/devicelab_drone - presubmit: false - bringup: true - timeout: 60 - properties: - tags: > - ["devicelab", "ios", "mac"] - task_name: platform_views_scroll_perf_ad_banners__timeline_summary - - name: Mac_ios platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary recipe: devicelab/devicelab_drone presubmit: false diff --git a/TESTOWNERS b/TESTOWNERS index 8bfbd1b63c..66cfae454c 100644 --- a/TESTOWNERS +++ b/TESTOWNERS @@ -207,7 +207,6 @@ /dev/devicelab/bin/tasks/platform_channels_benchmarks_ios.dart @gaaclarke @flutter/engine /dev/devicelab/bin/tasks/platform_interaction_test_ios.dart @hellohuanlin @flutter/engine /dev/devicelab/bin/tasks/platform_view_ios__start_up.dart @stuartmorgan @flutter/plugin -/dev/devicelab/bin/tasks/platform_views_scroll_perf_ad_banners__timeline_summary.dart @hellohuanlin @flutter/engine /dev/devicelab/bin/tasks/platform_views_scroll_perf_ios__timeline_summary.dart @hellohuanlin @flutter/engine /dev/devicelab/bin/tasks/platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary.dart @jonahwilliams @flutter/engine /dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart @hellohuanlin @flutter/engine diff --git a/dev/benchmarks/platform_views_layout/ios/Flutter/Debug.xcconfig b/dev/benchmarks/platform_views_layout/ios/Flutter/Debug.xcconfig index ec97fc6f30..592ceee85b 100644 --- a/dev/benchmarks/platform_views_layout/ios/Flutter/Debug.xcconfig +++ b/dev/benchmarks/platform_views_layout/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/dev/benchmarks/platform_views_layout/ios/Flutter/Release.xcconfig b/dev/benchmarks/platform_views_layout/ios/Flutter/Release.xcconfig index c4855bfe20..592ceee85b 100644 --- a/dev/benchmarks/platform_views_layout/ios/Flutter/Release.xcconfig +++ b/dev/benchmarks/platform_views_layout/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/dev/benchmarks/platform_views_layout/ios/Podfile b/dev/benchmarks/platform_views_layout/ios/Podfile deleted file mode 100644 index 414ba51f1c..0000000000 --- a/dev/benchmarks/platform_views_layout/ios/Podfile +++ /dev/null @@ -1,38 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/dev/benchmarks/platform_views_layout/ios/Runner.xcodeproj/project.pbxproj b/dev/benchmarks/platform_views_layout/ios/Runner.xcodeproj/project.pbxproj index e5c61ce8e6..c5e55aec37 100644 --- a/dev/benchmarks/platform_views_layout/ios/Runner.xcodeproj/project.pbxproj +++ b/dev/benchmarks/platform_views_layout/ios/Runner.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 4552BF1971CFF555ACB2839A /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD993316F35385497F75FF6C /* libPods-Runner.a */; }; 647B792C24207B8900ABA501 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B792B24207B8900ABA501 /* AppDelegate.m */; }; 647B792F24207D1600ABA501 /* DummyPlatformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B792E24207D1600ABA501 /* DummyPlatformView.m */; }; 647B793224208A4200ABA501 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B793024208A4200ABA501 /* GeneratedPluginRegistrant.m */; }; @@ -32,9 +31,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0F4D3146B7B6DF07E43DC73C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 3269CF3CF6F192082C33C163 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 5E91F24FF1A398625C9C0FA5 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 647B792824207ADD00ABA501 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 647B792B24207B8900ABA501 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 647B792D24207CC400ABA501 /* DummyPlatformView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DummyPlatformView.h; sourceTree = ""; }; @@ -51,7 +47,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BD993316F35385497F75FF6C /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -59,31 +54,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4552BF1971CFF555ACB2839A /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0093AEB0458530A026D4EDDD /* Frameworks */ = { - isa = PBXGroup; - children = ( - BD993316F35385497F75FF6C /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3B86C3C30DA7CC47EE4FB68E /* Pods */ = { - isa = PBXGroup; - children = ( - 3269CF3CF6F192082C33C163 /* Pods-Runner.debug.xcconfig */, - 0F4D3146B7B6DF07E43DC73C /* Pods-Runner.release.xcconfig */, - 5E91F24FF1A398625C9C0FA5 /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -101,8 +77,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 3B86C3C30DA7CC47EE4FB68E /* Pods */, - 0093AEB0458530A026D4EDDD /* Frameworks */, ); sourceTree = ""; }; @@ -147,14 +121,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - F9890346AACD48B6C9FEE2A0 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 9A0E2E29949C30C54EBF3099 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -243,45 +215,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9A0E2E29949C30C54EBF3099 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - F9890346AACD48B6C9FEE2A0 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -374,7 +307,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -498,7 +430,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = S8QB4VV633; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -517,7 +449,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/dev/benchmarks/platform_views_layout/ios/Runner.xcworkspace/contents.xcworkspacedata b/dev/benchmarks/platform_views_layout/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14c7..1d526a16ed 100644 --- a/dev/benchmarks/platform_views_layout/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/dev/benchmarks/platform_views_layout/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/dev/benchmarks/platform_views_layout/ios/Runner/Info.plist b/dev/benchmarks/platform_views_layout/ios/Runner/Info.plist index c1ebc15651..08da00d984 100644 --- a/dev/benchmarks/platform_views_layout/ios/Runner/Info.plist +++ b/dev/benchmarks/platform_views_layout/ios/Runner/Info.plist @@ -2,8 +2,6 @@ - CADisableMinimumFrameDurationOnPhone - CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -22,12 +20,8 @@ ???? CFBundleVersion 1 - GADApplicationIdentifier - ca-app-pub-3940256099942544~1458002511 LSRequiresIPhoneOS - UIApplicationSupportsIndirectInputEvents - UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -49,5 +43,9 @@ io.flutter.metal_preview + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart b/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart deleted file mode 100644 index 3218a03195..0000000000 --- a/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart +++ /dev/null @@ -1,67 +0,0 @@ -// 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:io'; - -import 'package:flutter/material.dart'; -import 'package:google_mobile_ads/google_mobile_ads.dart'; - -void main() { - runApp( - const PlatformViewApp() - ); -} - -class PlatformViewApp extends StatefulWidget { - const PlatformViewApp({ - super.key, - }); - - @override - PlatformViewAppState createState() => PlatformViewAppState(); -} - -class PlatformViewAppState extends State { - - AdWidget _getBannerWidget() { - // Test IDs from Admob: - // https://developers.google.com/admob/ios/test-ads - // https://developers.google.com/admob/android/test-ads - final String bannerId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/6300978111' - : 'ca-app-pub-3940256099942544/2934735716'; - final BannerAd bannerAd = BannerAd( - adUnitId: bannerId, - request: const AdRequest(), - size: AdSize.banner, - listener: const BannerAdListener(), - ); - bannerAd.load(); - return AdWidget(ad: bannerAd); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(), - title: 'Advanced Layout', - home: Scaffold( - appBar: AppBar(title: const Text('Platform View Ad Banners')), - body: ListView.builder( - key: const Key('platform-views-scroll'), // This key is used by the driver test. - itemCount: 250, - itemBuilder: (BuildContext context, int index) { - return index.isEven - // Use 320x50 Admob standard banner size. - ? SizedBox(width: 320, height: 50, child: _getBannerWidget()) - // Adjust the height to control number of platform views on screen. - // TODO(hellohuanlin): Having more than 5 banners on screen causes an unknown crash. - // See: https://github.com/flutter/flutter/issues/144339 - : const SizedBox(height: 150, child: ColoredBox(color: Colors.yellow)); - }, - ), - ), - ); - } -} diff --git a/dev/benchmarks/platform_views_layout/pubspec.yaml b/dev/benchmarks/platform_views_layout/pubspec.yaml index c5de08f043..b4d421757c 100644 --- a/dev/benchmarks/platform_views_layout/pubspec.yaml +++ b/dev/benchmarks/platform_views_layout/pubspec.yaml @@ -9,7 +9,7 @@ dependencies: sdk: flutter flutter_driver: sdk: flutter - google_mobile_ads: 4.0.0 + # To change the version of the gallery assets, edit # //packages/flutter_tools/lib/src/commands/update_packages.dart # and run @@ -25,7 +25,6 @@ dependencies: material_color_utilities: 0.8.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" meta: 1.12.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" path: 1.9.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" - plugin_platform_interface: 2.1.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" source_span: 1.10.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" stack_trace: 1.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" stream_channel: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -36,10 +35,6 @@ dependencies: vector_math: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" vm_service: 14.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" webdriver: 3.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" - webview_flutter: 4.7.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" - webview_flutter_android: 3.15.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" - webview_flutter_platform_interface: 2.10.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" - webview_flutter_wkwebview: 3.12.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" dev_dependencies: flutter_test: @@ -89,4 +84,4 @@ flutter: - packages/flutter_gallery_assets/people/square/ali.png - packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png -# PUBSPEC CHECKSUM: c673 +# PUBSPEC CHECKSUM: 76bc diff --git a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart b/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart deleted file mode 100644 index 032272f34c..0000000000 --- a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart +++ /dev/null @@ -1,59 +0,0 @@ -// 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 'package:flutter_driver/flutter_driver.dart'; -import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; - -void main() { - group('scrolling performance test', () { - late FlutterDriver driver; - - setUpAll(() async { - driver = await FlutterDriver.connect(); - - await driver.waitUntilFirstFrameRasterized(); - }); - - tearDownAll(() async { - driver.close(); - }); - - Future testScrollPerf(String listKey, String summaryName) async { - // The slight initial delay avoids starting the timing during a - // period of increased load on the device. Without this delay, the - // benchmark has greater noise. - // See: https://github.com/flutter/flutter/issues/19434 - await Future.delayed(const Duration(milliseconds: 250)); - - final Timeline timeline = await driver.traceAction(() async { - // Find the scrollable stock list - final SerializableFinder list = find.byValueKey(listKey); - - for (int j = 0; j < 5; j += 1) { - // Scroll down - for (int i = 0; i < 5; i += 1) { - await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); - await Future.delayed(const Duration(milliseconds: 500)); - } - - // Scroll up - for (int i = 0; i < 5; i += 1) { - await driver.scroll(list, 0.0, 300.0, const Duration(milliseconds: 300)); - await Future.delayed(const Duration(milliseconds: 500)); - } - } - }); - - final TimelineSummary summary = TimelineSummary.summarize(timeline); - await summary.writeTimelineToFile(summaryName, pretty: true); - } - - test('platform_views_scroll_perf', () async { - // Disable frame sync, since there are ongoing animations. - await driver.runUnsynchronized(() async { - await testScrollPerf('platform-views-scroll', 'platform_views_scroll_perf_ad_banners'); - }); - }, timeout: Timeout.none); - }); -} diff --git a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_non_intersecting_test.dart b/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_non_intersecting_test.dart index c7074ace40..eb8fed0fbd 100644 --- a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_non_intersecting_test.dart +++ b/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_non_intersecting_test.dart @@ -31,8 +31,9 @@ void main() { final Timeline timeline = await driver.traceAction(() async { // Find the scrollable stock list final SerializableFinder list = find.byValueKey(listKey); + expect(list, isNotNull); - for (int j = 0; j < 5; j += 1) { + for (int j = 0; j < 5; j ++) { // Scroll down for (int i = 0; i < 5; i += 1) { await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); diff --git a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_test.dart b/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_test.dart index f6e0914f73..15002521b9 100644 --- a/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_test.dart +++ b/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_test.dart @@ -31,8 +31,9 @@ void main() { final Timeline timeline = await driver.traceAction(() async { // Find the scrollable stock list final SerializableFinder list = find.byValueKey(listKey); + expect(list, isNotNull); - for (int j = 0; j < 5; j += 1) { + for (int j = 0; j < 5; j ++) { // Scroll down for (int i = 0; i < 5; i += 1) { await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); diff --git a/dev/benchmarks/platform_views_layout/test_driver/uikit_view_scroll_perf_ad_banners.dart b/dev/benchmarks/platform_views_layout/test_driver/uikit_view_scroll_perf_ad_banners.dart deleted file mode 100644 index 660814a37d..0000000000 --- a/dev/benchmarks/platform_views_layout/test_driver/uikit_view_scroll_perf_ad_banners.dart +++ /dev/null @@ -1,13 +0,0 @@ -// 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 'package:flutter/widgets.dart'; -import 'package:flutter_driver/driver_extension.dart'; - -import 'package:platform_views_layout/main_ad_banners.dart' as app; - -void main() { - enableFlutterDriverExtension(); - runApp(const app.PlatformViewApp()); -} diff --git a/dev/devicelab/bin/tasks/platform_views_scroll_perf_ad_banners__timeline_summary.dart b/dev/devicelab/bin/tasks/platform_views_scroll_perf_ad_banners__timeline_summary.dart deleted file mode 100644 index 17b19f993d..0000000000 --- a/dev/devicelab/bin/tasks/platform_views_scroll_perf_ad_banners__timeline_summary.dart +++ /dev/null @@ -1,12 +0,0 @@ -// 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 'package:flutter_devicelab/framework/devices.dart'; -import 'package:flutter_devicelab/framework/framework.dart'; -import 'package:flutter_devicelab/tasks/perf_tests.dart'; - -Future main() async { - deviceOperatingSystem = DeviceOperatingSystem.ios; - await task(createUiKitViewScrollPerfAdBannersTest(enableImpeller: true)); -} diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index c6d1a2e22a..3257a00664 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -63,17 +63,6 @@ TaskFunction createUiKitViewScrollPerfTest({bool? enableImpeller}) { ).run; } -TaskFunction createUiKitViewScrollPerfAdBannersTest({bool? enableImpeller}) { - return PerfTest( - '${flutterDirectory.path}/dev/benchmarks/platform_views_layout', - 'test_driver/uikit_view_scroll_perf_ad_banners.dart', - 'platform_views_scroll_perf_ad_banners', - testDriver: 'test_driver/scroll_perf_ad_banners_test.dart', - needsFullTimeline: false, - enableImpeller: enableImpeller, - ).run; -} - TaskFunction createUiKitViewScrollPerfNonIntersectingTest({bool? enableImpeller}) { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/platform_views_layout',