Unverified Commit a2678be7 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Platform view devicelab ad banner scroll list real ads (#145239)

Reland https://github.com/flutter/flutter/pull/144745, which was reverted due to a the Android app ads not being set up correctly, crashing on launch: https://github.com/flutter/flutter/pull/145228

Add the missing [`com.google.android.gms.ads.APPLICATION_ID` `meta-data` tag](https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk) to the manifest.

Validated both `platform_views_scroll_perf__timeline_summary` and `platform_views_scroll_perf_impeller__timeline_summary` ran locally on an Android emulator.

Successful presubmit runs:
https://ci.chromium.org/ui/p/flutter/builders/try/Linux_pixel_7pro%20platform_views_scroll_perf__timeline_summary/4/overview
https://ci.chromium.org/ui/p/flutter/builders/try/Linux_pixel_7pro%20platform_views_scroll_perf_impeller__timeline_summary/4/overview

Original commit message:
_________
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

Fixes https://github.com/flutter/flutter/issues/143534
Fixes https://github.com/flutter/flutter/issues/143257
parent 75996665
...@@ -4627,6 +4627,16 @@ targets: ...@@ -4627,6 +4627,16 @@ targets:
["devicelab", "ios", "mac"] ["devicelab", "ios", "mac"]
task_name: platform_views_scroll_perf_ios__timeline_summary 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 - name: Mac_ios platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary
recipe: devicelab/devicelab_drone recipe: devicelab/devicelab_drone
presubmit: false presubmit: false
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
/dev/devicelab/bin/tasks/platform_channels_benchmarks_ios.dart @gaaclarke @flutter/engine /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_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_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_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/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 /dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart @hellohuanlin @flutter/engine
......
...@@ -20,5 +20,9 @@ found in the LICENSE file. --> ...@@ -20,5 +20,9 @@ found in the LICENSE file. -->
</intent-filter> </intent-filter>
</activity> </activity>
<meta-data android:name="flutterEmbedding" android:value="2"/> <meta-data android:name="flutterEmbedding" android:value="2"/>
<!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
</application> </application>
</manifest> </manifest>
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"
# 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
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* 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 */; }; 647B792C24207B8900ABA501 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B792B24207B8900ABA501 /* AppDelegate.m */; };
647B792F24207D1600ABA501 /* DummyPlatformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B792E24207D1600ABA501 /* DummyPlatformView.m */; }; 647B792F24207D1600ABA501 /* DummyPlatformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B792E24207D1600ABA501 /* DummyPlatformView.m */; };
647B793224208A4200ABA501 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B793024208A4200ABA501 /* GeneratedPluginRegistrant.m */; }; 647B793224208A4200ABA501 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 647B793024208A4200ABA501 /* GeneratedPluginRegistrant.m */; };
...@@ -31,6 +32,9 @@ ...@@ -31,6 +32,9 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference 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 = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
647B792824207ADD00ABA501 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 647B792824207ADD00ABA501 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
647B792B24207B8900ABA501 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 647B792B24207B8900ABA501 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
647B792D24207CC400ABA501 /* DummyPlatformView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DummyPlatformView.h; sourceTree = "<group>"; }; 647B792D24207CC400ABA501 /* DummyPlatformView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DummyPlatformView.h; sourceTree = "<group>"; };
...@@ -47,6 +51,7 @@ ...@@ -47,6 +51,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BD993316F35385497F75FF6C /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -54,12 +59,31 @@ ...@@ -54,12 +59,31 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
4552BF1971CFF555ACB2839A /* libPods-Runner.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
0093AEB0458530A026D4EDDD /* Frameworks */ = {
isa = PBXGroup;
children = (
BD993316F35385497F75FF6C /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
3B86C3C30DA7CC47EE4FB68E /* Pods */ = {
isa = PBXGroup;
children = (
3269CF3CF6F192082C33C163 /* Pods-Runner.debug.xcconfig */,
0F4D3146B7B6DF07E43DC73C /* Pods-Runner.release.xcconfig */,
5E91F24FF1A398625C9C0FA5 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -77,6 +101,8 @@ ...@@ -77,6 +101,8 @@
9740EEB11CF90186004384FC /* Flutter */, 9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
3B86C3C30DA7CC47EE4FB68E /* Pods */,
0093AEB0458530A026D4EDDD /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
...@@ -121,12 +147,14 @@ ...@@ -121,12 +147,14 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
F9890346AACD48B6C9FEE2A0 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
9A0E2E29949C30C54EBF3099 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -215,6 +243,45 @@ ...@@ -215,6 +243,45 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 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 */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
...@@ -307,6 +374,7 @@ ...@@ -307,6 +374,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -430,7 +498,7 @@ ...@@ -430,7 +498,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = S8QB4VV633; DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -449,6 +517,7 @@ ...@@ -449,6 +517,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
......
...@@ -4,4 +4,7 @@ ...@@ -4,4 +4,7 @@
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "group:Runner.xcodeproj">
</FileRef> </FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace> </Workspace>
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
...@@ -20,8 +22,12 @@ ...@@ -20,8 +22,12 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
...@@ -43,9 +49,5 @@ ...@@ -43,9 +49,5 @@
<true/> <true/>
<key>io.flutter.metal_preview</key> <key>io.flutter.metal_preview</key>
<true/> <true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>
// 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<PlatformViewApp> {
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));
},
),
),
);
}
}
...@@ -9,7 +9,7 @@ dependencies: ...@@ -9,7 +9,7 @@ dependencies:
sdk: flutter sdk: flutter
flutter_driver: flutter_driver:
sdk: flutter sdk: flutter
google_mobile_ads: 4.0.0
# To change the version of the gallery assets, edit # To change the version of the gallery assets, edit
# //packages/flutter_tools/lib/src/commands/update_packages.dart # //packages/flutter_tools/lib/src/commands/update_packages.dart
# and run # and run
...@@ -25,6 +25,7 @@ dependencies: ...@@ -25,6 +25,7 @@ dependencies:
material_color_utilities: 0.8.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" 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" 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" 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" 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" 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" stream_channel: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -35,6 +36,10 @@ dependencies: ...@@ -35,6 +36,10 @@ dependencies:
vector_math: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" 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" 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" 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: dev_dependencies:
flutter_test: flutter_test:
...@@ -84,4 +89,4 @@ flutter: ...@@ -84,4 +89,4 @@ flutter:
- packages/flutter_gallery_assets/people/square/ali.png - packages/flutter_gallery_assets/people/square/ali.png
- packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png - packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
# PUBSPEC CHECKSUM: 76bc # PUBSPEC CHECKSUM: c673
// 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<void> 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<void>.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<void>.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<void>.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);
});
}
...@@ -31,9 +31,8 @@ void main() { ...@@ -31,9 +31,8 @@ void main() {
final Timeline timeline = await driver.traceAction(() async { final Timeline timeline = await driver.traceAction(() async {
// Find the scrollable stock list // Find the scrollable stock list
final SerializableFinder list = find.byValueKey(listKey); final SerializableFinder list = find.byValueKey(listKey);
expect(list, isNotNull);
for (int j = 0; j < 5; j ++) { for (int j = 0; j < 5; j += 1) {
// Scroll down // Scroll down
for (int i = 0; i < 5; i += 1) { for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300));
......
...@@ -31,9 +31,8 @@ void main() { ...@@ -31,9 +31,8 @@ void main() {
final Timeline timeline = await driver.traceAction(() async { final Timeline timeline = await driver.traceAction(() async {
// Find the scrollable stock list // Find the scrollable stock list
final SerializableFinder list = find.byValueKey(listKey); final SerializableFinder list = find.byValueKey(listKey);
expect(list, isNotNull);
for (int j = 0; j < 5; j ++) { for (int j = 0; j < 5; j += 1) {
// Scroll down // Scroll down
for (int i = 0; i < 5; i += 1) { for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300));
......
// 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());
}
// 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<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createUiKitViewScrollPerfAdBannersTest(enableImpeller: true));
}
...@@ -63,6 +63,17 @@ TaskFunction createUiKitViewScrollPerfTest({bool? enableImpeller}) { ...@@ -63,6 +63,17 @@ TaskFunction createUiKitViewScrollPerfTest({bool? enableImpeller}) {
).run; ).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}) { TaskFunction createUiKitViewScrollPerfNonIntersectingTest({bool? enableImpeller}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/platform_views_layout', '${flutterDirectory.path}/dev/benchmarks/platform_views_layout',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment