diff --git a/BUILD.gn b/BUILD.gn index 9c4b529b..d3b8e88 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -1763,6 +1763,7 @@ "chrome/browser/resources:closure_compile", "chrome/test/data/webui:closure_compile", "mojo/public/tools/bindings/generators/js_templates/lite/test:closure_compile", + "mojo/public/tools/bindings/generators/js_templates/lite/test:closure_compile_modules", "ui/file_manager:closure_compile", ] }
diff --git a/DEPS b/DEPS index 365ef56..45d20ced 100644 --- a/DEPS +++ b/DEPS
@@ -72,6 +72,13 @@ # TODO(ehmaldonado): Remove this once the bug in gclient is fixed. 'checkout_fuchsia': False, + # For code related to internal Fuchsia images. + 'checkout_fuchsia_internal': False, + + # Fetches the internal Fuchsia SDK boot images, with the images in a + # comma-separated list. + 'checkout_fuchsia_internal_images': '', + # Used for downloading the Fuchsia SDK without running hooks. 'checkout_fuchsia_no_hooks': False, @@ -85,6 +92,10 @@ # By default, do not check out Cast3P. 'checkout_cast3p': False, + # Check out all Chrome Cleaner deps. Set on the Chrome Cleaner builders. + # Requires access to partner-code.googlesource.com. + 'checkout_chrome_cleaner_internal': False, + # By default, do not check out Chromium autofill captured sites test # dependencies. These dependencies include very large numbers of very # large web capture files. Captured sites test dependencies are also @@ -112,6 +123,16 @@ # By default, do not check out src-internal. This can be overridden e.g. with # custom_vars. 'checkout_src_internal': False, + # + # For git submodule migration purpose only, details in + # TODO(crbug.com/1423494): Remove once the migration is completed. + 'include_src_internal_deps': False, + + # For super-internal deps. Set by the official builders. + 'checkout_google_internal': False, + + # Checkout SODA (Speech On-Device API go/chrome-live-caption) + 'checkout_soda': False, # Fetch the additional packages and files needed to run all of the # telemetry tests. This is false by default as some stuff is only @@ -286,11 +307,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '809cca39541254a33491abaf04826f5a1abcc911', + 'v8_revision': 'ff5eb6726dba2c805e0e1d88d0602d7a828ac208', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'd7a684e954378109774950238a7496039b3a0cd4', + 'angle_revision': 'c441206103b14f68fc5cfa9434f4058429a714dd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -298,7 +319,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '075ddba7c61c8eda4833f12d8c422f2939ccefdb', + 'pdfium_revision': '1ce0f0424b524f75bd112217baa191432f4ebac1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -333,7 +354,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. - 'freetype_revision': '8fe50c2adca74a4eca1501c831251283b4cc6d9b', + 'freetype_revision': 'e02a40a4f8754774c8dccc01aeb0f07ea58e81c7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. @@ -353,7 +374,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '3611b9c58ddd42ca418e057eb3ea4f44e7941b47', + 'catapult_revision': '8b055707bd1bd77b6467b91a2ab33c05f53c634c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. @@ -409,7 +430,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'dc271941243568d0d1ac59c10dc878cb9b821ea0', + 'dawn_revision': '5696997251452722e841f5ffc172acdaeb6893b1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -476,7 +497,7 @@ 'libcxx_revision': 'f8279b01085b800724f5c5629dc365b9f040dc53', # GN CIPD package version. - 'gn_version': 'git_revision:3dadaf0ee3ee07d7c29ad926e1a42d90068d7e6b', + 'gn_version': 'git_revision:ad1e5ce10f06ef9a1a1d91b2e48231d6b3eecbe2', # ninja CIPD package version. # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja @@ -769,7 +790,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '699137f5cdfe04accf44a6dab88f2e617810eea8', + '01655c21520afbdc7ae974dddc34a58991b843c9', 'condition': 'checkout_android and checkout_src_internal', }, @@ -958,7 +979,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'nz4cOkIvPx0feghxVzKjJJRpe97BWgexvaskqE7EWVQC', + 'version': 'Pn-WBQG4BLpUUtT4cSAnGTqL2vtuIo_Ncbt_uMOQ5foC', }, ], 'condition': 'checkout_android', @@ -1193,7 +1214,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '4931c18599bd1a22ffb4fb6f161fae30dc6b5eb4', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'fa24a8587072f511947493e047aaeddacab1383a', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1845,7 +1866,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd1b65aa5a88f6efd900604dfcda840154e9f16e2', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '0d1ecc682f0ad9fbee323bbff72c0d2249728fe6', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '499ce7de28a6d687a833b5c5b73fc0639731d580', 'src/third_party/webrtc': Var('webrtc_git') + '/src.git' + '@' + 'edb9cf3de081106e3327a65c32fd0b3bb3c04998', @@ -1938,7 +1959,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': Var('chrome_git') + '/chrome/src-internal.git@eb3f9b1a2bac7485bc94ed6b770e48e4053514bc', + 'url': Var('chrome_git') + '/chrome/src-internal.git@318aafd9787571eefdd9772be84e14c950a2d72d', 'condition': 'checkout_src_internal', }, @@ -1957,7 +1978,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/eche_app/app', - 'version': 'YGY-XHCiI17_ZbZDuiv_Xh4tiY_RPju9QN04da3Viv4C', + 'version': 'mp7VmGY1Q1UulmnySPfyNCNanvuXojM-JNIQCOdHGLcC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3929,6 +3950,419 @@ 'dep_type': 'cipd', 'condition': 'checkout_mac or checkout_ios', }, + # Repositories from src_internal + 'src/build/fuchsia/internal': { + 'url': Var('chrome_git') + '/fuchsia/build.git' + '@' + + '16da074bda38d989dbcbee0c7c75e2aa83783bb2', + 'condition': 'checkout_fuchsia_internal and checkout_src_internal', + }, + + 'src/chrome/app/theme/default_100_percent/google_chrome': { + 'url': Var('chrome_git') + '/chrome/theme/default_100_percent/google_chrome.git' + '@' + + '5e12619276fa0fd41dae5ebd40b807a6c32930c1', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/app/theme/default_200_percent/google_chrome': { + 'url': Var('chrome_git') + '/chrome/theme/default_200_percent/google_chrome.git' + '@' + + 'db0cce3e7bfc7489c7213295d56e1c7611f9c43f', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/app/theme/google_chrome': { + 'url': Var('chrome_git') + '/chrome/theme/google_chrome.git' + '@' + + 'a56a32f26a7509ae6577ae0b98ad9b2f315d101a', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/enterprise/connectors/internal': { + 'url': Var('chrome_git') + '/chrome/browser/enterprise/connectors/internal.git' + '@' + + '7fd7c8dd496740724d0024408ae7a96298e34aa2', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/google/linkdoctor_internal': { + 'url': Var('chrome_git') + '/chrome/linkdoctor.git' + '@' + + 'fe28a8f90c5471f20f8fee9ff7f6c6f8b8d02bed', # from svn revision 32577 + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/internal': { + 'url': Var('chrome_git') + '/chrome/browser_internal.git' + '@' + + 'd3a55d714679c55a73ff96a7ea77493b326dae91', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/media/engagement_internal': { + 'url': Var('chrome_git') + '/chrome/browser/media/engagement_internal.git' + '@' + + '14b00ddbb904612ec8805f00718ae3f95c02a076', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/resources/chromeos/quickoffice': { + 'url': Var('chrome_git') + '/quickoffice/crx.git' + '@' + + 'b469688ba88433c572ff6ebcc215a67889fadb36', + 'condition': '(checkout_chromeos or checkout_linux) and checkout_src_internal', + }, + + 'src/chrome/browser/resources/settings_internal': { + 'url': Var('chrome_git') + '/chrome/browser/resources/settings_internal.git' + '@' + + '5d6316b2434986e6b073e1d24585578bb27da451', # from svn revision 41419 + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/browser/spellchecker/internal': { + 'url': Var('chrome_git') + '/chrome/spellchecker/internal.git' + '@' + + 'a22002a5b3cf7c6b872b25712af97a5664a350e2', # from svn revision 24388 + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/chrome_cleaner/internal': { + 'url': Var('chrome_git') + '/protector/foil.git' + '@' + + 'f7839edf1403546f1ebc5bff62319d32e21529ab', + 'condition': 'checkout_chrome_cleaner_internal and checkout_src_internal', + }, + + # Installer bits used only by Mac, but mapped for all OSes to ease source + # grepping. + 'src/chrome/installer/mac/internal': { + 'url': Var('chrome_git') + '/chrome/installer/mac/internal.git' + '@' + + '0ba5f35b46b9f1aece303b3ce5d614bee9dc42f8', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/firefox3_profile/searchplugins': { + 'url': Var('chrome_git') + '/chrome/data/osdd/firefox3_profile_searchplugins.git' + '@' + + '6cf09b86fb9d058453e7d05978ff8e91b5e8e749', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/firefox3_searchplugins': { + 'url': Var('chrome_git') + '/chrome/data/osdd/firefox3_searchplugins.git' + '@' + + '490580801915834d72dd8a1e943924c35df45673', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/gpu/vt': { + 'url': Var('chrome_git') + '/chrome/data/vectortown_endurance/vectortownstatic-20121022.git' + '@' + + 'c34f30f909a414d378a1678eba921e58940708c4', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/perf/frame_rate/private': { + 'url': Var('chrome_git') + '/chrome/data/frame_rate_tests.git' + '@' + + '6394c925a272b92a4e9e16d929af049b7aa6e4f8', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/perf/private': { + 'url': Var('chrome_git') + '/chrome/data/perf_tests.git' + '@' + + '6f3e320b1fa10910eb1dcbad36afdd1ad00b2c5a', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/data/pdf_private': { + 'url': Var('chrome_git') + '/chrome/data/pdf_private.git' + '@' + + '23b64c03647779d193ee8ccb3f2a1a5560da9c94', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/media_router/internal': { + 'url': Var('chrome_git') + '/chrome/test/media_router/internal.git' + '@' + + '99937b3180700d9fb63eace8c762c7a5977a301f', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/test/python_tests': { + 'url': Var('chrome_git') + '/chrome/test/python_tests.git' + '@' + + '644bd7703b85f148564cc4038aada81f3a616d8a', + 'condition': 'checkout_src_internal', + }, + + 'src/chrome/tools/memory': { + 'url': Var('chrome_git') + '/chrome/tools/memory.git' + '@' + + '3c9359382236f6d57c91505234a2bc7fd635ba6c', + 'condition': 'checkout_win and checkout_src_internal', + }, + + 'src/chrome/services/speech/internal': { + 'url': Var('chrome_git') + '/chromeos/speech.git' + '@' + '8d46b1cb1312a0933799e37bde27e6747db8fcc2', + 'condition': 'checkout_chromeos and checkout_src_internal', + }, + + 'src/components/autofill/core/browser/form_parsing/internal_resources': { + 'url': Var('chrome_git') + '/chrome/components/autofill_regex_patterns.git' + '@' + + '7569017a0b3644101e38fc15d356899973f6ab7d', + 'condition': 'checkout_src_internal', + }, + + 'src/components/metrics/internal': { + 'url': Var('chrome_git') + '/chrome/components/metrics/internal.git' + '@' + + 'ac51808a082f35a97395ebb49c74dca809bd7540', + 'condition': 'checkout_src_internal', + }, + + 'src/components/ntp_tiles/resources/internal': { + 'url': Var('chrome_git') + '/chrome/components/ntp_tiles/resources.git' + '@' + + '48c257ae331a9c642af38b8f62cb2c789e2a7da6', + 'condition': 'checkout_src_internal', + }, + + 'src/components/optimization_guide/internal': { + 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + + '6c088815be16576ba7b57711e3240f647bf3a117', + 'condition': 'checkout_src_internal', + }, + + 'src/components/resources/default_100_percent/google_chrome': { + 'url': Var('chrome_git') + '/chrome/components/default_100_percent/google_chrome.git' + '@' + + '0e25f1d054b3bab0444e0f04c5f9b07c5f5c858b', + 'condition': 'checkout_src_internal', + }, + + 'src/components/resources/default_200_percent/google_chrome': { + 'url': Var('chrome_git') + '/chrome/components/default_200_percent/google_chrome.git' + '@' + + '66e7e3c423b0a795a3706ab63d3e9adfd8c5a646', + 'condition': 'checkout_src_internal', + }, + + 'src/components/resources/default_300_percent/google_chrome': { + 'url': Var('chrome_git') + '/chrome/components/default_300_percent/google_chrome.git' + '@' + + '91bb3da51c938685b899b3bd8a5ba0dda86bb861', + 'condition': 'checkout_src_internal', + }, + + 'src/components/site_isolation/internal': { + 'url': Var('chrome_git') + '/chrome/components/site_isolation.git' + '@' + + 'e0d8a7769c1daabb974bf0d229970534a0aede77', + 'condition': 'checkout_src_internal', + }, + + 'src/components/vector_icons/google_chrome': { + 'url': Var('chrome_git') + '/chrome/vector_icons/google_chrome.git' + '@' + + '9b3e6a1ce1188af638e8f9d9b2d385569ebbb2bb', + 'condition': 'checkout_src_internal', + }, + + 'src/content/test/data/plugin': { + 'url': Var('chrome_git') + '/chrome/data/chrome_plugin_tests.git' + '@' + + '3e80d4d08f5421d6bc9340964834ebc903a318aa', + 'condition': 'checkout_src_internal', + }, + + 'src/google_apis/internal': { + 'url': Var('chrome_git') + '/chrome/google_apis/internal.git' + '@' + + '9161026654df3107269a6d1e4cd9bae8b5589a87', + 'condition': 'checkout_src_internal', + }, + + 'src/ios_internal': { + 'url': '{chrome_git}/chrome/ios_internal.git' + '@' + + 'f1731f96a65cfb3b0301e2a4cbd04826a33d68a7', + 'condition': 'checkout_ios and checkout_src_internal', + }, + + 'src/remoting/android/internal': { + 'url': Var('chrome_git') + '/chrome/remoting/android/internal.git' + '@' + + '6b9f36fb32ddb796f16cc5b5830f58ec1944966a', + 'condition': 'checkout_android and checkout_src_internal', + }, + + 'src/remoting/host/installer/linux/internal': { + 'url': Var('chrome_git') + '/chrome/remoting/host/installer/linux/internal.git', + 'condition': 'checkout_linux and checkout_src_internal', + }, + + 'src/remoting/internal': { + 'url': Var('chrome_git') + '/chrome/app-streaming.git' + '@' + + 'd4e99ab2c43b3301e1d3ba88a7cfccd93511c8b0', + 'condition': 'checkout_src_internal', + }, + + 'src/remoting/test/internal': { + 'url': Var('chrome_git') + '/chrome/remoting/test/internal.git' + '@' + + '34ff3657e2176fc48a57fad555b076a50a409de6', + 'condition': 'checkout_src_internal', + }, + + 'src/remoting/tools/internal': { + 'url': Var('chrome_git') + '/chrome/remoting/tools/internal.git' + '@' + + 'acfed9c3a363694f37aadfb5cda4c31109661eb8', + 'condition': 'checkout_src_internal', + }, + + 'src/remoting/webapp/app_remoting/internal': { + 'url': Var('chrome_git') + '/chrome/remoting/webapp/app_remoting/internal.git' + '@' + + '5ad5339af97c3bd193d595de03f34282491ce495', + 'condition': 'checkout_src_internal', + }, + + 'src/signing_keys': { + 'url': '{chrome_git}/clank/apptestkey.git' + '@' + + '5138e684915721cbccbb487ec0764ed05650fcd0', + 'condition': 'checkout_android and checkout_google_internal and checkout_src_internal', + }, + + 'src/skia/tools/clusterfuzz-data':{ + 'url': Var('chrome_git') + '/chrome/tools/clusterfuzz-data.git' + '@' + + 'fa1fc4acacddd8d655cfca0bcadef5f7e2259bed', + 'condition': 'checkout_clusterfuzz_data and checkout_src_internal', + }, + + 'src/third_party/amd': { + 'url': Var('chrome_git') + '/chrome/deps/amd.git' + '@' + + 'cbd9811acb6d09f19b880fdbc6f0fc62901c9a5c', + 'condition': 'checkout_win and checkout_src_internal', + }, + + 'src/third_party/android_tools_internal': { + 'url': Var('chrome_git') + '/clank/third_party/android_tools.git' + '@' + + 'ab59dfd133386420a319a194c9ac6f5cae802471', + 'condition': 'checkout_android and checkout_src_internal', + }, + + # OpenGL ES 2.0 Conformance tests. + 'src/third_party/gles2_conform': { + 'url': Var('chrome_git') + '/chrome/deps/gles2_conform.git' + '@' + + '57738bb2cc672cb81ed2ee287fcd0defde968811', + 'condition': 'checkout_src_internal', + }, + + 'src/third_party/googlemac': { + 'url': Var('chrome_git') + '/chrome/deps/googlemac.git' + '@' + + '6ae4175fcf9e37655c5d7c3a7482dfc7436281d2', + 'condition': 'checkout_mac and checkout_src_internal', + }, + + # OpenGL ES 3.X Conformance tests. + "src/third_party/khronos_glcts": { + 'url': Var('chrome_git') + '/chrome/deps/khronos_glcts.git' + '@' + + 'eedb0baca9e88c53596874901ff5f6136102d20d', + 'condition': 'checkout_src_internal', + }, + + 'src/third_party/soda': { + 'packages': [ + { + 'package': 'chrome_internal/third_party/soda', + 'version': 'StdK8khsivYZXVo2wZuVMnDN_xrVO2a8HV8kvfJ3emwC', + }, + ], + 'condition': 'checkout_linux and checkout_soda and checkout_src_internal', + 'dep_type': 'cipd', + }, + + 'src/third_party/soda-mac64': { + 'packages': [ + { + 'package': 'chrome_internal/third_party/soda-mac64', + 'version': 'bJ-qwdYVguWT0V24YjNZ7Nw_toipv0YnVuadeX5xozEC', + }, + ], + 'condition': 'checkout_mac and checkout_soda and checkout_src_internal', + 'dep_type': 'cipd', + }, + + 'src/third_party/soda-win32': { + 'packages': [ + { + 'package': 'chrome_internal/third_party/soda-win32', + 'version': '977qxBGTKbe2kY9aQch9OkNJ3YE8Nt2mVjetdpWeM0IC', + }, + ], + 'condition': 'checkout_win and checkout_soda and checkout_src_internal', + 'dep_type': 'cipd', + }, + + 'src/third_party/soda-win64': { + 'packages': [ + { + 'package': 'chrome_internal/third_party/soda-win64', + 'version': '1elz1jfCAzy5tZUNBr8FsovjgFxmtu8jdyA8ay9Ta8UC', + }, + ], + 'condition': 'checkout_win and checkout_soda and checkout_src_internal', + 'dep_type': 'cipd', + }, + + 'src/third_party/widevine/cdm/chromeos': { + 'url': Var('chrome_git') + '/chrome/deps/widevine/cdm/chromeos.git' + '@' + + 'edc81c9e25b47b11d0606a717d7f8cd37378302f', + 'condition': '(checkout_chromeos or checkout_linux) and checkout_src_internal', + }, + + 'src/third_party/widevine/cdm/linux': { + 'url': Var('chrome_git') + '/chrome/deps/widevine/cdm/linux.git' + '@' + + 'a4fb4719bd4e220c3d2a20dda35d9874373fda4b', + 'condition': 'checkout_linux and checkout_src_internal', + }, + + 'src/third_party/widevine/cdm/mac': { + 'url': Var('chrome_git') + '/chrome/deps/widevine/cdm/mac.git' + '@' + + '957b3265d2e49662b00b4f90b40cbb0cad7d6058', + 'condition': 'checkout_mac and checkout_src_internal', + }, + + 'src/third_party/widevine/cdm/win': { + 'url': Var('chrome_git') + '/chrome/deps/widevine/cdm/win.git' + '@' + + '13c9314a405e38298dbb1834780c3fad233bc71e', + 'condition': 'checkout_win and checkout_src_internal', + }, + + "src/third_party/widevine/scripts": { + 'url': Var('chrome_git') + '/chrome/deps/widevine/scripts.git' + '@' + + '6ae793a606aeed0d0f1c6f688117653710137744', + 'condition': 'checkout_src_internal', + }, + + # Only Linux test license server is available. + 'src/third_party/widevine/test/license_server': { + 'url': Var('chrome_git') + '/chrome/deps/widevine/test/license_server.git' + '@' + + '8b195ed15e73e2ecc9861afb05e6af0b4bdf7413', + 'condition': 'checkout_linux and checkout_src_internal', + }, + + 'src/third_party/wix': { + 'url': Var('chrome_git') + '/chrome/deps/wix/v3_5_2519.git' + '@' + + '1cda03778b09bee24389da73daef3de862da37fc', + 'condition': 'checkout_win and checkout_src_internal', + }, + + 'src/tools/perf/data': { + 'url': Var('chrome_git') + '/chrome/tools/perf/data.git' + '@' + + 'c7eaf497f690ee69e832b1530e19877602e65b18', + 'condition': 'checkout_src_internal', + }, + + 'src/ui/file_manager/internal': { + 'url': Var('chrome_git') + '/chrome/file_manager.git' + '@' + + 'a84801be1d5ef906cc03db7eeadd25ce0245ce44', + 'condition': '(checkout_chromeos or checkout_linux) and checkout_src_internal', + }, + + 'src/ui/webui/internal': { + 'url': Var('chrome_git') + '/chrome/ui-webui-internal.git' + '@' + + '4afc450a9363ab44f45c3639d0661daa7dbe5bda', + 'condition': 'checkout_chromeos and checkout_src_internal', + }, + + 'src/webkit/data/bmp_decoder': { + 'url': Var('chrome_git') + '/chrome/data/bmp_decoder.git' + '@' + + '5a3232a478b8afd0e8403fb8c668baf8c9e25ea3', + 'condition': 'checkout_src_internal', + }, + + 'src/webkit/data/ico_decoder': { + 'url': Var('chrome_git') + '/chrome/data/ico_decoder.git' + '@' + + 'aba38604e037bdbeedca9c2780c94502a8a6034d', + 'condition': 'checkout_src_internal', + }, + + 'src/webkit/data/test_shell/plugins': { + 'url': Var('chrome_git') + '/chrome/data/webkit_plugin_tests.git' + '@' + + 'e4bd19f95afa6483a54906c2a3e5d329d2d81690', + 'condition': 'checkout_src_internal', + }, } @@ -4666,6 +5100,18 @@ '-s', 'src/third_party/gvr-android-sdk/test-libraries/controller_test_api.aar.sha1', ], }, + { + 'name': 'vr_assets', + 'pattern': '.', + 'condition': 'checkout_android and checkout_src_internal', + 'action': ['python3', + 'src/third_party/depot_tools/download_from_google_storage.py', + '--bucket', 'chrome-vr-assets', + '--recursive', + '--directory', + 'src/chrome/browser/resources/vr/assets/google_chrome', + ], + }, # Download and unpack MediaPipe Integration tests. { 'name': 'mediapipe_integration_testdata', @@ -4798,6 +5244,20 @@ }, { + 'name': 'Download Fuchsia internal system images', + 'pattern': '.', + 'condition': 'checkout_fuchsia_internal and checkout_src_internal', + 'action': ['python3', + 'src/build/fuchsia/update_images.py', + '--default-bucket', 'fuchsia-sdk', + '--image-root-dir', + 'src/third_party/fuchsia-sdk/images-internal', + '--boot-images', '{checkout_fuchsia_internal_images}', + '--allow-override=False' + ], + }, + + { 'name': 'cros_simplechrome_artifacts_with_vm', 'pattern': '.', 'condition': 'checkout_simplechrome_with_vms and not checkout_src_internal', @@ -5147,4 +5607,7 @@ 'src/chromeos/assistant/internal', 'src/chromeos/assistant/libassistant/src', 'src/libassistant', + 'src/chrome/chrome_cleaner/internal', + 'src/components/optimization_guide/internal', + 'src/ios_internal', ]
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 8bbc7ee..ad7dfc7c 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -3268,9 +3268,6 @@ "system/locale/locale_feature_pod_controller_unittest.cc", "system/lock_screen_notification_controller_unittest.cc", "system/media/media_tray_unittest.cc", - "system/media/quick_settings_media_view_container_unittest.cc", - "system/media/quick_settings_media_view_controller_unittest.cc", - "system/media/quick_settings_media_view_unittest.cc", "system/media/unified_media_controls_container_unittest.cc", "system/media/unified_media_controls_controller_unittest.cc", "system/media/unified_media_controls_detailed_view_controller_unittest.cc", @@ -3661,7 +3658,6 @@ "//components/language/core/browser:browser", "//components/live_caption:constants", "//components/media_message_center", - "//components/media_message_center:test_support", "//components/onc", "//components/password_manager/core/browser:hash_password_manager", "//components/prefs:test_support",
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index 035e249a..71b92802 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -65,6 +65,7 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/user_action_tester.h" +#include "base/test/scoped_chromeos_version_info.h" #include "base/test/scoped_feature_list.h" #include "chromeos/ui/base/window_state_type.h" #include "chromeos/ui/frame/caption_buttons/frame_size_button.h" @@ -3291,14 +3292,13 @@ class AcceleratorControllerGameDashboardTests : public AcceleratorControllerTest { public: - AcceleratorControllerGameDashboardTests() = default; + AcceleratorControllerGameDashboardTests() + : scoped_version_info_("CHROMEOS_RELEASE_TRACK=testimage-channel", + base::SysInfo::GetLsbReleaseTime()) {} ~AcceleratorControllerGameDashboardTests() override = default; void SetUp() override { EXPECT_FALSE(features::IsGameDashboardEnabled()); - base::SysInfo::SetChromeOSVersionInfoForTest( - "CHROMEOS_RELEASE_TRACK=testimage-channel", - base::SysInfo::GetLsbReleaseTime()); scoped_feature_list_.InitAndEnableFeature(features::kGameDashboard); AcceleratorControllerTest::SetUp(); EXPECT_TRUE(features::IsGameDashboardEnabled()); @@ -3306,6 +3306,7 @@ private: base::test::ScopedFeatureList scoped_feature_list_; + base::test::ScopedChromeOSVersionInfo scoped_version_info_; }; TEST_F(AcceleratorControllerGameDashboardTests,
diff --git a/ash/accelerators/accelerator_table_unittest.cc b/ash/accelerators/accelerator_table_unittest.cc index 85567ab..891898a 100644 --- a/ash/accelerators/accelerator_table_unittest.cc +++ b/ash/accelerators/accelerator_table_unittest.cc
@@ -16,10 +16,10 @@ namespace { // The number of non-Search-based accelerators. -constexpr int kNonSearchAcceleratorsNum = 109; +constexpr int kNonSearchAcceleratorsNum = 111; // The hash of non-Search-based accelerators. See HashAcceleratorData(). constexpr char kNonSearchAcceleratorsHash[] = - "2cada710fecfc1ae0fa22ecad7900f16"; + "84486b92f69cda0ecf8052e3836473b6"; struct Cmp { bool operator()(const AcceleratorData& lhs,
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index b9e2956..8f5dc41e 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -1489,6 +1489,14 @@ Scanning </message> + <!-- Video Conference Speaking On Mute Nudge --> + <message name="IDS_VIDEO_CONFERENCE_SPEAKING_ON_MUTE_OPT_IN_TITLE" desc="The title of the nudge shown to a user asking them to opt-in to the speaking on mute feature."> + Turn on mute nudge? + </message> + <message name="IDS_VIDEO_CONFERENCE_SPEAKING_ON_MUTE_OPT_IN_BODY" desc="The body of the nudge shown to a user asking them to opt-in to the speaking on mute feature."> + You’ll get notified if you talk while muted. Audio never leaves your device. + </message> + <!-- Video Conference tray --> <message name="IDS_ASH_VIDEO_CONFERENCE_TOGGLE_BUBBLE_BUTTON_TOOLTIP" desc="The tooltip for the toggle bubble button in the video conference tray."> Camera and audio controls @@ -1528,7 +1536,7 @@ Hide apps </message> <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_NAME" desc="Text for name of the background blur effect in the VC bubble."> - Background Blur + Background blur </message> <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_OFF" desc="Text for background blur 'off' setting, in the VC bubble."> Off @@ -1536,7 +1544,7 @@ <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_LOWEST" desc="Text for background blur 'lowest' setting, in the VC bubble."> Lowest </message> - <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_LIGHT" desc="Text for background blur 'light' setting, in the VC bubble."> + <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_LIGHT" meaning="This describes the strength of background blur for a video conferencing background. In this case, `light` refers to the level of intensity, so this is a slight blur." desc="Text for background blur 'light' setting, in the VC bubble."> Light </message> <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_MEDIUM" desc="Text for background blur 'medium' setting, in the VC bubble."> @@ -1548,14 +1556,14 @@ <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_MAXIMUM" desc="Text for background blur 'maximum' setting, in the VC bubble."> Maximum </message> - <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_FULL" desc="Text 'full' is a synonym of the background blur 'maximum' setting, in the VC bubble."> + <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_BACKGROUND_BLUR_FULL" meaning="This describes the strength of background blur for a video conferencing background. In this case, `full` refers to the level of intensity, so this is a full-strength, strongly blurred background." desc="Text 'full' is a synonym of the background blur 'maximum' setting, in the VC bubble."> Full </message> <message name="IDS_ASH_VIDEO_CONFERENCE_BUBBLE_PORTRAIT_RELIGHT_NAME" desc="Text for name of the portrait relight effect in the VC bubble, which is a toggle and effectively adjusts the users lighting."> - Adjust Lighting + Improve lighting </message> <message name="IDS_ASH_VIDEO_CONFERENCE_TOAST_SPEAK_ON_MUTE_DETECTED" desc="A toast message that we show when user tries to speak while muted on system-level."> - Are you speaking? You are on mute. Learn more + Are you talking? Your mic is off. Select the mic to turn it on. </message> <message name="IDS_ASH_VIDEO_CONFERENCE_TOAST_USE_WHILE_SOFTWARE_DISABLED" desc="A toast message that we show when an app tries to access camera or microphone while it is disabled by software."> <ph name="APP_NAME">$1<ex>Meet</ex></ph> wants to use your <ph name="DEVICE_NAME">$2<ex>camera</ex></ph>
diff --git a/ash/capture_mode/capture_audio_mixing_unittests.cc b/ash/capture_mode/capture_audio_mixing_unittests.cc index 2e401ed..7190c2a 100644 --- a/ash/capture_mode/capture_audio_mixing_unittests.cc +++ b/ash/capture_mode/capture_audio_mixing_unittests.cc
@@ -9,7 +9,9 @@ #include "ash/capture_mode/capture_mode_settings_view.h" #include "ash/capture_mode/capture_mode_test_util.h" #include "ash/capture_mode/capture_mode_types.h" +#include "ash/capture_mode/test_capture_mode_delegate.h" #include "ash/constants/ash_features.h" +#include "ash/public/cpp/capture_mode/capture_mode_test_api.h" #include "ash/style/icon_button.h" #include "ash/test/ash_test_base.h" #include "base/test/scoped_feature_list.h" @@ -129,6 +131,43 @@ settings_test_api.GetSystemAndMicrophoneAudioOption()); } +TEST_F(CaptureAudioMixingTest, ServiceWillRecordAudio) { + struct { + const char* const scope_name; + AudioRecordingMode audio_mode; + bool should_service_record_audio; + } kTestCases[] = { + {"Off", AudioRecordingMode::kOff, /*should_service_record_audio=*/false}, + {"Microphone", AudioRecordingMode::kMicrophone, + /*should_service_record_audio=*/true}, + + // TODO(afakhry): Update the following two cases when the service actually + // implements recording multiple streams. + {"System audio", AudioRecordingMode::kSystem, + /*should_service_record_audio=*/false}, + {"System and microphone audio", AudioRecordingMode::kSystemAndMicrophone, + /*should_service_record_audio=*/true}, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.scope_name); + auto* controller = StartSession(); + controller->SetAudioRecordingMode(test_case.audio_mode); + + StartVideoRecordingImmediately(); + + EXPECT_TRUE(controller->is_recording_in_progress()); + auto* test_delegate = static_cast<TestCaptureModeDelegate*>( + controller->delegate_for_testing()); + CaptureModeTestApi().FlushRecordingServiceForTesting(); + EXPECT_EQ(test_case.should_service_record_audio, + test_delegate->IsDoingAudioRecording()); + controller->EndVideoRecording(EndRecordingReason::kStopRecordingButton); + + WaitForCaptureFileToBeSaved(); + } +} + // ----------------------------------------------------------------------------- // ProjectorAudioMixingTest:
diff --git a/ash/capture_mode/capture_mode_behavior.cc b/ash/capture_mode/capture_mode_behavior.cc index d0c0dc1..2cb779d 100644 --- a/ash/capture_mode/capture_mode_behavior.cc +++ b/ash/capture_mode/capture_mode_behavior.cc
@@ -8,6 +8,7 @@ #include <utility> #include <vector> +#include "ash/capture_mode/capture_mode_controller.h" #include "ash/capture_mode/capture_mode_metrics.h" #include "ash/capture_mode/capture_mode_types.h" #include "ash/constants/ash_features.h" @@ -22,6 +23,25 @@ namespace { +// Returns the current configs before been overwritten by the client-initiated +// capture mode session +CaptureModeSessionConfigs GetCaptureModeSessionConfigs() { + CaptureModeController* controller = CaptureModeController::Get(); + CaptureModeSessionConfigs configs = CaptureModeSessionConfigs{ + controller->type(), controller->source(), controller->recording_type(), + controller->audio_recording_mode(), controller->enable_demo_tools()}; + return configs; +} + +void SetCaptureModeSessionConfigs(const CaptureModeSessionConfigs& configs) { + CaptureModeController* controller = CaptureModeController::Get(); + controller->SetType(configs.type); + controller->SetSource(configs.source); + controller->SetRecordingType(configs.recording_type); + controller->SetAudioRecordingMode(configs.audio_recording_mode); + controller->EnableDemoTools(configs.demo_tools_enabled); +} + // ----------------------------------------------------------------------------- // DefaultBehavior: // Implements the `CaptureModeBehavior` interface with behavior defined for the @@ -31,7 +51,7 @@ DefaultBehavior() : CaptureModeBehavior({CaptureModeType::kImage, CaptureModeSource::kRegion, RecordingType::kWebM, - /*audio_on=*/false, + AudioRecordingMode::kOff, /*demo_tools_enabled=*/false}) {} DefaultBehavior(const DefaultBehavior&) = delete; @@ -46,16 +66,33 @@ class ProjectorBehavior : public CaptureModeBehavior { public: ProjectorBehavior() - : CaptureModeBehavior({CaptureModeType::kVideo, - CaptureModeSource::kRegion, RecordingType::kWebM, - /*audio_on=*/true, - /*demo_tools_enabled=*/true}) {} + : CaptureModeBehavior( + {CaptureModeType::kVideo, CaptureModeSource::kFullscreen, + RecordingType::kWebM, AudioRecordingMode::kMicrophone, + /*demo_tools_enabled=*/true}) {} ProjectorBehavior(const ProjectorBehavior&) = delete; ProjectorBehavior& operator=(const ProjectorBehavior&) = delete; ~ProjectorBehavior() override = default; // CaptureModeBehavior: + void AttachToSession() override { + cached_configs_ = GetCaptureModeSessionConfigs(); + + // Overwrite the current capture mode session with the projector + // configurations. + SetCaptureModeSessionConfigs(capture_mode_configs_); + } + + void DetachFromSession() override { + CHECK(cached_configs_); + + // Restore the capture mode configurations after being overwritten with the + // projector-specific configurations. + SetCaptureModeSessionConfigs(cached_configs_.value()); + cached_configs_.reset(); + } + bool ShouldImageCaptureTypeBeAllowed() const override { return false; } bool ShouldSaveToSettingsBeIncluded() const override { return false; } bool ShouldGifBeSupported() const override { return false; } @@ -105,13 +142,15 @@ // ----------------------------------------------------------------------------- // GameDashboardBehavior: // Implements the `CaptureModeBehavior` interface with behaviors defined by the -// game dashboard capture mode. +// game dashboard-initiated capture mode. class GameDashboardBehavior : public CaptureModeBehavior { public: GameDashboardBehavior() : CaptureModeBehavior({CaptureModeType::kVideo, CaptureModeSource::kWindow, RecordingType::kWebM, - /*audio_on=*/true, + features::IsCaptureModeAudioMixingEnabled() + ? AudioRecordingMode::kSystemAndMicrophone + : AudioRecordingMode::kMicrophone, /*demo_tools_enabled=*/false}) {} GameDashboardBehavior(const GameDashboardBehavior&) = delete; @@ -150,6 +189,10 @@ } } +void CaptureModeBehavior::AttachToSession() {} + +void CaptureModeBehavior::DetachFromSession() {} + bool CaptureModeBehavior::ShouldImageCaptureTypeBeAllowed() const { return true; }
diff --git a/ash/capture_mode/capture_mode_behavior.h b/ash/capture_mode/capture_mode_behavior.h index d0a0c65..2d4fecc 100644 --- a/ash/capture_mode/capture_mode_behavior.h +++ b/ash/capture_mode/capture_mode_behavior.h
@@ -12,6 +12,7 @@ #include "base/files/file_path.h" #include "base/functional/callback_forward.h" #include "base/functional/callback_helpers.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace ash { @@ -22,7 +23,7 @@ CaptureModeType type; CaptureModeSource source; RecordingType recording_type; - bool audio_on; + AudioRecordingMode audio_recording_mode; bool demo_tools_enabled; }; @@ -43,6 +44,15 @@ return capture_mode_configs_; } + // Called when this behavior becomes the active behavior of a newly created + // capture session. Sub classes can choose to do any specific session + // initialization that they need. + virtual void AttachToSession(); + // Called when this behavior is no longer attached to an active capture mode + // session, i.e. when its capture session ends and recording will not start, + // or when its session ends to start recording right after recording begins. + virtual void DetachFromSession(); + virtual bool ShouldImageCaptureTypeBeAllowed() const; virtual bool ShouldVideoCaptureTypeBeAllowed() const; virtual bool ShouldFulscreenCaptureSourceBeAllowed() const; @@ -70,7 +80,13 @@ protected: explicit CaptureModeBehavior(const CaptureModeSessionConfigs& configs); + // Capture mode session configs to be used for the current capture mode + // session. CaptureModeSessionConfigs capture_mode_configs_; + + // Can be used to cache the old capture mode session configs before this + // behavior is attached to a new session. + absl::optional<CaptureModeSessionConfigs> cached_configs_; }; } // namespace ash
diff --git a/ash/capture_mode/capture_mode_controller.cc b/ash/capture_mode/capture_mode_controller.cc index 51a2a18..7036a79c 100644 --- a/ash/capture_mode/capture_mode_controller.cc +++ b/ash/capture_mode/capture_mode_controller.cc
@@ -149,9 +149,10 @@ } } -// Returns true if the given `recording_type` supports audio recording. -bool SupportsAudioRecording(RecordingType recording_type) { - return recording_type == RecordingType::kWebM; +// Returns true if the given `video_file_path` is of a type that supports audio +// recording (e.g. ".webm" files). +bool SupportsAudioRecording(const base::FilePath& video_file_path) { + return video_file_path.MatchesExtension(".webm"); } bool IsVideoFileExtensionSupported(const base::FilePath& video_file_path) { @@ -572,8 +573,9 @@ return; source_ = source; - if (capture_mode_session_) + if (IsActive()) { capture_mode_session_->OnCaptureSourceChanged(source_); + } } void CaptureModeController::SetType(CaptureModeType type) { @@ -587,8 +589,9 @@ return; type_ = type; - if (capture_mode_session_) + if (IsActive()) { capture_mode_session_->OnCaptureTypeChanged(type_); + } } void CaptureModeController::SetRecordingType(RecordingType recording_type) { @@ -596,8 +599,9 @@ return; recording_type_ = recording_type; - if (capture_mode_session_) + if (IsActive()) { capture_mode_session_->OnRecordingTypeChanged(); + } } void CaptureModeController::Start(CaptureModeEntryType entry_type) { @@ -953,18 +957,6 @@ OnVideoRecordCountDownFinished(); } -void CaptureModeController::MaybeRestoreCachedCaptureConfigurations() { - if (!cached_normal_session_configs_) - return; - - type_ = cached_normal_session_configs_->type; - source_ = cached_normal_session_configs_->source; - recording_type_ = cached_normal_session_configs_->recording_type; - audio_recording_mode_ = cached_normal_session_configs_->audio_recording_mode; - enable_demo_tools_ = cached_normal_session_configs_->demo_tools_enabled; - cached_normal_session_configs_.reset(); -} - void CaptureModeController::AddObserver(CaptureModeObserver* observer) { observers_.AddObserver(observer); } @@ -1114,7 +1106,7 @@ const CaptureParams& capture_params, mojo::PendingReceiver<viz::mojom::FrameSinkVideoCaptureOverlay> cursor_overlay, - bool should_record_audio) { + AudioRecordingMode effective_audio_mode) { DCHECK(!recording_service_remote_.is_bound()) << "Should not launch a new recording service while one is already " "running."; @@ -1143,13 +1135,26 @@ video_capturer_remote->CreateOverlay(kStackingIndex, std::move(cursor_overlay)); - // We bind the audio stream factory only if audio recording is enabled. This - // is ok since the |audio_stream_factory| parameter in the recording service - // APIs is optional, and can be not bound. - mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory; - if (should_record_audio) { + // We bind the microphone and/or system audio stream factories only if their + // corresponding audio recording modes are enabled. This is ok since the + // `microphone_stream_factory` and `system_audio_stream_factory` parameters in + // the recording service APIs are optional, and can be not bound. + mojo::PendingRemote<media::mojom::AudioStreamFactory> + microphone_stream_factory; + if (effective_audio_mode == AudioRecordingMode::kMicrophone || + effective_audio_mode == AudioRecordingMode::kSystemAndMicrophone) { delegate_->BindAudioStreamFactory( - audio_stream_factory.InitWithNewPipeAndPassReceiver()); + microphone_stream_factory.InitWithNewPipeAndPassReceiver()); + } + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory; + if (effective_audio_mode == AudioRecordingMode::kSystem || + effective_audio_mode == AudioRecordingMode::kSystemAndMicrophone) { + delegate_->BindAudioStreamFactory( + system_audio_stream_factory.InitWithNewPipeAndPassReceiver()); + } + + if (microphone_stream_factory || system_audio_stream_factory) { capture_mode_util::MaybeUpdateCaptureModePrivacyIndicators(); } @@ -1176,9 +1181,10 @@ case CaptureModeSource::kFullscreen: recording_service_remote_->RecordFullscreen( std::move(client), video_capturer_remote.Unbind(), - std::move(audio_stream_factory), std::move(drive_fs_quota_delegate), - current_video_file_path_, frame_sink_id, frame_sink_size_dip, - device_scale_factor); + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), + std::move(drive_fs_quota_delegate), current_video_file_path_, + frame_sink_id, frame_sink_size_dip, device_scale_factor); break; case CaptureModeSource::kWindow: @@ -1192,18 +1198,20 @@ recording_service_remote_->RecordWindow( std::move(client), video_capturer_remote.Unbind(), - std::move(audio_stream_factory), std::move(drive_fs_quota_delegate), - current_video_file_path_, frame_sink_id, frame_sink_size_dip, - device_scale_factor, capture_params.window->subtree_capture_id(), - bounds.size()); + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), + std::move(drive_fs_quota_delegate), current_video_file_path_, + frame_sink_id, frame_sink_size_dip, device_scale_factor, + capture_params.window->subtree_capture_id(), bounds.size()); break; case CaptureModeSource::kRegion: recording_service_remote_->RecordRegion( std::move(client), video_capturer_remote.Unbind(), - std::move(audio_stream_factory), std::move(drive_fs_quota_delegate), - current_video_file_path_, frame_sink_id, frame_sink_size_dip, - device_scale_factor, bounds); + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), + std::move(drive_fs_quota_delegate), current_video_file_path_, + frame_sink_id, frame_sink_size_dip, device_scale_factor, bounds); break; } } @@ -1641,9 +1649,15 @@ // video. Stop(); + // Use the `video_file_path` instead of `recording_type_` to determine if the + // recording format supports audio recording. This is because the actual + // format can be different, since GIF for example is only supported when the + // recording `source_` is `kRegion`. + const AudioRecordingMode effective_audio_mode = + SupportsAudioRecording(video_file_path) ? GetEffectiveAudioRecordingMode() + : AudioRecordingMode::kOff; const bool should_record_audio = - SupportsAudioRecording(recording_type_) && - GetEffectiveAudioRecordingMode() != AudioRecordingMode::kOff; + effective_audio_mode != AudioRecordingMode::kOff; mojo::PendingRemote<viz::mojom::FrameSinkVideoCaptureOverlay> cursor_capture_overlay; auto cursor_overlay_receiver = @@ -1666,17 +1680,16 @@ current_video_file_path_ = video_file_path; LaunchRecordingServiceAndStartRecording( - capture_params, std::move(cursor_overlay_receiver), should_record_audio); + capture_params, std::move(cursor_overlay_receiver), effective_audio_mode); - // Intentionally record the metrics before - // `MaybeRestoreCachedCaptureConfigurations` as `enable_demo_tools_` may be - // overwritten otherwise. + // Intentionally record the metrics before `DetachFromSession()` as + // `enable_demo_tools_` may be overwritten otherwise. RecordRecordingStartsWithDemoTools(enable_demo_tools_, for_projector); - // Restore the capture mode configurations that include the `type_`, `source_` - // and `audio_recording_mode` after projector-inititated recording starts - // if any of them was overridden in projector-initiated capture mode session. - MaybeRestoreCachedCaptureConfigurations(); + // Restore the cached capture mode configs when the capture mode session ends + // to start video recording in case another default capture mode session + // starts while video recording in progress. + active_behavior->DetachFromSession(); capture_mode_util::SetStopRecordingButtonVisibility(root_window, true); @@ -1854,27 +1867,15 @@ if (is_recording_in_progress()) { SetType(CaptureModeType::kImage); } else if (entry_type == CaptureModeEntryType::kProjector) { - DCHECK(features::IsProjectorEnabled()); - DCHECK(!delegate_->IsAudioCaptureDisabledByPolicy()) + CHECK(features::IsProjectorEnabled()); + CHECK(!delegate_->IsAudioCaptureDisabledByPolicy()) << "A projector session should not be allowed to begin if audio " "capture is disabled by policy."; for_projector = true; behavior_type = BehaviorType::kProjector; - - // Cache the normal capture mode configurations that will be used for - // restoration when switching to the normal capture mode session if needed. - cached_normal_session_configs_ = - CaptureSessionConfigs{type_, source_, recording_type_, - audio_recording_mode_, enable_demo_tools_}; - - audio_recording_mode_ = AudioRecordingMode::kMicrophone; - enable_demo_tools_ = true; - SetType(CaptureModeType::kVideo); - SetSource(CaptureModeSource::kFullscreen); - SetRecordingType(RecordingType::kWebM); } else if (entry_type == CaptureModeEntryType::kGameDashboard) { - DCHECK(features::IsGameDashboardEnabled()); + CHECK(features::IsGameDashboardEnabled()); // TODO(minch): Get the window from game dashboard and make sure the window // exists before starting the game capture session. auto windows = @@ -1886,18 +1887,6 @@ } behavior_type = BehaviorType::kGameDashboard; - - // TODO(b/278638265): Remember the configs for each session, no matters it - // is a normal session, projector or game dashboard session. - cached_normal_session_configs_ = - CaptureSessionConfigs{type_, source_, recording_type_, - audio_recording_mode_, enable_demo_tools_}; - - audio_recording_mode_ = AudioRecordingMode::kMicrophone; - enable_demo_tools_ = false; - SetType(CaptureModeType::kVideo); - SetSource(CaptureModeSource::kWindow); - SetRecordingType(RecordingType::kWebM); } RecordCaptureModeEntryType(entry_type);
diff --git a/ash/capture_mode/capture_mode_controller.h b/ash/capture_mode/capture_mode_controller.h index 85ae91a..423193a 100644 --- a/ash/capture_mode/capture_mode_controller.h +++ b/ash/capture_mode/capture_mode_controller.h
@@ -93,6 +93,12 @@ CaptureModeType type() const { return type_; } CaptureModeSource source() const { return source_; } RecordingType recording_type() const { return recording_type_; } + + // Returns the raw audio recording mode, without taking into account the + // `AudioCaptureAllowed` policy. + AudioRecordingMode audio_recording_mode() const { + return audio_recording_mode_; + } CaptureModeSession* capture_mode_session() const { return capture_mode_session_.get(); } @@ -307,17 +313,6 @@ friend class CaptureModeTestApi; friend class VideoRecordingWatcher; - // Contains the cached normal capture mode configurations that will be used - // for configurations restoration when switching from the projector-initiated - // capture mode session if needed. - struct CaptureSessionConfigs { - CaptureModeType type; - CaptureModeSource source; - RecordingType recording_type; - AudioRecordingMode audio_recording_mode; - bool demo_tools_enabled; - }; - // Called by |video_recording_watcher_| when the display on which recording is // happening changes its bounds such as on display rotation or device scale // factor changes. In this case we push the new |root_size| in DIPs, and the @@ -369,14 +364,15 @@ // overlay on the video capturer so that it can be used to record the mouse // cursor. It gives the pending receiver end to that overlay on Viz, and the // other end should be owned by the `video_recording_watcher_`. If the given - // `should_record_audio` is true, it will setup the needed mojo connections to - // the Audio Service so that audio recording can be done by the recording - // service. + // `effective_audio_mode` (which takes into account the audio capture admin + // policy and the recording format type) is not `kOff`, it will setup the + // needed mojo connections to the Audio Service so that audio recording can be + // done by the recording service. void LaunchRecordingServiceAndStartRecording( const CaptureParams& capture_params, mojo::PendingReceiver<viz::mojom::FrameSinkVideoCaptureOverlay> cursor_overlay, - bool should_record_audio); + AudioRecordingMode effective_audio_mode); // Called back when the mojo pipe to the recording service gets disconnected. void OnRecordingServiceDisconnected(); @@ -650,8 +646,6 @@ // True in the scope of BeginVideoRecording(). bool is_initializing_recording_ = false; - absl::optional<CaptureSessionConfigs> cached_normal_session_configs_; - // Remember the user preference of whether to enable demo tools feature or // not in video recording mode, between sessions. Initially, this value is set // to false, ensuring that this is an opt-in feature.
diff --git a/ash/capture_mode/capture_mode_game_dashboard_unittests.cc b/ash/capture_mode/capture_mode_game_dashboard_unittests.cc index f5856cd..ed7da7d 100644 --- a/ash/capture_mode/capture_mode_game_dashboard_unittests.cc +++ b/ash/capture_mode/capture_mode_game_dashboard_unittests.cc
@@ -14,12 +14,14 @@ namespace ash { -class GameDashboardTest : public AshTestBase { +class GameDashboardCaptureModeTest : public AshTestBase { public: - GameDashboardTest() : scoped_feature_list_(features::kGameDashboard) {} - GameDashboardTest(const GameDashboardTest&) = delete; - GameDashboardTest& operator=(const GameDashboardTest&) = delete; - ~GameDashboardTest() override = default; + GameDashboardCaptureModeTest() + : scoped_feature_list_(features::kGameDashboard) {} + GameDashboardCaptureModeTest(const GameDashboardCaptureModeTest&) = delete; + GameDashboardCaptureModeTest& operator=(const GameDashboardCaptureModeTest&) = + delete; + ~GameDashboardCaptureModeTest() override = default; // AshTestBase: void SetUp() override { @@ -38,10 +40,10 @@ base::SysInfo::ResetChromeOSVersionInfoForTest(); } - CaptureModeController* StartGameCaptureSession() { + CaptureModeController* StartGameCaptureModeSession() { auto* controller = CaptureModeController::Get(); controller->Start(CaptureModeEntryType::kGameDashboard); - DCHECK(controller->IsActive()); + CHECK(controller->IsActive()); return controller; } @@ -51,8 +53,8 @@ std::unique_ptr<aura::Window> window_; }; -TEST_F(GameDashboardTest, GameDashboardBehavior) { - CaptureModeController* controller = StartGameCaptureSession(); +TEST_F(GameDashboardCaptureModeTest, GameDashboardBehavior) { + CaptureModeController* controller = StartGameCaptureModeSession(); CaptureModeSession* session = controller->capture_mode_session(); CaptureModeBehavior* active_behavior = session->active_behavior(); ASSERT_TRUE(active_behavior); @@ -65,7 +67,9 @@ EXPECT_TRUE( active_behavior->SupportsAudioRecordingMode(AudioRecordingMode::kOff)); EXPECT_TRUE(active_behavior->SupportsAudioRecordingMode( - AudioRecordingMode::kMicrophone)); + features::IsCaptureModeAudioMixingEnabled() + ? AudioRecordingMode::kSystemAndMicrophone + : AudioRecordingMode::kMicrophone)); EXPECT_TRUE(active_behavior->ShouldCameraSelectionSettingsBeIncluded()); EXPECT_FALSE(active_behavior->ShouldDemoToolsSettingsBeIncluded()); EXPECT_TRUE(active_behavior->ShouldSaveToSettingsBeIncluded());
diff --git a/ash/capture_mode/capture_mode_session.cc b/ash/capture_mode/capture_mode_session.cc index 357167d..4823d5c7 100644 --- a/ash/capture_mode/capture_mode_session.cc +++ b/ash/capture_mode/capture_mode_session.cc
@@ -446,6 +446,7 @@ focus_cycler_(std::make_unique<CaptureModeSessionFocusCycler>(this)), capture_toast_controller_(this) { CHECK(current_root_); + active_behavior->AttachToSession(); } CaptureModeSession::~CaptureModeSession() = default; @@ -571,8 +572,15 @@ // Close all widgets immediately to avoid having them show up in the captured // screenshots or video. - for (auto* widget : GetAvailableWidgets()) + for (auto* widget : GetAvailableWidgets()) { widget->CloseNow(); + } + + // Clear all the contents view of all the widgets to avoid UAF. + capture_mode_bar_view_ = nullptr; + capture_mode_settings_view_ = nullptr; + capture_label_view_ = nullptr; + recording_type_menu_view_ = nullptr; if (a11y_alert_on_session_exit_) { capture_mode_util::TriggerAccessibilityAlert( @@ -600,11 +608,11 @@ // projector-initiated capture mode session. controller_->camera_controller()->MaybeRevertAutoCameraSelection(); - // Restore the capture mode configurations that include the `type_`, - // `source_` and `enable_audio_recording_` when the projector-initiated - // session ends without starting a new recording, in case any of them were - // overwritten by projector. - controller_->MaybeRestoreCachedCaptureConfigurations(); + // The session is about to end and recording won't start afterwards. The + // active behavior may have overwritten some of the configs, we need to + // restore them back to their original values so that future sessions are + // not affected. + active_behavior_->DetachFromSession(); } Shell::Get()->RemoveShellObserver(this);
diff --git a/ash/capture_mode/gif_recording_unittests.cc b/ash/capture_mode/gif_recording_unittests.cc index c6bb649f..5f35627 100644 --- a/ash/capture_mode/gif_recording_unittests.cc +++ b/ash/capture_mode/gif_recording_unittests.cc
@@ -415,6 +415,11 @@ auto* controller = StartRegionVideoCapture(); controller->SetRecordingType(RecordingType::kGif); + // Audio recording is not supported for GIF, but switching to fullscreen or + // window recording should switch to webm recording, which do support audio + // recording, so we should expect that. + controller->SetAudioRecordingMode(AudioRecordingMode::kMicrophone); + // Switch to another source than region. controller->SetSource(test_case.source); // The recording type remains the same, and is still set as GIF. However, @@ -428,7 +433,10 @@ StartVideoRecordingImmediately(); EXPECT_TRUE(controller->is_recording_in_progress()); + auto* test_delegate = static_cast<TestCaptureModeDelegate*>( + controller->delegate_for_testing()); CaptureModeTestApi().FlushRecordingServiceForTesting(); + EXPECT_TRUE(test_delegate->IsDoingAudioRecording()); controller->EndVideoRecording(EndRecordingReason::kStopRecordingButton); // The resulting file should have a ".webm" extension.
diff --git a/ash/components/arc/arc_features.h b/ash/components/arc/arc_features.h index f43abcb..0daf6cd 100644 --- a/ash/components/arc/arc_features.h +++ b/ash/components/arc/arc_features.h
@@ -51,7 +51,6 @@ BASE_DECLARE_FEATURE(kNativeBridgeToggleFeature); BASE_DECLARE_FEATURE(kOutOfProcessVideoDecoding); BASE_DECLARE_FEATURE(kPictureInPictureFeature); -BASE_DECLARE_FEATURE(kRightClickLongPress); BASE_DECLARE_FEATURE(kRtVcpuDualCore); BASE_DECLARE_FEATURE(kRtVcpuQuadCore); BASE_DECLARE_FEATURE(kSaveRawFilesOnTracing);
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 20166d6..f5abde8 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -77,6 +77,10 @@ "AllowScrollSettings", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kAltClickAndSixPackCustomization, + "AltClickAndSixPackCustomization", + base::FEATURE_DISABLED_BY_DEFAULT); + // Controls whether to enable AutoEnrollment for Kiosk in OOBE BASE_FEATURE(kAutoEnrollmentKioskInOobe, "AutoEnrollmentKioskInOobe", @@ -1102,6 +1106,12 @@ "HelpAppAppsDiscovery", base::FEATURE_ENABLED_BY_DEFAULT); +// Enables the logic that auto triggers the install dialog during the web app +// install flow initiated from the Help App. +BASE_FEATURE(kHelpAppAutoTriggerInstallDialog, + "HelpAppAutoTriggerInstallDialog", + base::FEATURE_ENABLED_BY_DEFAULT); + // Enables or disables the Help App Discover tab notifications on non-stable // ChromeOS channels. Used for testing. BASE_FEATURE(kHelpAppDiscoverTabNotificationAllChannels, @@ -2457,6 +2467,10 @@ kAllowEapDefaultCasWithoutSubjectVerification); } +bool IsAltClickAndSixPackCustomizationEnabled() { + return base::FeatureList::IsEnabled(kAltClickAndSixPackCustomization); +} + bool IsAmbientModeDevUseProdEnabled() { return base::FeatureList::IsEnabled(kAmbientModeDevUseProdFeature); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 73bb7f27..d5f9d9ee 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -25,6 +25,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kAllowRepeatedUpdates); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kAllowScrollSettings); COMPONENT_EXPORT(ASH_CONSTANTS) +BASE_DECLARE_FEATURE(kAltClickAndSixPackCustomization); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kAlwaysReinstallSystemWebApps); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kAmbientModeDevUseProdFeature); @@ -348,6 +350,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kHandwritingLibraryDlc); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kHelpAppAppsDiscovery); COMPONENT_EXPORT(ASH_CONSTANTS) +BASE_DECLARE_FEATURE(kHelpAppAutoTriggerInstallDialog); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kHelpAppDiscoverTabNotificationAllChannels); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kHelpAppLauncherSearch); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kHibernate); @@ -682,6 +686,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAllowAmbientEQEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsEapDefaultCasWithoutSubjectVerificationAllowed(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAltClickAndSixPackCustomizationEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModeDevUseProdEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModeManagedScreensaverEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModePhotoPreviewEnabled();
diff --git a/ash/public/cpp/accelerators.cc b/ash/public/cpp/accelerators.cc index de25adf..a25c848e 100644 --- a/ash/public/cpp/accelerators.cc +++ b/ash/public/cpp/accelerators.cc
@@ -250,6 +250,8 @@ // Media Player shortcuts. {true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE, AcceleratorAction::kMediaNextTrack}, + {true, ui::VKEY_PAUSE, ui::EF_NONE, AcceleratorAction::kMediaPause}, + {true, ui::VKEY_PLAY, ui::EF_NONE, AcceleratorAction::kMediaPlay}, {true, ui::VKEY_MEDIA_PAUSE, ui::EF_NONE, AcceleratorAction::kMediaPause}, {true, ui::VKEY_MEDIA_PLAY, ui::EF_NONE, AcceleratorAction::kMediaPlay}, {true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE,
diff --git a/ash/session/fullscreen_controller.cc b/ash/session/fullscreen_controller.cc index 082152b0..1c431e4 100644 --- a/ash/session/fullscreen_controller.cc +++ b/ash/session/fullscreen_controller.cc
@@ -17,8 +17,10 @@ #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h" #include "base/check.h" +#include "base/strings/string_util.h" #include "chromeos/dbus/power_manager/backlight.pb.h" #include "chromeos/dbus/power_manager/idle.pb.h" +#include "chromeos/ui/base/window_properties.h" #include "chromeos/ui/wm/fullscreen/keep_fullscreen_for_url_checker.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" @@ -100,6 +102,20 @@ return; } + // Do not exit fullscreen for a Borealis window. We do additional checks here + // to avoid entering a screen lock with a window which has a not-allowed + // property combination. We use CHECKs as those combination should never + // happen. + if (active_window_state->window()->GetProperty( + chromeos::kNoExitFullscreenOnLock)) { + CHECK(active_window_state->window()->GetProperty( + chromeos::kUseOverviewToExitFullscreen)) + << "Property combination not allowed. kUseOverviewToExitFullscreen " + "must be true if kNoExitFullscreenOnLock is true."; + std::move(callback).Run(); + return; + } + if (!keep_fullscreen_checker_) { keep_fullscreen_checker_ = std::make_unique<chromeos::KeepFullscreenForUrlChecker>(
diff --git a/ash/session/fullscreen_controller_unittest.cc b/ash/session/fullscreen_controller_unittest.cc index 72a94aa..32ae78b5 100644 --- a/ash/session/fullscreen_controller_unittest.cc +++ b/ash/session/fullscreen_controller_unittest.cc
@@ -14,6 +14,7 @@ #include "ash/wm/window_state.h" #include "base/memory/raw_ptr.h" #include "base/run_loop.h" +#include "chromeos/ui/base/window_properties.h" #include "chromeos/ui/wm/fullscreen/pref_names.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/aura_constants.h" @@ -29,15 +30,23 @@ constexpr char kMatchingPattern[] = "test.com"; constexpr char kWildcardPattern[] = "*"; -class FullscreenControllerTest : public AshTestBase, - public testing::WithParamInterface<bool> { +bool IsOfficialBuildWithoutDcheck() { +#if defined(OFFICIAL_BUILD) && !DCHECK_IS_ON() + return true; +#else + return false; +#endif +} + +class FullscreenControllerTestBase : public AshTestBase { public: - FullscreenControllerTest() {} + FullscreenControllerTestBase() = default; - FullscreenControllerTest(const FullscreenControllerTest&) = delete; - FullscreenControllerTest& operator=(const FullscreenControllerTest&) = delete; + FullscreenControllerTestBase(const FullscreenControllerTestBase&) = delete; + FullscreenControllerTestBase& operator=(const FullscreenControllerTestBase&) = + delete; - ~FullscreenControllerTest() override {} + ~FullscreenControllerTestBase() override = default; // AshTestBase: void SetUp() override { @@ -55,17 +64,17 @@ AshTestBase::TearDown(); } + protected: void CreateFullscreenWindow() { window_ = CreateTestWindow(); window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); - if (is_lacros_window_) { - window_->SetProperty(aura::client::kAppType, - static_cast<int>(AppType::LACROS)); - } + SetPropertiesForNewFullscreenWindow(window_.get()); window_state_ = WindowState::Get(window_.get()); } + virtual void SetPropertiesForNewFullscreenWindow(aura::Window* window) {} + void SetKeepFullscreenWithoutNotificationAllowList( const std::string& pattern) { base::Value::List list; @@ -75,6 +84,21 @@ std::move(list)); } + std::unique_ptr<aura::Window> window_; + raw_ptr<WindowState, ExperimentalAsh> window_state_ = nullptr; + raw_ptr<TestShellDelegate> test_shell_delegate_ = nullptr; +}; + +class FullscreenControllerTest : public FullscreenControllerTestBase, + public testing::WithParamInterface<bool> { + protected: + void SetPropertiesForNewFullscreenWindow(aura::Window* window) override { + if (is_lacros_window_) { + window->SetProperty(aura::client::kAppType, + static_cast<int>(AppType::LACROS)); + } + } + void SetUpShellDelegate(bool should_exit_fullscreen, GURL url = kActiveUrl) { // The shell delegate will only retrieve the active URL for ash-chrome // windows and return the empty URL for lacros-chrome windows. @@ -87,14 +111,7 @@ } } - protected: bool is_lacros_window_ = GetParam(); - - std::unique_ptr<aura::Window> window_; - - raw_ptr<WindowState, ExperimentalAsh> window_state_ = nullptr; - - raw_ptr<TestShellDelegate> test_shell_delegate_ = nullptr; }; // Test that full screen is exited after session unlock if the allow list pref @@ -212,5 +229,47 @@ INSTANTIATE_TEST_SUITE_P(All, FullscreenControllerTest, testing::Bool()); +using FullscreenControllerNotLacrosRelatedTest = FullscreenControllerTestBase; + +TEST_F(FullscreenControllerNotLacrosRelatedTest, + KeepFullscreenIfNoExitPropertySet) { + window_->SetProperty(chromeos::kUseOverviewToExitFullscreen, true); + window_->SetProperty(chromeos::kNoExitFullscreenOnLock, true); + window_->SetProperty(aura::client::kAppType, + static_cast<int>(AppType::CROSTINI_APP)); + + ASSERT_TRUE(window_state_->IsFullscreen()); + + base::RunLoop run_loop; + Shell::Get()->session_controller()->PrepareForLock(run_loop.QuitClosure()); + GetSessionControllerClient()->LockScreen(); + EXPECT_TRUE(window_state_->IsFullscreen()); + GetSessionControllerClient()->UnlockScreen(); + run_loop.Run(); + EXPECT_TRUE(window_state_->IsFullscreen()); +} + +TEST_F(FullscreenControllerNotLacrosRelatedTest, + NoExitPropertyNotAllowedIfOverviewPropertyIsNotSet) { + // CHECK macro discards error message for the official build with + // dcheck=false. See the definition in base/check.h for details. + std::string expected_error_message = + IsOfficialBuildWithoutDcheck() ? "" : "Property combination not allowed"; + + EXPECT_DEATH( + { + window_->SetProperty(chromeos::kUseOverviewToExitFullscreen, false); + window_->SetProperty(chromeos::kNoExitFullscreenOnLock, true); + + ASSERT_TRUE(window_state_->IsFullscreen()); + + base::RunLoop run_loop; + Shell::Get()->session_controller()->PrepareForLock( + run_loop.QuitClosure()); + GetSessionControllerClient()->LockScreen(); + }, + expected_error_message); +} + } // namespace } // namespace ash
diff --git a/ash/system/media/quick_settings_media_view.cc b/ash/system/media/quick_settings_media_view.cc index 454b952..a771e4f 100644 --- a/ash/system/media/quick_settings_media_view.cc +++ b/ash/system/media/quick_settings_media_view.cc
@@ -193,4 +193,4 @@ } } -} // namespace ash +} // namespace ash \ No newline at end of file
diff --git a/ash/system/media/quick_settings_media_view.h b/ash/system/media/quick_settings_media_view.h index 2528993..821a1cc 100644 --- a/ash/system/media/quick_settings_media_view.h +++ b/ash/system/media/quick_settings_media_view.h
@@ -49,15 +49,6 @@ // Updates the media item order given the id order in the list. void UpdateItemOrder(std::list<std::string> ids); - // Helper functions for testing. - PaginationModel* pagination_model_for_testing() { - return pagination_model_.get(); - } - std::map<const std::string, global_media_controls::MediaItemUIView*> - items_for_testing() { - return items_; - } - private: raw_ptr<QuickSettingsMediaViewController> controller_ = nullptr;
diff --git a/ash/system/media/quick_settings_media_view_container_unittest.cc b/ash/system/media/quick_settings_media_view_container_unittest.cc deleted file mode 100644 index 9b361a5..0000000 --- a/ash/system/media/quick_settings_media_view_container_unittest.cc +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/system/media/quick_settings_media_view_container.h" - -#include "ash/constants/ash_features.h" -#include "ash/system/media/media_tray.h" -#include "ash/system/unified/unified_system_tray.h" -#include "ash/system/unified/unified_system_tray_bubble.h" -#include "ash/test/ash_test_base.h" -#include "base/test/scoped_feature_list.h" -#include "media/base/media_switches.h" - -namespace ash { - -class QuickSettingsMediaViewContainerTest : public NoSessionAshTestBase { - public: - QuickSettingsMediaViewContainerTest() = default; - QuickSettingsMediaViewContainerTest( - const QuickSettingsMediaViewContainerTest&) = delete; - QuickSettingsMediaViewContainerTest& operator=( - const QuickSettingsMediaViewContainerTest&) = delete; - ~QuickSettingsMediaViewContainerTest() override = default; - - void SetUp() override { - feature_list_.InitWithFeatures( - {features::kQsRevamp, media::kGlobalMediaControlsCrOSUpdatedUI}, {}); - NoSessionAshTestBase::SetUp(); - - MediaTray::SetPinnedToShelf(false); - GetPrimaryUnifiedSystemTray()->ShowBubble(); - } - - QuickSettingsView* quick_settings_view() { - return GetPrimaryUnifiedSystemTray()->bubble()->quick_settings_view(); - } - - QuickSettingsMediaViewContainer* media_view_container() { - return quick_settings_view()->media_view_container_for_testing(); - } - - private: - base::test::ScopedFeatureList feature_list_; -}; - -TEST_F(QuickSettingsMediaViewContainerTest, ChangeMediaViewVisibility) { - EXPECT_FALSE(media_view_container()->GetVisible()); - - quick_settings_view()->SetShowMediaView(true); - EXPECT_TRUE(media_view_container()->GetVisible()); - - quick_settings_view()->SetShowMediaView(false); - EXPECT_FALSE(media_view_container()->GetVisible()); -} - -TEST_F(QuickSettingsMediaViewContainerTest, - SwitchBetweenMediaViewAndDetailedView) { - quick_settings_view()->SetShowMediaView(true); - EXPECT_TRUE(media_view_container()->GetVisible()); - - // Make the quick settings view navigate to a dummy detailed view. - quick_settings_view()->SetDetailedView(std::make_unique<views::View>()); - EXPECT_FALSE(media_view_container()->GetVisible()); - - // Make the quick settings view navigate back to the main view. - quick_settings_view()->ResetDetailedView(); - EXPECT_TRUE(media_view_container()->GetVisible()); -} - -} // namespace ash
diff --git a/ash/system/media/quick_settings_media_view_controller.cc b/ash/system/media/quick_settings_media_view_controller.cc index 4334d128..5f09c8d 100644 --- a/ash/system/media/quick_settings_media_view_controller.cc +++ b/ash/system/media/quick_settings_media_view_controller.cc
@@ -24,11 +24,6 @@ media_session::MediaSessionService* service = Shell::Get()->shell_delegate()->GetMediaSessionService(); - // Return if this is called from tests and there is no media service. - if (!service) { - return; - } - mojo::Remote<media_session::mojom::AudioFocusManager> audio_focus_remote; mojo::Remote<media_session::mojom::MediaControllerManager> controller_manager_remote; @@ -110,4 +105,4 @@ media_view_->UpdateItemOrder(media_item_manager_->GetActiveItemIds()); } -} // namespace ash +} // namespace ash \ No newline at end of file
diff --git a/ash/system/media/quick_settings_media_view_controller.h b/ash/system/media/quick_settings_media_view_controller.h index 508bb8e..4f481ff1 100644 --- a/ash/system/media/quick_settings_media_view_controller.h +++ b/ash/system/media/quick_settings_media_view_controller.h
@@ -68,9 +68,6 @@ // Updates the order of media items in the quick settings media view. void UpdateMediaItemOrder(); - // Helper functions for testing. - QuickSettingsMediaView* media_view_for_testing() { return media_view_; } - private: raw_ptr<UnifiedSystemTrayController> tray_controller_ = nullptr;
diff --git a/ash/system/media/quick_settings_media_view_controller_unittest.cc b/ash/system/media/quick_settings_media_view_controller_unittest.cc deleted file mode 100644 index 89cc2a1..0000000 --- a/ash/system/media/quick_settings_media_view_controller_unittest.cc +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/system/media/quick_settings_media_view_controller.h" - -#include "ash/constants/ash_features.h" -#include "ash/system/media/media_tray.h" -#include "ash/system/media/quick_settings_media_view.h" -#include "ash/system/unified/unified_system_tray.h" -#include "ash/system/unified/unified_system_tray_bubble.h" -#include "ash/test/ash_test_base.h" -#include "base/test/scoped_feature_list.h" -#include "components/media_message_center/mock_media_notification_item.h" -#include "media/base/media_switches.h" - -namespace ash { - -class QuickSettingsMediaViewControllerTest : public NoSessionAshTestBase { - public: - QuickSettingsMediaViewControllerTest() = default; - QuickSettingsMediaViewControllerTest( - const QuickSettingsMediaViewControllerTest&) = delete; - QuickSettingsMediaViewControllerTest& operator=( - const QuickSettingsMediaViewControllerTest&) = delete; - ~QuickSettingsMediaViewControllerTest() override = default; - - void SetUp() override { - feature_list_.InitWithFeatures( - {features::kQsRevamp, media::kGlobalMediaControlsCrOSUpdatedUI}, {}); - NoSessionAshTestBase::SetUp(); - - MediaTray::SetPinnedToShelf(false); - GetPrimaryUnifiedSystemTray()->ShowBubble(); - item_ = std::make_unique<testing::NiceMock< - media_message_center::test::MockMediaNotificationItem>>(); - } - - QuickSettingsMediaViewController* controller() { - return GetPrimaryUnifiedSystemTray() - ->bubble() - ->unified_system_tray_controller() - ->media_view_controller(); - } - - QuickSettingsMediaView* view() { - return controller()->media_view_for_testing(); - } - - base::WeakPtr<media_message_center::test::MockMediaNotificationItem> item() { - return item_->GetWeakPtr(); - } - - private: - base::test::ScopedFeatureList feature_list_; - std::unique_ptr<media_message_center::test::MockMediaNotificationItem> item_; -}; - -TEST_F(QuickSettingsMediaViewControllerTest, ShowOrHideMediaItem) { - const std::string item_id = "item_id"; - EXPECT_EQ(0, static_cast<int>(view()->items_for_testing().size())); - - controller()->ShowMediaItem(item_id, item()); - EXPECT_EQ(1, static_cast<int>(view()->items_for_testing().size())); - EXPECT_TRUE(view()->items_for_testing().contains(item_id)); - - controller()->HideMediaItem(item_id); - EXPECT_EQ(0, static_cast<int>(view()->items_for_testing().size())); -} - -} // namespace ash
diff --git a/ash/system/media/quick_settings_media_view_unittest.cc b/ash/system/media/quick_settings_media_view_unittest.cc deleted file mode 100644 index c4eb0183..0000000 --- a/ash/system/media/quick_settings_media_view_unittest.cc +++ /dev/null
@@ -1,75 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/system/media/quick_settings_media_view.h" - -#include "ash/constants/ash_features.h" -#include "ash/system/media/media_tray.h" -#include "ash/system/media/quick_settings_media_view_controller.h" -#include "ash/system/unified/unified_system_tray.h" -#include "ash/system/unified/unified_system_tray_bubble.h" -#include "ash/test/ash_test_base.h" -#include "base/test/scoped_feature_list.h" -#include "components/global_media_controls/public/views/media_item_ui_view.h" -#include "components/media_message_center/mock_media_notification_item.h" -#include "media/base/media_switches.h" - -namespace ash { - -class QuickSettingsMediaViewTest : public NoSessionAshTestBase { - public: - QuickSettingsMediaViewTest() = default; - QuickSettingsMediaViewTest(const QuickSettingsMediaViewTest&) = delete; - QuickSettingsMediaViewTest& operator=(const QuickSettingsMediaViewTest&) = - delete; - ~QuickSettingsMediaViewTest() override = default; - - void SetUp() override { - feature_list_.InitWithFeatures( - {features::kQsRevamp, media::kGlobalMediaControlsCrOSUpdatedUI}, {}); - NoSessionAshTestBase::SetUp(); - - MediaTray::SetPinnedToShelf(false); - GetPrimaryUnifiedSystemTray()->ShowBubble(); - item_ = std::make_unique<testing::NiceMock< - media_message_center::test::MockMediaNotificationItem>>(); - } - - QuickSettingsMediaView* view() { - return GetPrimaryUnifiedSystemTray() - ->bubble() - ->unified_system_tray_controller() - ->media_view_controller() - ->media_view_for_testing(); - } - - base::WeakPtr<media_message_center::test::MockMediaNotificationItem> item() { - return item_->GetWeakPtr(); - } - - private: - base::test::ScopedFeatureList feature_list_; - std::unique_ptr<media_message_center::test::MockMediaNotificationItem> item_; -}; - -TEST_F(QuickSettingsMediaViewTest, ShowOrHideItem) { - const std::string item_id = "item_id"; - std::unique_ptr<global_media_controls::MediaItemUIView> item_ui = - std::make_unique<global_media_controls::MediaItemUIView>( - item_id, item(), nullptr, nullptr); - - EXPECT_EQ(0, static_cast<int>(view()->items_for_testing().size())); - EXPECT_EQ(-1, view()->pagination_model_for_testing()->total_pages()); - - view()->ShowItem(item_id, std::move(item_ui)); - EXPECT_EQ(1, static_cast<int>(view()->items_for_testing().size())); - EXPECT_TRUE(view()->items_for_testing().contains(item_id)); - EXPECT_EQ(1, view()->pagination_model_for_testing()->total_pages()); - - view()->HideItem(item_id); - EXPECT_EQ(0, static_cast<int>(view()->items_for_testing().size())); - EXPECT_EQ(0, view()->pagination_model_for_testing()->total_pages()); -} - -} // namespace ash
diff --git a/ash/system/phonehub/phone_hub_tray.cc b/ash/system/phonehub/phone_hub_tray.cc index 906844f..9ae5451 100644 --- a/ash/system/phonehub/phone_hub_tray.cc +++ b/ash/system/phonehub/phone_hub_tray.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "ash/system/phonehub/phone_hub_tray.h" + #include <utility> #include "ash/accessibility/accessibility_controller_impl.h" @@ -38,9 +39,11 @@ #include "chromeos/ash/components/phonehub/icon_decoder.h" #include "chromeos/ash/components/phonehub/phone_hub_manager.h" #include "chromeos/ash/components/phonehub/phone_model.h" +#include "chromeos/constants/chromeos_features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/chromeos/styles/cros_tokens_color_mappings.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -112,9 +115,15 @@ views::ImageButton::VerticalAlignment::ALIGN_MIDDLE); icon->SetImageHorizontalAlignment( views::ImageButton::HorizontalAlignment::ALIGN_CENTER); - icon->SetImageModel(views::ImageButton::STATE_NORMAL, - ui::ImageModel::FromVectorIcon( - kPhoneHubPhoneIcon, kColorAshIconColorPrimary)); + + icon->SetImageModel( + views::ImageButton::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + kPhoneHubPhoneIcon, + chromeos::features::IsJellyrollEnabled() + ? static_cast<ui::ColorId>(cros_tokens::kCrosSysOnSurface) + : kColorAshIconColorPrimary)); + icon_ = tray_container()->AddChildView(std::move(icon)); Shell::Get()->window_tree_host_manager()->AddObserver(this); }
diff --git a/ash/system/unified/quick_settings_view.h b/ash/system/unified/quick_settings_view.h index 7647c5c..bccb03c1d 100644 --- a/ash/system/unified/quick_settings_view.h +++ b/ash/system/unified/quick_settings_view.h
@@ -116,9 +116,6 @@ UnifiedMediaControlsContainer* media_controls_container_for_testing() { return media_controls_container_; } - QuickSettingsMediaViewContainer* media_view_container_for_testing() { - return media_view_container_; - } QuickSettingsFooter* footer_for_testing() { return footer_; } private:
diff --git a/ash/webui/camera_app_ui/resources.h b/ash/webui/camera_app_ui/resources.h index 1872109..2d89e8c6 100644 --- a/ash/webui/camera_app_ui/resources.h +++ b/ash/webui/camera_app_ui/resources.h
@@ -40,7 +40,6 @@ {"confirm_review_button", IDS_CONFIRM_REVIEW_BUTTON}, {"delete_page_button", IDS_DELETE_PAGE_BUTTON}, {"delete_page_message", IDS_DELETE_PAGE_MESSAGE}, - {"dialog_cancel_button", IDS_DIALOG_CANCEL_BUTTON}, {"dialog_ok_button", IDS_DIALOG_OK_BUTTON}, {"doc_scan_menu_button", IDS_DOC_SCAN_MENU_BUTTON}, {"document_corner_move_desc", IDS_DOCUMENT_CORNER_MOVE_DESC},
diff --git a/ash/webui/camera_app_ui/resources/css/button.css b/ash/webui/camera_app_ui/resources/css/button.css index b12abcf..c8892c55 100644 --- a/ash/webui/camera_app_ui/resources/css/button.css +++ b/ash/webui/camera_app_ui/resources/css/button.css
@@ -22,44 +22,40 @@ } .text-button.dark.primary { - background: var(--blue-300); - color: var(--grey-900); + background: var(--cros-sys-primary); + color: var(--cros-sys-on_primary); } .text-button.dark.primary:hover { - background: rgba(var(--blue-300-rgb), 0.92); + /* Use linear-gradient to apply multiple background colors. */ + background: linear-gradient( + 0deg, + var(--cros-sys-hover_on_prominent), + var(--cros-sys-hover_on_prominent) + ), var(--cros-sys-primary); } -.text-button.dark.secondary { - background: 1px solid var(--grey-900); - border: 1px solid var(--grey-700); - color: var(--blue-300); -} +.text-button.dark:is(.secondary, .system-secondary) { + background: var(--cros-sys-primary_container); + color: var(--cros-sys-on_primary_container); -.text-button.dark.secondary:hover { - background: rgba(var(--blue-300-rgb), 0.08); -} + :is(svg-wrapper) { + color: var(--cros-sys-on_primary_container); + } -.text-button.dark.system-secondary { - background: rgba(255, 255, 255, 0.1); - color: var(--grey-200); -} - -.text-button.dark.system-secondary:hover, -.text-button.dark.system-secondary:focus { - background-color: rgba(0, 0, 0, 0.05); + &:hover { + background: linear-gradient( + 0deg, + var(--cros-sys-hover_on_subtle), + var(--cros-sys-hover_on_subtle) + ), var(--cros-sys-primary_container); + } } .icon-button { - background-position: center; - background-repeat: no-repeat; - border-radius: 50%; -} - -button.icon-button:focus { - outline-offset: 2px; + border-radius: 12px; } button.icon-button.dark:hover { - background-color: rgba(var(--blue-300-rgb), 0.08); + background: var(--cros-sys-hover_on_subtle); }
diff --git a/ash/webui/camera_app_ui/resources/css/colors_default.css b/ash/webui/camera_app_ui/resources/css/colors_default.css index 49389d3..60a5210 100644 --- a/ash/webui/camera_app_ui/resources/css/colors_default.css +++ b/ash/webui/camera_app_ui/resources/css/colors_default.css
@@ -13,17 +13,23 @@ --cros-sys-base_elevated: var(--grey-900); --cros-sys-error_container: rgba(var(--red-300-rgb), 0.3); --cros-sys-focus_ring: var(--blue-300); + --cros-sys-highlight_shape: rgba(var(--blue-300-rgb), 0.3); --cros-sys-hover_on_prominent: rgba(255, 255, 255, 0.08); --cros-sys-hover_on_subtle: rgba(255, 255, 255, 0.06); + --cros-sys-illo-color3: var(--blue-300); --cros-sys-inverse_on_surface: black; --cros-sys-inverse_surface: var(--grey-200); + --cros-sys-on_background: var(--grey-200); + --cros-sys-on_error_container: var(--red-300); + --cros-sys-on_primary: var(--grey-900); + --cros-sys-on_primary_container: var(--grey-200); + --cros-sys-on_surface: var(--grey-200); --cros-sys-primary: var(--blue-300); + --cros-sys-scrim: rgba(0, 0, 0, 0.6); --cros-sys-scrim2: rgba(0, 0, 0, 0.6); --cros-sys-secondary: var(--grey-400); --cros-sys-secondary_container: var(--grey-600); --cros-sys-separator: rgba(255, 255, 255, 0.14); - --cros-sys-on_error_container: var(--red-300); - --cros-sys-on_surface: var(--grey-200); } .mode-item > input:checked + span { @@ -113,3 +119,50 @@ :is(#start-takephoto, #video-snapshot):enabled:active svg-wrapper { color: var(--blue-500); } + +#view-document-review .document-pages { + background: rgba(255, 255, 255, 0.06); +} + +#view-document-review .preview-area { + background: transparent; + border: 1px solid rgba(var(--grey-200-rgb), 0.38); + border-radius: 0; +} + +.document-fix-mode .dot::after { + background: rgba(var(--blue-300-rgb), 0.24); +} + +.document-fix-mode .crop-area { + fill: rgba(var(--blue-300-rgb), 0.3); +} + +.text-button.dark.secondary { + background: var(--grey-900); + border: 1px solid var(--grey-700); + color: var(--blue-300); +} + +.text-button.dark.secondary:hover { + background: rgba(var(--blue-300-rgb), 0.08); +} + +.text-button.dark.system-secondary { + background: rgba(255, 255, 255, 0.1); +} + +.text-button.dark.system-secondary:hover, +.text-button.dark.system-secondary:focus { + background: rgba(0, 0, 0, 0.05); +} + +.icon-button { + background-position: center; + background-repeat: no-repeat; + border-radius: 50%; +} + +#view-document-review .delete { + border-radius: 50%; +}
diff --git a/ash/webui/camera_app_ui/resources/css/main.css b/ash/webui/camera_app_ui/resources/css/main.css index e885ae4b..2043558 100644 --- a/ash/webui/camera_app_ui/resources/css/main.css +++ b/ash/webui/camera_app_ui/resources/css/main.css
@@ -1254,7 +1254,6 @@ .menu-header button.icon { /* Icon image is small enough and won't be covered by -1px */ - background-image: url(/images/settings_button_back.svg); outline-offset: -1px; } @@ -1315,7 +1314,7 @@ } .dialog { - background: rgba(0, 0, 0, 0.6); + background: var(--cros-sys-scrim); } #view-splash { @@ -1479,7 +1478,7 @@ } .low-storage-dialog-popup { - background: var(--grey-900); + background: var(--cros-sys-base_elevated); border-radius: 8px; display: flex; flex-direction: column; @@ -1494,7 +1493,7 @@ } .low-storage-dialog-popup .dialog-description { - color: var(--grey-400); + color: var(--cros-sys-secondary); font: 400 14px/20px var(--default-font-family); } @@ -1513,7 +1512,6 @@ } .low-storage-dialog-buttons .external-link-icon { - background: url(/images/external_link_icon.svg); height: 20px; width: 20px; }
diff --git a/ash/webui/camera_app_ui/resources/css/mode/scan.css b/ash/webui/camera_app_ui/resources/css/mode/scan.css index b15a1c0..b236363 100644 --- a/ash/webui/camera_app_ui/resources/css/mode/scan.css +++ b/ash/webui/camera_app_ui/resources/css/mode/scan.css
@@ -279,7 +279,7 @@ } #preview-document-corner-overlay .corner div { - background: var(--blue-300); + background: var(--cros-sys-illo-color3); } #preview-document-corner-overlay .corner { @@ -306,19 +306,19 @@ } #preview-document-corner-overlay .side.line { - background: var(--blue-500); + background: var(--cros-sys-illo-color3); height: 1px; width: 1px; } #preview-document-corner-overlay .no-document-toast { - background: var(--grey-900); - border-radius: 6px; - color: var(--grey-400); + background: var(--cros-sys-base_elevated); + border-radius: var(--border-radius-rounded-with-short-side); + color: var(--cros-sys-on_surface); display: inline-block; font: normal 400 14px/20px Roboto; left: 50%; - padding: 8px 10px; + padding: 8px 16px; position: absolute; text-align: center; top: 22px; @@ -332,13 +332,12 @@ } #back-to-review-document { - background-image: url(/images/settings_button_back.svg); visibility: hidden; } #document-page-count { align-items: center; - color: var(--grey-200); + color: var(--cros-sys-on_surface); display: flex; font-size: 12px; justify-content: center; @@ -357,7 +356,7 @@ } #view-document-review .document-pages { - background: rgba(255, 255, 255, 0.06); + background: var(--cros-sys-base_elevated); counter-reset: page-count; overflow: auto; padding: 16px; @@ -376,7 +375,7 @@ } #view-document-review .page.active { - background: rgba(var(--blue-300-rgb), 0.3); + background: var(--cros-sys-highlight_shape); } #view-document-review .delete-container { @@ -389,7 +388,7 @@ #view-document-review .delete-container::before { align-self: flex-start; - color: var(--grey-200); + color: var(--cros-sys-on_surface); content: counter(page-count); counter-increment: page-count; font-size: 13px; @@ -397,8 +396,7 @@ } #view-document-review .delete { - background-image: url(/images/document_review_delete_page.svg); - border-radius: 50%; + border-radius: 12px; visibility: hidden; } @@ -429,11 +427,13 @@ min-width: 0; padding-inline-end: var(--preview-area-padding-inline-end); padding-inline-start: var(--preview-area-padding-inline-start); + padding-top: 8px; position: relative; } #view-document-review .preview-area { - border: 1px solid rgba(var(--grey-200-rgb), 0.38); + background: var(--cros-sys-app_base_shaded); + border-radius: 12px; flex: 1; /* Default min-height of column direction flex items is auto. */ min-height: 0; @@ -466,7 +466,7 @@ } .document-preview-mode .separator { - background-color: rgba(255, 255, 255, 0.08); + background-color: var(--cros-sys-separator); height: 32px; width: 1px; } @@ -487,29 +487,26 @@ } .document-preview-mode button[i18n-label=add_new_page_button] { - background-image: url(/images/document_review_add_page.svg); display: none; } .document-preview-mode button[i18n-label=label_share] { - background-image: url(/images/document_review_share.svg); display: none; } .document-preview-mode button[i18n-label=fix_page_button] { - background-image: url(/images/document_review_fix_page.svg); display: none; } -.document-preview-mode #doc-scan-menu-button { - background-image: url(/images/more_horizontal.svg); -} - .document-preview-mode .menu-item-content { display: flex; gap: 16px; } +.document-preview-mode .menu-item-icon { + margin: 0; +} + .document-fix-mode { display: none; } @@ -539,8 +536,10 @@ } .document-fix-mode .crop-area { - fill: rgba(var(--blue-300-rgb), 0.3); - stroke: var(--blue-500); + /* TODO(pihsun): Change this after the new token is added. */ + fill: color-mix(in srgb, var(--cros-sys-illo-color3) 8%, transparent); + stroke: var(--cros-sys-illo-color3); + stroke-width: 2px; } .document-fix-mode .dot { @@ -573,13 +572,14 @@ } .document-fix-mode .dot::before { - background: var(--blue-300); + background: var(--cros-sys-illo-color3); box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12); } .document-fix-mode .dot::after { - background: rgba(var(--blue-300-rgb), 0.24); - border: 2px solid var(--blue-300); + /* TODO(pihsun): Change this after the new token is added. */ + background: color-mix(in srgb, var(--cros-sys-illo-color3) 8%, transparent); + border: 2px solid var(--cros-sys-illo-color3); box-sizing: border-box; } @@ -599,14 +599,6 @@ transform: translateX(-50%); } -.document-fix-mode button[i18n-label=rotate_clockwise_button] { - background-image: url(/images/crop_document_clockwise_rotate.svg); -} - -.document-fix-mode button[i18n-label=rotate_counterclockwise_button] { - background-image: url(/images/crop_document_counterclockwise_rotate.svg); -} - @media (min-width: 680px) { #view-document-review .thumbnail-container { max-height: 120px;
diff --git a/ash/webui/camera_app_ui/resources/images/crop_document_clockwise_rotate.svg b/ash/webui/camera_app_ui/resources/images/crop_document_clockwise_rotate.svg index 0c861f8..b775a7c 100644 --- a/ash/webui/camera_app_ui/resources/images/crop_document_clockwise_rotate.svg +++ b/ash/webui/camera_app_ui/resources/images/crop_document_clockwise_rotate.svg
@@ -1,3 +1,3 @@ <svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M8.3208 0.92041L6.82144 2.42041L8.14419 3.74274C3.8074 4.07318 0.391365 7.69675 0.391365 12.1182C0.391365 16.7574 4.15217 20.5182 8.79136 20.5182C9.93035 20.5182 11.0164 20.2915 12.0068 19.8808L10.1005 17.9749C9.6791 18.0687 9.24101 18.1182 8.79136 18.1182C5.47766 18.1182 2.79136 15.4319 2.79136 12.1182C2.79136 8.86772 5.37609 6.22095 8.60233 6.1211L6.82144 7.90561L8.3208 9.40569L12.5634 5.16305L8.3208 0.92041ZM14.2605 6.86011L8.3208 12.7998L14.2605 18.7395L20.2002 12.7998L14.2605 6.86011ZM14.2605 10.2542L16.8061 12.7998L14.2605 15.3454L11.7149 12.7998L14.2605 10.2542Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M8.3208 0.92041L6.82144 2.42041L8.14419 3.74274C3.8074 4.07318 0.391365 7.69675 0.391365 12.1182C0.391365 16.7574 4.15217 20.5182 8.79136 20.5182C9.93035 20.5182 11.0164 20.2915 12.0068 19.8808L10.1005 17.9749C9.6791 18.0687 9.24101 18.1182 8.79136 18.1182C5.47766 18.1182 2.79136 15.4319 2.79136 12.1182C2.79136 8.86772 5.37609 6.22095 8.60233 6.1211L6.82144 7.90561L8.3208 9.40569L12.5634 5.16305L8.3208 0.92041ZM14.2605 6.86011L8.3208 12.7998L14.2605 18.7395L20.2002 12.7998L14.2605 6.86011ZM14.2605 10.2542L16.8061 12.7998L14.2605 15.3454L11.7149 12.7998L14.2605 10.2542Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/crop_document_counterclockwise_rotate.svg b/ash/webui/camera_app_ui/resources/images/crop_document_counterclockwise_rotate.svg index d92716dc..c1979a0 100644 --- a/ash/webui/camera_app_ui/resources/images/crop_document_counterclockwise_rotate.svg +++ b/ash/webui/camera_app_ui/resources/images/crop_document_counterclockwise_rotate.svg
@@ -1,3 +1,3 @@ <svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6792 0.92041L14.1786 2.42041L12.8558 3.74274C17.1926 4.07318 20.6086 7.69675 20.6086 12.1182C20.6086 16.7574 16.8478 20.5182 12.2086 20.5182C11.0696 20.5182 9.98361 20.2915 8.99317 19.8808L10.8995 17.9749C11.3209 18.0687 11.759 18.1182 12.2086 18.1182C15.5223 18.1182 18.2086 15.4319 18.2086 12.1182C18.2086 8.86772 15.6239 6.22095 12.3977 6.1211L14.1786 7.90561L12.6792 9.40569L8.43656 5.16305L12.6792 0.92041ZM6.7395 6.86011L12.6792 12.7998L6.7395 18.7395L0.799805 12.7998L6.7395 6.86011ZM6.7395 10.2542L4.19392 12.7998L6.7395 15.3454L9.28509 12.7998L6.7395 10.2542Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6792 0.92041L14.1786 2.42041L12.8558 3.74274C17.1926 4.07318 20.6086 7.69675 20.6086 12.1182C20.6086 16.7574 16.8478 20.5182 12.2086 20.5182C11.0696 20.5182 9.98361 20.2915 8.99317 19.8808L10.8995 17.9749C11.3209 18.0687 11.759 18.1182 12.2086 18.1182C15.5223 18.1182 18.2086 15.4319 18.2086 12.1182C18.2086 8.86772 15.6239 6.22095 12.3977 6.1211L14.1786 7.90561L12.6792 9.40569L8.43656 5.16305L12.6792 0.92041ZM6.7395 6.86011L12.6792 12.7998L6.7395 18.7395L0.799805 12.7998L6.7395 6.86011ZM6.7395 10.2542L4.19392 12.7998L6.7395 15.3454L9.28509 12.7998L6.7395 10.2542Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/document_review_add_page.svg b/ash/webui/camera_app_ui/resources/images/document_review_add_page.svg index 754e37e50..8a42d74 100644 --- a/ash/webui/camera_app_ui/resources/images/document_review_add_page.svg +++ b/ash/webui/camera_app_ui/resources/images/document_review_add_page.svg
@@ -1,3 +1,3 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3334 13.3334V3.33335C18.3334 2.41669 17.5834 1.66669 16.6667 1.66669H6.66675C5.75008 1.66669 5.00008 2.41669 5.00008 3.33335V13.3334C5.00008 14.25 5.75008 15 6.66675 15H16.6667C17.5834 15 18.3334 14.25 18.3334 13.3334ZM15.0001 16.6667H3.33341V5.00002H1.66675V16.6667C1.66675 17.5834 2.41675 18.3334 3.33341 18.3334H15.0001V16.6667ZM16.6667 3.33335H6.66675V13.3334H16.6667V3.33335ZM12.5001 11.6667H10.8334V9.16669H8.33342V7.50002H10.8334V5.00002H12.5001V7.50002H15.0001V9.16669H12.5001V11.6667Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3334 13.3334V3.33335C18.3334 2.41669 17.5834 1.66669 16.6667 1.66669H6.66675C5.75008 1.66669 5.00008 2.41669 5.00008 3.33335V13.3334C5.00008 14.25 5.75008 15 6.66675 15H16.6667C17.5834 15 18.3334 14.25 18.3334 13.3334ZM15.0001 16.6667H3.33341V5.00002H1.66675V16.6667C1.66675 17.5834 2.41675 18.3334 3.33341 18.3334H15.0001V16.6667ZM16.6667 3.33335H6.66675V13.3334H16.6667V3.33335ZM12.5001 11.6667H10.8334V9.16669H8.33342V7.50002H10.8334V5.00002H12.5001V7.50002H15.0001V9.16669H12.5001V11.6667Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/document_review_delete_page.svg b/ash/webui/camera_app_ui/resources/images/document_review_delete_page.svg index acc2af7..658fe0c 100644 --- a/ash/webui/camera_app_ui/resources/images/document_review_delete_page.svg +++ b/ash/webui/camera_app_ui/resources/images/document_review_delete_page.svg
@@ -1,3 +1,3 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M13 3V2H7V3H3V5H4V16C4 17.1 4.9 18 6 18H14C15.1 18 16 17.1 16 16V5H17V3H13ZM14 16H6V5H14V16Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M13 3V2H7V3H3V5H4V16C4 17.1 4.9 18 6 18H14C15.1 18 16 17.1 16 16V5H17V3H13ZM14 16H6V5H14V16Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/document_review_fix_page.svg b/ash/webui/camera_app_ui/resources/images/document_review_fix_page.svg index e1a2f34c..d5441a5 100644 --- a/ash/webui/camera_app_ui/resources/images/document_review_fix_page.svg +++ b/ash/webui/camera_app_ui/resources/images/document_review_fix_page.svg
@@ -1,3 +1,3 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M15.8833 2.99165L17.0083 4.11665C17.6667 4.76665 17.6667 5.82498 17.0083 6.47498L5.98333 17.5H2.5V14.0167L13.525 2.99165C14.175 2.34165 15.2333 2.34165 15.8833 2.99165ZM4.16667 15.8333L5.34167 15.8833L13.525 7.69165L12.35 6.51665L4.16667 14.7V15.8333Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M15.8833 2.99165L17.0083 4.11665C17.6667 4.76665 17.6667 5.82498 17.0083 6.47498L5.98333 17.5H2.5V14.0167L13.525 2.99165C14.175 2.34165 15.2333 2.34165 15.8833 2.99165ZM4.16667 15.8333L5.34167 15.8833L13.525 7.69165L12.35 6.51665L4.16667 14.7V15.8333Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/document_review_share.svg b/ash/webui/camera_app_ui/resources/images/document_review_share.svg index 3fd924a..214afaab 100644 --- a/ash/webui/camera_app_ui/resources/images/document_review_share.svg +++ b/ash/webui/camera_app_ui/resources/images/document_review_share.svg
@@ -1,3 +1,3 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M14 12C13.21 12 12.5 12.31 11.97 12.81L7.91 10.7C7.96 10.47 8 10.24 8 10C8 9.76 7.96 9.53 7.91 9.3L11.96 7.19C12.49 7.69 13.21 8 14 8C15.66 8 17 6.66 17 5C17 3.34 15.66 2 14 2C12.34 2 11 3.34 11 5C11 5.24 11.04 5.48 11.09 5.7L7.04 7.81C6.5 7.31 5.79 7 5 7C3.34 7 2 8.34 2 10C2 11.66 3.34 13 5 13C5.79 13 6.5 12.69 7.04 12.19L11.09 14.31C11.04 14.53 11 14.76 11 15C11 16.66 12.34 18 14 18C15.66 18 17 16.66 17 15C17 13.34 15.66 12 14 12ZM14 4C14.55 4 15 4.45 15 5C15 5.55 14.55 6 14 6C13.45 6 13 5.55 13 5C13 4.45 13.45 4 14 4ZM5 11C4.45 11 4 10.55 4 10C4 9.45 4.45 9 5 9C5.55 9 6 9.45 6 10C6 10.55 5.55 11 5 11ZM14 16C13.45 16 13 15.55 13 15C13 14.45 13.45 14 14 14C14.55 14 15 14.45 15 15C15 15.55 14.55 16 14 16Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M14 12C13.21 12 12.5 12.31 11.97 12.81L7.91 10.7C7.96 10.47 8 10.24 8 10C8 9.76 7.96 9.53 7.91 9.3L11.96 7.19C12.49 7.69 13.21 8 14 8C15.66 8 17 6.66 17 5C17 3.34 15.66 2 14 2C12.34 2 11 3.34 11 5C11 5.24 11.04 5.48 11.09 5.7L7.04 7.81C6.5 7.31 5.79 7 5 7C3.34 7 2 8.34 2 10C2 11.66 3.34 13 5 13C5.79 13 6.5 12.69 7.04 12.19L11.09 14.31C11.04 14.53 11 14.76 11 15C11 16.66 12.34 18 14 18C15.66 18 17 16.66 17 15C17 13.34 15.66 12 14 12ZM14 4C14.55 4 15 4.45 15 5C15 5.55 14.55 6 14 6C13.45 6 13 5.55 13 5C13 4.45 13.45 4 14 4ZM5 11C4.45 11 4 10.55 4 10C4 9.45 4.45 9 5 9C5.55 9 6 9.45 6 10C6 10.55 5.55 11 5 11ZM14 16C13.45 16 13 15.55 13 15C13 14.45 13.45 14 14 14C14.55 14 15 14.45 15 15C15 15.55 14.55 16 14 16Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/external_link_icon.svg b/ash/webui/camera_app_ui/resources/images/external_link_icon.svg index f6c45d5..0106608 100644 --- a/ash/webui/camera_app_ui/resources/images/external_link_icon.svg +++ b/ash/webui/camera_app_ui/resources/images/external_link_icon.svg
@@ -1,4 +1,4 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path d="M5.00003 15H15V11H17V15C17 16 16 17 15 17H5.00003C4.00003 17 3.00003 16 3.00003 15V5C3.00003 4 4.00003 3 5.00003 3H9.00003V5H5.00003V15Z" fill="#E8EAED"/> -<path d="M11 5V3H17V9H15V6.5L8.49997 13L6.99997 11.5L13.5 5H11Z" fill="#E8EAED"/> +<path d="M5.00003 15H15V11H17V15C17 16 16 17 15 17H5.00003C4.00003 17 3.00003 16 3.00003 15V5C3.00003 4 4.00003 3 5.00003 3H9.00003V5H5.00003V15Z"/> +<path d="M11 5V3H17V9H15V6.5L8.49997 13L6.99997 11.5L13.5 5H11Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/more_horizontal.svg b/ash/webui/camera_app_ui/resources/images/more_horizontal.svg index 9f4682d..963ddf1 100644 --- a/ash/webui/camera_app_ui/resources/images/more_horizontal.svg +++ b/ash/webui/camera_app_ui/resources/images/more_horizontal.svg
@@ -1,3 +1,3 @@ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path fill-rule="evenodd" clip-rule="evenodd" d="M14 10C14 8.896 14.896 8 16 8C17.105 8 18 8.896 18 10C18 11.105 17.105 12 16 12C14.896 12 14 11.105 14 10ZM12 10C12 11.105 11.105 12 10 12C8.896 12 8 11.105 8 10C8 8.896 8.896 8 10 8C11.105 8 12 8.896 12 10ZM6 10C6 11.105 5.105 12 4 12C2.896 12 2 11.105 2 10C2 8.896 2.896 8 4 8C5.105 8 6 8.896 6 10Z" fill="#E8EAED"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M14 10C14 8.896 14.896 8 16 8C17.105 8 18 8.896 18 10C18 11.105 17.105 12 16 12C14.896 12 14 11.105 14 10ZM12 10C12 11.105 11.105 12 10 12C8.896 12 8 11.105 8 10C8 8.896 8.896 8 10 8C11.105 8 12 8.896 12 10ZM6 10C6 11.105 5.105 12 4 12C2.896 12 2 11.105 2 10C2 8.896 2.896 8 4 8C5.105 8 6 8.896 6 10Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/images/settings_button_back.svg b/ash/webui/camera_app_ui/resources/images/settings_button_back.svg index d07e063a..33c0a2fb6 100644 --- a/ash/webui/camera_app_ui/resources/images/settings_button_back.svg +++ b/ash/webui/camera_app_ui/resources/images/settings_button_back.svg
@@ -1,14 +1,3 @@ -<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <defs> - <polygon id="path-1" points="16.6666667 9.16666667 6.525 9.16666667 11.1833333 4.50833333 10 3.33333333 3.33333333 10 10 16.6666667 11.175 15.4916667 6.525 10.8333333 16.6666667 10.8333333"></polygon> - </defs> - <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> - <g id="Group"> - <mask id="mask-2" fill="white"> - <use xlink:href="#path-1"></use> - </mask> - <use id="ic_arrow_back_24px" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-1"></use> - <rect id="Rectangle" x="0" y="0" width="20" height="20"></rect> - </g> - </g> +<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6.43718 9L11.4538 4.23375L10.1795 3L3 10L10.1795 17L11.4449 15.7662L6.43718 11H17V9H6.43718Z"/> </svg>
diff --git a/ash/webui/camera_app_ui/resources/js/i18n_string.ts b/ash/webui/camera_app_ui/resources/js/i18n_string.ts index b41bae39..0f3a3ac 100644 --- a/ash/webui/camera_app_ui/resources/js/i18n_string.ts +++ b/ash/webui/camera_app_ui/resources/js/i18n_string.ts
@@ -31,7 +31,6 @@ CONFIRM_REVIEW_BUTTON = 'confirm_review_button', DELETE_PAGE_BUTTON = 'delete_page_button', DELETE_PAGE_MESSAGE = 'delete_page_message', - DIALOG_CANCEL_BUTTON = 'dialog_cancel_button', DIALOG_OK_BUTTON = 'dialog_ok_button', DOC_SCAN_MENU_BUTTON = 'doc_scan_menu_button', DOCUMENT_CORNER_MOVE_DESC = 'document_corner_move_desc',
diff --git a/ash/webui/camera_app_ui/resources/js/lit/svg_wrapper.ts b/ash/webui/camera_app_ui/resources/js/lit/svg_wrapper.ts index fe5438b..b59f532 100644 --- a/ash/webui/camera_app_ui/resources/js/lit/svg_wrapper.ts +++ b/ash/webui/camera_app_ui/resources/js/lit/svg_wrapper.ts
@@ -35,7 +35,7 @@ name: {type: String}, }; - name = null; + name: string|null = null; override connectedCallback(): void { super.connectedCallback();
diff --git a/ash/webui/camera_app_ui/resources/js/views/document_preview_mode.ts b/ash/webui/camera_app_ui/resources/js/views/document_preview_mode.ts index 01628081..bb3de859 100644 --- a/ash/webui/camera_app_ui/resources/js/views/document_preview_mode.ts +++ b/ash/webui/camera_app_ui/resources/js/views/document_preview_mode.ts
@@ -70,7 +70,7 @@ { render: (el: HTMLElement) => { const {icon, label, container} = makeMenuItemElements(); - icon.src = '/images/document_review_add_page.svg'; + icon.setAttribute('name', 'document_review_add_page.svg'); label.textContent = getI18nMessage(I18nString.ADD_NEW_PAGE_BUTTON); container.append(icon, label); el.append(container); @@ -80,7 +80,7 @@ { render: (el: HTMLElement) => { const {icon, label, container} = makeMenuItemElements(); - icon.src = '/images/document_review_share.svg'; + icon.setAttribute('name', 'document_review_share.svg'); label.textContent = getI18nMessage(I18nString.LABEL_SHARE); container.append(icon, label); el.append(container); @@ -91,7 +91,7 @@ render: (el: HTMLElement) => { const {icon, label, container} = makeMenuItemElements(); this.fixPageMenuItemLabel = label; - icon.src = '/images/document_review_fix_page.svg'; + icon.setAttribute('name', 'document_review_fix_page.svg'); label.textContent = getI18nMessage(I18nString.FIX_PAGE_BUTTON); container.append(icon, label); el.append(container); @@ -106,7 +106,7 @@ const fragment = instantiateTemplate('#doc-scan-menu-item-content'); const container = dom.getFrom(fragment, '.menu-item-content', HTMLDivElement); - const icon = dom.getFrom(fragment, '.menu-item-icon', HTMLImageElement); + const icon = dom.getFrom(fragment, '.menu-item-icon', HTMLElement); const label = dom.getFrom(fragment, '.menu-item-label', HTMLDivElement); return {icon, label, container}; }
diff --git a/ash/webui/camera_app_ui/resources/strings/camera_strings.grd b/ash/webui/camera_app_ui/resources/strings/camera_strings.grd index 7e4d0f7..d2dcb37 100644 --- a/ash/webui/camera_app_ui/resources/strings/camera_strings.grd +++ b/ash/webui/camera_app_ui/resources/strings/camera_strings.grd
@@ -186,9 +186,6 @@ <message desc="Label for the help button." name="IDS_HELP_BUTTON"> Help </message> - <message desc="Label for the dismissing button in the dialog." name="IDS_DIALOG_CANCEL_BUTTON"> - Cancel - </message> <message desc="Label for the gallery button." name="IDS_GALLERY_BUTTON"> Go to Gallery </message> @@ -591,7 +588,7 @@ Full resolution </message> <message desc="Label of the option to specify the medium resolution in the resolution settings" name="IDS_LABEL_MEDIUM_RESOLUTION"> - Medium resolution + Medium </message> <message desc="Label of the option to select other aspect ratio rather than the common ones (4:3, 16:9)." name="IDS_LABEL_OTHER_ASPECT_RATIO"> Others
diff --git a/ash/webui/camera_app_ui/resources/strings/camera_strings_grd/IDS_LABEL_MEDIUM_RESOLUTION.png.sha1 b/ash/webui/camera_app_ui/resources/strings/camera_strings_grd/IDS_LABEL_MEDIUM_RESOLUTION.png.sha1 index e45d5d2..5af0eab88 100644 --- a/ash/webui/camera_app_ui/resources/strings/camera_strings_grd/IDS_LABEL_MEDIUM_RESOLUTION.png.sha1 +++ b/ash/webui/camera_app_ui/resources/strings/camera_strings_grd/IDS_LABEL_MEDIUM_RESOLUTION.png.sha1
@@ -1 +1 @@ -9412c87cbf22ea4be0ca128dc8c50f8efb139ffe \ No newline at end of file +b985c51289aecd45660968bc6a62ab9c330771ef \ No newline at end of file
diff --git a/ash/webui/camera_app_ui/resources/utils/cca.py b/ash/webui/camera_app_ui/resources/utils/cca.py index ffea0b4..92f12c8 100755 --- a/ash/webui/camera_app_ui/resources/utils/cca.py +++ b/ash/webui/camera_app_ui/resources/utils/cca.py
@@ -188,11 +188,57 @@ json.dump(tsconfig, f) +def reload_cca(device): + try: + run([ + 'ssh', + device, + '--', + 'cca', + 'open', + '&&', + 'cca', + 'eval', + shlex.quote("document.location.reload()"), + ">", + "/dev/null", + ]) + except subprocess.CalledProcessError as e: + print('Failed to reload CCA on DUT, ' + 'please make sure that the DUT is logged in ' + 'and `cca setup` has been run on DUT.') + + # Use a fixed temporary output folder for deploy, so incremental compilation # works and deploy is faster. DEPLOY_OUTPUT_TEMP_DIR = '/tmp/cca-deploy-out' +def rsync_to_device(device, src, target, *, extra_arguments=[]): + cmd = [ + 'rsync', + '--recursive', + '--inplace', + '--delete', + '--mkpath', + '--times', + # rsync by default use source file permission masked by target file + # system umask while transferring new files, and since workstation + # defaults to have file not readable by others, this makes deployed + # file not readable by Chrome. + # Set --chmod=a+rX to rsync to fix this ('a' so it won't be affected by + # local umask, +r for read and +X for executable bit on folder), and + # set --perms so existing files that might have the wrong permission + # will have their permission fixed. + '--perms', + '--chmod=a+rX', + *extra_arguments, + src, + f'{device}:{target}', + ] + run(cmd) + + def deploy(args): root_dir = get_chromium_root() cca_root = os.getcwd() @@ -225,41 +271,14 @@ build_preload_images_js(js_out_dir) - deploy_new_tsc_files = [ - 'rsync', - '--recursive', - '--inplace', - '--delete', - '--mkpath', - '--exclude=tsconfig.tsbuildinfo', - # rsync by default use source file permission masked by target file - # system umask while transferring new files, and since workstation - # defaults to have file not readable by others, this makes deployed - # file not readable by Chrome. - # Set --chmod=a+rX to rsync to fix this ('a' so it won't be affected by - # local umask, +r for read and +X for executable bit on folder), and - # set --perms so existing files that might have the wrong permission - # will have their permission fixed. - '--perms', - '--chmod=a+rX', - f'{js_out_dir}/', - f'{args.device}:{CCA_OVERRIDE_PATH}/js/', - ] - run(deploy_new_tsc_files) + rsync_to_device(args.device, + f'{js_out_dir}/', + f'{CCA_OVERRIDE_PATH}/js/', + extra_arguments=['--exclude=tsconfig.tsbuildinfo']) for dir in ['css', 'images', 'views', 'sounds']: - deploy_new_assets = [ - 'rsync', - '--recursive', - '--inplace', - '--delete', - '--mkpath', - '--perms', - '--chmod=a+rX', - f'{os.path.join(cca_root, dir)}/', - f'{args.device}:{CCA_OVERRIDE_PATH}/{dir}/', - ] - run(deploy_new_assets) + rsync_to_device(args.device, f'{os.path.join(cca_root, dir)}/', + f'{CCA_OVERRIDE_PATH}/{dir}/') current_time = time.strftime('%F %T%z') run([ @@ -277,6 +296,9 @@ ensure_local_override_enabled(args.device, args.force) + if args.reload: + reload_cca(args.device) + def test(args): assert 'CCAUI' not in args.device, ( @@ -466,7 +488,7 @@ deploy_parser = subparsers.add_parser('deploy', help='deploy to device', description='''Deploy CCA to device. - This script only works if there is no file added/deleted. + This script only works if there's no .cc / .grd changes. And please build Chrome at least once before running the command.''' ) deploy_parser.add_argument('board') @@ -474,6 +496,11 @@ deploy_parser.add_argument('--force', help="Don't prompt for restarting Chrome.", action='store_true') + deploy_parser.add_argument( + '--reload', + help='Try reloading CCA window after deploy. ' + 'Please run `cca setup` on DUT once before using this argument.', + action='store_true') deploy_parser.set_defaults(func=deploy) test_parser = subparsers.add_parser('test',
diff --git a/ash/webui/camera_app_ui/resources/views/main.html b/ash/webui/camera_app_ui/resources/views/main.html index cd79f00..1f64218 100644 --- a/ash/webui/camera_app_ui/resources/views/main.html +++ b/ash/webui/camera_app_ui/resources/views/main.html
@@ -134,7 +134,8 @@ </div> <div class="top-stripe left-stripe buttons circle"> <button id="back-to-review-document" tabindex="0" - i18n-label="back_button"></button> + i18n-label="back_button" data-svg="settings_button_back.svg"> + </button> </div> <div class="top-stripe right-stripe circle buttons"> <button id="toggle-mic" role="checkbox" tabindex="0" @@ -303,7 +304,8 @@ <div id="view-settings" class="settings"> <div class="menu"> <div class="menu-header circle"> - <button class="icon" tabindex="0" i18n-aria="back_button"></button> + <button class="icon" tabindex="0" i18n-aria="back_button" + data-svg="settings_button_back.svg"></button> <div id="settings-header" i18n-text="settings_button"></div> </div> <button id="settings-photo-resolution" class="menu-item inkdrop @@ -355,7 +357,8 @@ <div id="view-photo-resolution-settings" class="settings"> <div class="menu"> <div class="menu-header circle"> - <button class="icon" tabindex="0" i18n-aria="back_button"></button> + <button class="icon" tabindex="0" i18n-aria="back_button" + data-svg="settings_button_back.svg"></button> <div i18n-text="photo_resolution_button"></div> </div> </div> @@ -363,7 +366,8 @@ <div id="view-photo-aspect-ratio-settings" class="settings"> <div class="menu" data-name="aspectratios"> <div class="menu-header circle"> - <button class="icon" tabindex="0" i18n-aria="back_button"></button> + <button class="icon" tabindex="0" i18n-aria="back_button" + data-svg="settings_button_back.svg"></button> <div i18n-text="photo_aspect_ratio_button"></div> </div> </div> @@ -371,7 +375,8 @@ <div id="view-video-resolution-settings" class="settings"> <div class="menu" data-name="videores"> <div class="menu-header circle"> - <button class="icon" tabindex="0" i18n-aria="back_button"></button> + <button class="icon" tabindex="0" i18n-aria="back_button" + data-svg="settings_button_back.svg"></button> <div i18n-text="video_resolution_button"></div> </div> </div> @@ -379,7 +384,8 @@ <div id="view-expert-settings" class="settings"> <div class="menu"> <div class="menu-header circle"> - <button class="icon" tabindex="0" i18n-aria="back_button"></button> + <button class="icon" tabindex="0" i18n-aria="back_button" + data-svg="settings_button_back.svg"></button> <div i18n-text="expert_mode_button"></div> </div> <label class="menu-item inkdrop require-chromeos-vcd"> @@ -507,7 +513,8 @@ <div class="low-storage-dialog-buttons"> <button class="dialog-negative-button text-button pill system-secondary dark" tabindex="0"> - <div class="external-link-icon"></div> + <div class="external-link-icon" data-svg="external_link_icon.svg"> + </div> <div i18n-text="low_storage_dialog_storage_button"></div> </button> <button class="dialog-positive-button text-button pill primary dark @@ -638,13 +645,21 @@ i18n-text="cancel_review_button" tabindex="0"></button> <div class="separator"></div> <button class="icon-button dark inkdrop" id="doc-scan-menu-button" - tabindex="0" i18n-label="doc_scan_menu_button"></button> + tabindex="0" i18n-label="doc_scan_menu_button"> + <svg-wrapper name="more_horizontal.svg"></svg-wrapper> + </button> <button class="icon-button dark inkdrop" - i18n-label="add_new_page_button" tabindex="0"></button> + i18n-label="add_new_page_button" tabindex="0"> + <svg-wrapper name="document_review_add_page.svg"></svg-wrapper> + </button> <button class="icon-button dark inkdrop" - i18n-label="label_share" tabindex="0"></button> + i18n-label="label_share" tabindex="0"> + <svg-wrapper name="document_review_share.svg"></svg-wrapper> + </button> <button class="icon-button dark inkdrop" - i18n-label="fix_page_button" tabindex="0"></button> + i18n-label="fix_page_button" tabindex="0"> + <svg-wrapper name="document_review_fix_page.svg"></svg-wrapper> + </button> </div> <div class="button-group right"> <button class="text-button pill dark inkdrop secondary" @@ -670,9 +685,15 @@ <div class="buttons-container"> <div class="review-crop-rotation-button-group button-group"> <button class="icon-button dark inkdrop" - i18n-label="rotate_clockwise_button" tabindex="0"></button> + i18n-label="rotate_clockwise_button" tabindex="0"> + <svg-wrapper name="crop_document_clockwise_rotate.svg"> + </svg-wrapper> + </button> <button class="icon-button dark inkdrop" - i18n-label="rotate_counterclockwise_button" tabindex="0"></button> + i18n-label="rotate_counterclockwise_button" tabindex="0"> + <svg-wrapper name="crop_document_counterclockwise_rotate.svg"> + </svg-wrapper> + </button> </div> <div class="button-group right"> <button class="text-button pill dark inkdrop primary" @@ -686,7 +707,9 @@ i18n-aria="select_page_button"> <div class="delete-container"> <button class="delete icon-button dark inkdrop" - i18n-label="delete_page_button" tabindex="0"></button> + i18n-label="delete_page_button" tabindex="0"> + <svg-wrapper name="document_review_delete_page.svg"></svg-wrapper> + </button> </div> <div class="thumbnail-container"> <img class="thumbnail" alt=""> @@ -703,7 +726,7 @@ </template> <template id="doc-scan-menu-item-content"> <div class="menu-item-content"> - <img alt="" class="menu-item-icon"> + <svg-wrapper class="menu-item-icon"></svg-wrapper> <div class="menu-item-label"></div> </div> </template>
diff --git a/ash/webui/media_app_ui/media_app_guest_ui.cc b/ash/webui/media_app_ui/media_app_guest_ui.cc index 2067981..167ebb8 100644 --- a/ash/webui/media_app_ui/media_app_guest_ui.cc +++ b/ash/webui/media_app_ui/media_app_guest_ui.cc
@@ -159,10 +159,10 @@ // Required to successfully load PDFs in the `<embed>` element. source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::FrameSrc, "frame-src blob:;"); - // Allow wasm. + // Allow wasm and mojo. source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::ScriptSrc, - "script-src 'self' 'wasm-eval';"); + "script-src 'self' 'wasm-eval' chrome-untrusted://resources;"); // Allow calls to Maps reverse geocoding API for loading metadata. source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::ConnectSrc, @@ -255,8 +255,16 @@ } } +void MediaAppGuestUI::BindInterface( + mojo::PendingReceiver<color_change_listener::mojom::PageHandler> receiver) { + color_provider_handler_ = std::make_unique<ui::ColorChangeHandler>( + web_ui()->GetWebContents(), std::move(receiver)); +} + MediaAppUserActions GetMediaAppUserActionsForHappinessTracking() { return MediaAppMetricsHelper::actions; } +WEB_UI_CONTROLLER_TYPE_IMPL(MediaAppGuestUI) + } // namespace ash
diff --git a/ash/webui/media_app_ui/media_app_guest_ui.h b/ash/webui/media_app_ui/media_app_guest_ui.h index 70a68cb..151694d 100644 --- a/ash/webui/media_app_ui/media_app_guest_ui.h +++ b/ash/webui/media_app_ui/media_app_guest_ui.h
@@ -11,8 +11,14 @@ #include "base/task/sequenced_task_runner.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_ui_data_source.h" +#include "ui/webui/color_change_listener/color_change_handler.h" +#include "ui/webui/resources/cr_components/color_change_listener/color_change_listener.mojom.h" #include "ui/webui/untrusted_web_ui_controller.h" +namespace ui { +class ColorChangeHandler; +} + namespace ash { // A delegate used during data source creation to expose some //chrome @@ -36,7 +42,16 @@ // content::WebContentsObserver: void ReadyToCommitNavigation(content::NavigationHandle* handle) override; + // Binds a PageHandler to MediaAppGuestUI. This handler grabs a reference to + // the page and pushes a colorChangeEvent to the untrusted JS running there + // when the OS color scheme has changed. + void BindInterface( + mojo::PendingReceiver<color_change_listener::mojom::PageHandler> + receiver); + private: + WEB_UI_CONTROLLER_TYPE_DECL(); + void StartFontDataRequest( const std::string& path, content::WebUIDataSource::GotDataCallback got_data_callback); @@ -51,6 +66,8 @@ // Whether ReadyToCommitNavigation has occurred for the main `app.html`. bool app_navigation_committed_ = false; + std::unique_ptr<ui::ColorChangeHandler> color_provider_handler_; + base::WeakPtrFactory<MediaAppGuestUI> weak_factory_{this}; };
diff --git a/ash/webui/media_app_ui/resources/js/BUILD.gn b/ash/webui/media_app_ui/resources/js/BUILD.gn index 1ded3ff7..e754549 100644 --- a/ash/webui/media_app_ui/resources/js/BUILD.gn +++ b/ash/webui/media_app_ui/resources/js/BUILD.gn
@@ -62,6 +62,7 @@ js_module_in_files = [ "receiver.js" ] input = rebase_path(stage_folder, root_build_dir) deps = [ + "//ui/webui/resources/cr_components/color_change_listener:build_ts", ":stage_generated", ":stage_static", ]
diff --git a/ash/webui/media_app_ui/resources/js/receiver.js b/ash/webui/media_app_ui/resources/js/receiver.js index 31239eb5..f08182df 100644 --- a/ash/webui/media_app_ui/resources/js/receiver.js +++ b/ash/webui/media_app_ui/resources/js/receiver.js
@@ -4,6 +4,8 @@ import './sandboxed_load_time_data.js'; +import {addColorChangeListener, removeColorChangeListener, startColorChangeUpdater} from '//resources/cr_components/color_change_listener/colors_css_updater.js'; + import {assertCast, MessagePipe} from './message_pipe.js'; import {EditInPhotosMessage, FileContext, IsFileArcWritableMessage, IsFileArcWritableResponse, IsFileBrowserWritableMessage, IsFileBrowserWritableResponse, LoadFilesMessage, Message, OpenAllowedFileMessage, OpenAllowedFileResponse, OpenFilesWithPickerMessage, OverwriteFileMessage, OverwriteViaFilePickerResponse, RenameFileResponse, RenameResult, RequestSaveFileMessage, RequestSaveFileResponse, SaveAsMessage, SaveAsResponse} from './message_types.js'; import {loadPiex} from './piex_module_loader.js'; @@ -436,6 +438,10 @@ } window.addEventListener('DOMContentLoaded', () => { + // Start listening to color change events. These events get picked up by logic + // in ts_helpers.ts on the google3 side. + startColorChangeUpdater(); + const app = getApp(); if (app) { initializeApp(app); @@ -463,6 +469,11 @@ window['showSaveFilePicker'] = null; window['showDirectoryPicker'] = null; +// Expose functions to bind to color change events to window so they can be +// automatically picked up by installColors(). See ts_helpers.ts in google3. +window['addColorChangeListener'] = addColorChangeListener; +window['removeColorChangeListener'] = removeColorChangeListener; + export const TEST_ONLY = { RenameResult, DELEGATE,
diff --git a/base/check.cc b/base/check.cc index f21136f9..a94df2f2 100644 --- a/base/check.cc +++ b/base/check.cc
@@ -52,6 +52,15 @@ DumpWithoutCrashing(log_message, location); } +void DumpWillBeCheckDumpWithoutCrashing(LogMessage* log_message, + const base::Location& location) { +#if !BUILDFLAG(IS_NACL) + SCOPED_CRASH_KEY_STRING1024("Logging", "DUMP_WILL_BE_CHECK_MESSAGE", + log_message->BuildCrashString()); +#endif // !BUILDFLAG(IS_NACL) + DumpWithoutCrashing(log_message, location); +} + class NotReachedLogMessage : public LogMessage { public: NotReachedLogMessage(const base::Location& location, LogSeverity severity) @@ -83,6 +92,23 @@ const base::Location location_; }; +class DumpWillBeCheckLogMessage : public LogMessage { + public: + using LogMessage::LogMessage; + DumpWillBeCheckLogMessage(const base::Location& location, + LogSeverity severity) + : LogMessage(location.file_name(), location.line_number(), severity), + location_(location) {} + ~DumpWillBeCheckLogMessage() override { + if (severity() != logging::LOGGING_FATAL) { + DumpWillBeCheckDumpWithoutCrashing(this, location_); + } + } + + private: + const base::Location location_; +}; + #if BUILDFLAG(IS_WIN) class DCheckWin32ErrorLogMessage : public Win32ErrorLogMessage { public: @@ -142,6 +168,14 @@ return CheckError(log_message); } +CheckError CheckError::DumpWillBeCheck(const char* condition, + const base::Location& location) { + auto* const log_message = new DumpWillBeCheckLogMessage( + location, DCHECK_IS_ON() ? LOGGING_DCHECK : LOGGING_ERROR); + log_message->stream() << "Check failed: " << condition << ". "; + return CheckError(log_message); +} + CheckError CheckError::PCheck(const char* file, int line, const char* condition) {
diff --git a/base/check.h b/base/check.h index c8aece5..b988149 100644 --- a/base/check.h +++ b/base/check.h
@@ -72,6 +72,10 @@ const char* condition, const base::Location& location = base::Location::Current()); + static CheckError DumpWillBeCheck( + const char* condition, + const base::Location& location = base::Location::Current()); + static CheckError PCheck(const char* file, int line, const char* condition); static CheckError PCheck(const char* file, int line); @@ -198,7 +202,33 @@ #define DCHECK(condition) EAT_CHECK_STREAM_PARAMS(!(condition)) #define DPCHECK(condition) EAT_CHECK_STREAM_PARAMS(!(condition)) -#endif +#endif // DCHECK_IS_ON() + +// The DUMP_WILL_BE_CHECK() macro provides a convenient way to non-fatally dump +// in official builds if a condition is false. This is used to more cautiously +// roll out a new CHECK() (or upgrade a DCHECK) where the caller isn't entirely +// sure that something holds true in practice (but asserts that it should). This +// is especially useful for platforms that have a low pre-stable population and +// code areas that are rarely exercised. +// +// On DCHECK builds this macro matches DCHECK behavior. +// +// This macro isn't optimized (preserves filename, line number and log messages +// in official builds), as they are expected to be in product temporarily. When +// using this macro, leave a TODO(crbug.com/nnnn) entry referring to a bug +// related to its rollout. Then put a NextAction on the bug to come back and +// clean this up (replace with a CHECK). A DUMP_WILL_BE_CHECK() that's been left +// untouched for a long time without bug updates suggests that issues that +// would've prevented enabling this CHECK have either not been discovered or +// have been resolved. +// +// Using this macro is preferred over direct base::debug::DumpWithoutCrashing() +// invocations as it communicates intent to eventually end up as a CHECK. It +// also preserves the log message so setting crash keys to get additional debug +// info isn't required as often. +#define DUMP_WILL_BE_CHECK(condition) \ + CHECK_FUNCTION_IMPL(::logging::CheckError::DumpWillBeCheck(#condition), \ + condition) // Async signal safe checking mechanism. [[noreturn]] BASE_EXPORT void RawCheckFailure(const char* message);
diff --git a/base/check_unittest.cc b/base/check_unittest.cc index 2f328f2f..47c0cc51 100644 --- a/base/check_unittest.cc +++ b/base/check_unittest.cc
@@ -496,6 +496,21 @@ CHECK_WILL_STREAM() ? "NOTREACHED hit. " : ""); } +TEST(CheckDeathTest, DumpWillBeCheck) { + DUMP_WILL_BE_CHECK(true); + + // TODO(pbos): Update this to expect a crash dump outside DCHECK builds. + if constexpr (DCHECK_IS_ON()) { + EXPECT_DCHECK("Check failed: false. foo", DUMP_WILL_BE_CHECK(false) + << "foo"); + } else { + EXPECT_LOG_ERROR_WITH_FILENAME(base::Location::Current().file_name(), + base::Location::Current().line_number(), + DUMP_WILL_BE_CHECK(false) << "foo", + "Check failed: false. foo\n"); + } +} + TEST(CheckTest, NotImplemented) { static const std::string expected_msg = std::string("Not implemented reached in ") + __PRETTY_FUNCTION__;
diff --git a/base/observer_list.h b/base/observer_list.h index ce5e0581..450ec23 100644 --- a/base/observer_list.h +++ b/base/observer_list.h
@@ -134,15 +134,9 @@ ? std::numeric_limits<size_t>::max() : list->observers_.size()) { DCHECK(list); - if (!allow_reentrancy) { - // TODO(crbug.com/1423093): Turn DCHECK + DumpWithoutCrashing() below - // into a CHECK once very prevalent failures are weeded out. - DCHECK(list_.IsOnlyRemainingNode()); - if (!DCHECK_IS_ON() && !list_.IsOnlyRemainingNode()) { - base::debug::DumpWithoutCrashing(); - } - } - DCHECK(allow_reentrancy || list_.IsOnlyRemainingNode()); + // TODO(crbug.com/1423093): Turn into CHECK once very prevalent failures + // are weeded out. + DUMP_WILL_BE_CHECK(allow_reentrancy || list_.IsOnlyRemainingNode()); // Bind to this sequence when creating the first iterator. DCHECK_CALLED_ON_VALID_SEQUENCE(list_->iteration_sequence_checker_); EnsureValidIndex(); @@ -270,12 +264,11 @@ live_iterators_.head()->value()->Invalidate(); if (check_empty) { Compact(); - // TODO(crbug.com/1423093): Turn DCHECK + DumpWithoutCrashing() below into - // a CHECK once very prevalent failures are weeded out. - DCHECK(observers_.empty()) << "\n" << GetObserversCreationStackString(); - if (!DCHECK_IS_ON() && !observers_.empty()) { - base::debug::DumpWithoutCrashing(); - } + // TODO(crbug.com/1423093): Turn into a CHECK once very prevalent failures + // are weeded out. + DUMP_WILL_BE_CHECK(observers_.empty()) + << "\n" + << GetObserversCreationStackString(); } }
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index 5644df1..3eaaa26 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -4162,10 +4162,6 @@ # new SDK classes, so providing our normal SDK will allow these # classes to resolve. For an example, see crbug.com/1350963. extra_classpath_jars = [ android_sdk_jar ] - - # Mockito bug with JDK17 requires us to use JDK11 until we find a fix - # for crbug.com/1409661. - use_jdk_11 = true } } }
diff --git a/cc/paint/image_transfer_cache_entry.cc b/cc/paint/image_transfer_cache_entry.cc index 82f61a1..4b2730c 100644 --- a/cc/paint/image_transfer_cache_entry.cc +++ b/cc/paint/image_transfer_cache_entry.cc
@@ -25,6 +25,7 @@ #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/GrYUVABackendTextures.h" #include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h" +#include "third_party/skia/include/gpu/graphite/Recorder.h" #include "ui/gfx/color_conversion_sk_filter_cache.h" #include "ui/gfx/hdr_metadata.h" @@ -67,7 +68,8 @@ // returned. On failure, nullptr is returned (e.g., if one of the backend // textures is invalid or a Skia error occurs). sk_sp<SkImage> MakeYUVImageFromUploadedPlanes( - GrDirectContext* context, + GrDirectContext* gr_context, + skgpu::graphite::Recorder* graphite_recorder, const std::vector<sk_sp<SkImage>>& plane_images, const SkYUVAInfo& yuva_info, sk_sp<SkColorSpace> image_color_space) { @@ -78,6 +80,12 @@ plane_images.size()); DCHECK_LE(plane_images.size(), base::checked_cast<size_t>(SkYUVAInfo::kMaxPlanes)); + + // TODO(crbug.com/1443065): Implement YUV image support. + if (graphite_recorder) { + return plane_images[0]; + } + std::array<GrBackendTexture, SkYUVAInfo::kMaxPlanes> plane_backend_textures; for (size_t plane = 0u; plane < plane_images.size(); plane++) { if (!SkImages::GetBackendTextureFromImage( @@ -93,7 +101,7 @@ yuva_info, plane_backend_textures.data(), kTopLeft_GrSurfaceOrigin); Context* ctx = new Context{plane_images}; sk_sp<SkImage> image = SkImages::TextureFromYUVATextures( - context, yuva_backend_textures, std::move(image_color_space), + gr_context, yuva_backend_textures, std::move(image_color_space), ReleaseContext, ctx); if (!image) { DLOG(ERROR) << "Could not create YUV image"; @@ -358,12 +366,21 @@ sk_sp<SkImage> ReadImage( PaintOpReader& reader, - GrDirectContext* context, - GrMipMapped mip_mapped_for_upload, + GrDirectContext* gr_context, + skgpu::graphite::Recorder* graphite_recorder, + bool mip_mapped_for_upload, absl::optional<SkYUVAInfo>* out_yuva_info = nullptr, std::vector<sk_sp<SkImage>>* out_yuva_plane_images = nullptr) { - // Allow a nullptr context for testing using the software renderer. - const int32_t max_size = context ? context->maxTextureSize() : 0; + int max_size; + if (gr_context) { + max_size = gr_context->maxTextureSize(); + } else if (graphite_recorder) { + // TODO(b/279234024): Retrieve correct max texture size for graphite. + max_size = 8192; + } else { + // Allow a nullptr context for testing using the software renderer. + max_size = 0; + } sk_sp<SkColorSpace> color_space; reader.Read(&color_space); @@ -424,8 +441,19 @@ // Upload to the GPU if the image will fit. if (fits_on_gpu) { - image = SkImages::TextureFromImage(context, image, mip_mapped_for_upload, - skgpu::Budgeted::kNo); + if (gr_context) { + image = SkImages::TextureFromImage( + gr_context, image, + mip_mapped_for_upload ? GrMipMapped::kYes : GrMipMapped::kNo, + skgpu::Budgeted::kNo); + } else { + CHECK(graphite_recorder); + SkImage::RequiredImageProperties props{ + .fMipmapped = mip_mapped_for_upload ? skgpu::Mipmapped::kYes + : skgpu::Mipmapped::kNo}; + image = image->makeTextureImage(graphite_recorder, props); + } + if (!image) { DLOG(ERROR) << "Failed to upload pixmap to texture image."; return nullptr; @@ -455,23 +483,35 @@ DLOG(ERROR) << "Failed to create image from plane pixmap"; return nullptr; } - plane = SkImages::TextureFromImage(context, plane, mip_mapped_for_upload, - skgpu::Budgeted::kNo); + if (gr_context) { + plane = SkImages::TextureFromImage( + gr_context, plane, + mip_mapped_for_upload ? GrMipMapped::kYes : GrMipMapped::kNo, + skgpu::Budgeted::kNo); + // Flush the pending upload (no-op if image is null). + SkImages::GetBackendTextureFromImage(plane, /*outTexture=*/nullptr, + /*flushPendingGrContextIO=*/true); + } else { + CHECK(graphite_recorder); + SkImage::RequiredImageProperties props{ + .fMipmapped = mip_mapped_for_upload ? skgpu::Mipmapped::kYes + : skgpu::Mipmapped::kNo}; + plane = plane->makeTextureImage(graphite_recorder, props); + // TODO(crbug.com/1434141): Should we flush the graphite recorder here? + } if (!plane) { DLOG(ERROR) << "Failed to upload plane pixmap to texture image"; return nullptr; } - DCHECK(plane->isTextureBacked()); - SkImages::GetBackendTextureFromImage(plane, nullptr, - /*flushPendingGrContextIO=*/true); + CHECK(plane->isTextureBacked()); plane_images.push_back(std::move(plane)); } SkYUVAInfo yuva_info(plane_images[0]->dimensions(), plane_config, subsampling, yuv_color_space); // Build the YUV image from its planes. - auto image = MakeYUVImageFromUploadedPlanes(context, plane_images, - yuva_info, color_space); + auto image = MakeYUVImageFromUploadedPlanes( + gr_context, graphite_recorder, plane_images, yuva_info, color_space); if (!image) { DLOG(ERROR) << "Failed to make YUV image from planes."; return nullptr; @@ -630,14 +670,16 @@ ServiceImageTransferCacheEntry&& other) = default; bool ServiceImageTransferCacheEntry::BuildFromHardwareDecodedImage( - GrDirectContext* context, + GrDirectContext* gr_context, std::vector<sk_sp<SkImage>> plane_images, SkYUVAInfo::PlaneConfig plane_config, SkYUVAInfo::Subsampling subsampling, SkYUVColorSpace yuv_color_space, size_t buffer_byte_size, bool needs_mips) { - context_ = context; + // Only supported on Ganesh for now since this code path is only used on CrOS. + CHECK(gr_context); + gr_context_ = gr_context; size_ = buffer_byte_size; // 1) Generate mipmap chains if requested. @@ -646,7 +688,7 @@ base::CheckedNumeric<size_t> safe_total_size(0u); for (size_t plane = 0; plane < plane_images.size(); plane++) { plane_images[plane] = - SkImages::TextureFromImage(context_, plane_images[plane], + SkImages::TextureFromImage(gr_context_, plane_images[plane], GrMipMapped::kYes, skgpu::Budgeted::kNo); if (!plane_images[plane]) { DLOG(ERROR) << "Could not generate mipmap chain for plane " << plane; @@ -674,9 +716,11 @@ // TODO(andrescj): support embedded color profiles for hardware decodes and // pass the color space to MakeYUVImageFromUploadedPlanes. image_ = MakeYUVImageFromUploadedPlanes( - context_, plane_images_, yuva_info_.value(), SkColorSpace::MakeSRGB()); - if (!image_) + gr_context_, /*graphite_recorder=*/nullptr, plane_images_, + yuva_info_.value(), SkColorSpace::MakeSRGB()); + if (!image_) { return false; + } DCHECK(image_->isTextureBacked()); return true; } @@ -686,9 +730,11 @@ } bool ServiceImageTransferCacheEntry::Deserialize( - GrDirectContext* context, + GrDirectContext* gr_context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) { - context_ = context; + gr_context_ = gr_context; + graphite_recorder_ = graphite_recorder; // We don't need to populate the DeSerializeOptions here since the reader is // only used for de-serializing primitives. @@ -704,12 +750,11 @@ reader.Read(&needs_mips); absl::optional<TargetColorParams> target_color_params; ReadTargetColorParams(reader, target_color_params); - const GrMipMapped mip_mapped_for_upload = - needs_mips && !target_color_params ? GrMipMapped::kYes : GrMipMapped::kNo; + const bool mip_mapped_for_upload = needs_mips && !target_color_params; // Deserialize the image. - image_ = ReadImage(reader, context, mip_mapped_for_upload, &yuva_info_, - &plane_images_); + image_ = ReadImage(reader, gr_context, graphite_recorder, + mip_mapped_for_upload, &yuva_info_, &plane_images_); if (!image_) { DLOG(ERROR) << "Failed to deserialize image."; return false; @@ -733,7 +778,8 @@ DLOG(ERROR) << "Gainmap images need target parameters to render."; return false; } - gainmap_image = ReadImage(reader, context, mip_mapped_for_upload); + gainmap_image = + ReadImage(reader, gr_context, graphite_recorder, mip_mapped_for_upload); if (!gainmap_image) { DLOG(ERROR) << "Failed to deserialize gainmap image."; return false; @@ -751,19 +797,26 @@ // TODO(https://crbug.com/1286088): Pass a shared cache as a parameter. gfx::ColorConversionSkFilterCache cache; - if (has_gainmap) { - image_ = - cache.ApplyGainmap(image_, gainmap_image, gainmap_info, - target_color_params->hdr_max_luminance_relative, - image_->isTextureBacked() ? context_ : nullptr); + if (graphite_recorder_) { + // TODO(crbug.com/1443068): Add color conversion support for graphite. + NOTIMPLEMENTED_LOG_ONCE(); } else { - image_ = cache.ConvertImage( - image_, target_color_space, target_color_params->hdr_metadata, - target_color_params->sdr_max_luminance_nits, - target_color_params->hdr_max_luminance_relative, - target_color_params->enable_tone_mapping, - image_->isTextureBacked() ? context_ : nullptr); + // Allow a nullptr context for testing using the software renderer. + if (has_gainmap) { + image_ = cache.ApplyGainmap( + image_, gainmap_image, gainmap_info, + target_color_params->hdr_max_luminance_relative, + image_->isTextureBacked() ? gr_context_ : nullptr); + } else { + image_ = cache.ConvertImage( + image_, target_color_space, target_color_params->hdr_metadata, + target_color_params->sdr_max_luminance_nits, + target_color_params->hdr_max_luminance_relative, + target_color_params->enable_tone_mapping, + image_->isTextureBacked() ? gr_context_ : nullptr); + } } + if (!image_) { DLOG(ERROR) << "Failed image color conversion"; return false; @@ -776,8 +829,15 @@ // If mipmaps were requested, create them after color conversion. if (needs_mips && image_->isTextureBacked()) { - image_ = SkImages::TextureFromImage(context, image_, GrMipMapped::kYes, - skgpu::Budgeted::kNo); + if (gr_context) { + image_ = SkImages::TextureFromImage( + gr_context, image_, GrMipMapped::kYes, skgpu::Budgeted::kNo); + } else { + CHECK(graphite_recorder); + SkImage::RequiredImageProperties props{.fMipmapped = + skgpu::Mipmapped::kYes}; + image_ = image_->makeTextureImage(graphite_recorder, props); + } if (!image_) { DLOG(ERROR) << "Failed to generate mipmaps after color conversion"; return false; @@ -833,17 +893,27 @@ std::vector<sk_sp<SkImage>> mipped_planes; std::vector<size_t> mipped_plane_sizes; for (size_t plane = 0; plane < plane_images_.size(); plane++) { - DCHECK(plane_images_.at(plane)); - sk_sp<SkImage> mipped_plane = - SkImages::TextureFromImage(context_, plane_images_.at(plane), - GrMipMapped::kYes, skgpu::Budgeted::kNo); - if (!mipped_plane) + CHECK(plane_images_.at(plane)); + sk_sp<SkImage> mipped_plane; + if (gr_context_) { + mipped_plane = + SkImages::TextureFromImage(gr_context_, plane_images_.at(plane), + GrMipMapped::kYes, skgpu::Budgeted::kNo); + } else { + CHECK(graphite_recorder_); + SkImage::RequiredImageProperties props{.fMipmapped = + skgpu::Mipmapped::kYes}; + mipped_plane = plane_images_.at(plane)->makeTextureImage( + graphite_recorder_, props); + } + if (!mipped_plane) { return; + } mipped_planes.push_back(std::move(mipped_plane)); mipped_plane_sizes.push_back(mipped_planes.back()->textureSize()); } sk_sp<SkImage> mipped_image = MakeYUVImageFromUploadedPlanes( - context_, mipped_planes, yuva_info_.value(), + gr_context_, graphite_recorder_, mipped_planes, yuva_info_.value(), image_->refColorSpace() /* image_color_space */); if (!mipped_image) { DLOG(ERROR) << "Failed to create YUV image from mipmapped planes"; @@ -856,8 +926,16 @@ plane_sizes_ = std::move(mipped_plane_sizes); image_ = std::move(mipped_image); } else { - sk_sp<SkImage> mipped_image = SkImages::TextureFromImage( - context_, image_, GrMipMapped::kYes, skgpu::Budgeted::kNo); + sk_sp<SkImage> mipped_image; + if (gr_context_) { + mipped_image = SkImages::TextureFromImage( + gr_context_, image_, GrMipMapped::kYes, skgpu::Budgeted::kNo); + } else { + CHECK(graphite_recorder_); + SkImage::RequiredImageProperties props{.fMipmapped = + skgpu::Mipmapped::kYes}; + mipped_image = image_->makeTextureImage(graphite_recorder_, props); + } if (!mipped_image) { DLOG(ERROR) << "Failed to mipmapped image"; return;
diff --git a/cc/paint/image_transfer_cache_entry.h b/cc/paint/image_transfer_cache_entry.h index fe856452..1ec1cc6 100644 --- a/cc/paint/image_transfer_cache_entry.h +++ b/cc/paint/image_transfer_cache_entry.h
@@ -142,7 +142,7 @@ // - The colorspace of the resulting RGB image is sRGB. // // Returns true if the entry can be built, false otherwise. - bool BuildFromHardwareDecodedImage(GrDirectContext* context, + bool BuildFromHardwareDecodedImage(GrDirectContext* gr_context, std::vector<sk_sp<SkImage>> plane_images, SkYUVAInfo::PlaneConfig plane_config, SkYUVAInfo::Subsampling subsampling, @@ -152,7 +152,8 @@ // ServiceTransferCacheEntry implementation: size_t CachedSize() const final; - bool Deserialize(GrDirectContext* context, + bool Deserialize(GrDirectContext* gr_context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) final; const sk_sp<SkImage>& image() const { return image_; } @@ -174,7 +175,8 @@ bool fits_on_gpu() const; private: - raw_ptr<GrDirectContext> context_ = nullptr; + raw_ptr<GrDirectContext> gr_context_ = nullptr; + raw_ptr<skgpu::graphite::Recorder> graphite_recorder_ = nullptr; sk_sp<SkImage> image_; // The value of `size_` is computed during deserialization and never updated
diff --git a/cc/paint/image_transfer_cache_entry_unittest.cc b/cc/paint/image_transfer_cache_entry_unittest.cc index cc2c096..d14bb81e 100644 --- a/cc/paint/image_transfer_cache_entry_unittest.cc +++ b/cc/paint/image_transfer_cache_entry_unittest.cc
@@ -85,6 +85,7 @@ image, expected_color, SkIRect::MakeWH(image->width(), image->height())); } +// TODO(crbug.com/1442381): Implement test with Skia Graphite backend. class ImageTransferCacheEntryTest : public testing::TestWithParam<SkYUVAInfo::PlaneConfig> { public: @@ -250,7 +251,8 @@ // Create service-side entry from the client-side serialize info auto entry(std::make_unique<ServiceImageTransferCacheEntry>()); ASSERT_TRUE(entry->Deserialize( - gr_context(), base::make_span(static_cast<uint8_t*>(data.get()), size))); + gr_context(), /*graphite_recorder=*/nullptr, + base::make_span(static_cast<uint8_t*>(data.get()), size))); ASSERT_TRUE(entry->is_yuv()); // Check color of pixels @@ -401,6 +403,7 @@ ServiceImageTransferCacheEntry service_entry; service_entry.Deserialize(gr_context.get(), + /*graphite_recorder=*/nullptr, base::make_span(storage.get(), storage_size)); ASSERT_TRUE(service_entry.image()); auto pre_mip_image = service_entry.image(); @@ -430,6 +433,7 @@ ServiceImageTransferCacheEntry service_entry; service_entry.Deserialize(gr_context.get(), + /*graphite_recorder=*/nullptr, base::make_span(storage.get(), storage_size)); ASSERT_TRUE(service_entry.image()); auto pre_mip_image = service_entry.image(); @@ -526,6 +530,7 @@ ServiceImageTransferCacheEntry service_entry; service_entry.Deserialize(gr_context, + /*graphite_recorder=*/nullptr, base::make_span(storage.data(), storage.size())); ASSERT_TRUE(service_entry.image()); auto image = service_entry.image();
diff --git a/cc/paint/raw_memory_transfer_cache_entry.cc b/cc/paint/raw_memory_transfer_cache_entry.cc index 4c677f20..e8b41027 100644 --- a/cc/paint/raw_memory_transfer_cache_entry.cc +++ b/cc/paint/raw_memory_transfer_cache_entry.cc
@@ -51,6 +51,7 @@ bool ServiceRawMemoryTransferCacheEntry::Deserialize( GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) { data_ = std::vector<uint8_t>(data.begin(), data.end()); return true;
diff --git a/cc/paint/raw_memory_transfer_cache_entry.h b/cc/paint/raw_memory_transfer_cache_entry.h index 1a11444ba..81c75904 100644 --- a/cc/paint/raw_memory_transfer_cache_entry.h +++ b/cc/paint/raw_memory_transfer_cache_entry.h
@@ -37,6 +37,7 @@ ~ServiceRawMemoryTransferCacheEntry() final; size_t CachedSize() const final; bool Deserialize(GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) final; const std::vector<uint8_t>& data() { return data_; }
diff --git a/cc/paint/shader_transfer_cache_entry.cc b/cc/paint/shader_transfer_cache_entry.cc index 7d9b34e..db3a480 100644 --- a/cc/paint/shader_transfer_cache_entry.cc +++ b/cc/paint/shader_transfer_cache_entry.cc
@@ -24,6 +24,7 @@ bool ServiceShaderTransferCacheEntry::Deserialize( GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) { // These entries must be created directly via CreateLocalEntry. NOTREACHED();
diff --git a/cc/paint/shader_transfer_cache_entry.h b/cc/paint/shader_transfer_cache_entry.h index 5bc680a..4efaa23 100644 --- a/cc/paint/shader_transfer_cache_entry.h +++ b/cc/paint/shader_transfer_cache_entry.h
@@ -30,6 +30,7 @@ ~ServiceShaderTransferCacheEntry() final; size_t CachedSize() const final; bool Deserialize(GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) final; sk_sp<PaintShader> shader() const { return shader_; }
diff --git a/cc/paint/skottie_transfer_cache_entry.cc b/cc/paint/skottie_transfer_cache_entry.cc index 3cbf5a0..ee11ec1 100644 --- a/cc/paint/skottie_transfer_cache_entry.cc +++ b/cc/paint/skottie_transfer_cache_entry.cc
@@ -40,6 +40,7 @@ bool ServiceSkottieTransferCacheEntry::Deserialize( GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) { skottie_ = SkottieWrapper::CreateNonSerializable(data); cached_size_ = data.size();
diff --git a/cc/paint/skottie_transfer_cache_entry.h b/cc/paint/skottie_transfer_cache_entry.h index 8b45600b..42816e5 100644 --- a/cc/paint/skottie_transfer_cache_entry.h +++ b/cc/paint/skottie_transfer_cache_entry.h
@@ -41,6 +41,7 @@ // ServiceTransferCacheEntry implementation: size_t CachedSize() const final; bool Deserialize(GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) final; const scoped_refptr<SkottieWrapper>& skottie() const { return skottie_; }
diff --git a/cc/paint/skottie_transfer_cache_entry_unittest.cc b/cc/paint/skottie_transfer_cache_entry_unittest.cc index a3be9ee..03b25cd 100644 --- a/cc/paint/skottie_transfer_cache_entry_unittest.cc +++ b/cc/paint/skottie_transfer_cache_entry_unittest.cc
@@ -36,7 +36,8 @@ // De-serialize auto entry(std::make_unique<ServiceSkottieTransferCacheEntry>()); ASSERT_TRUE(entry->Deserialize( - nullptr, base::make_span(static_cast<uint8_t*>(data.data()), size))); + /*gr_context=*/nullptr, /*graphite_recorder=*/nullptr, + base::make_span(static_cast<uint8_t*>(data.data()), size))); EXPECT_EQ(entry->skottie()->id(), skottie->id()); EXPECT_EQ(entry->skottie()->duration(), skottie->duration());
diff --git a/cc/paint/transfer_cache_entry.cc b/cc/paint/transfer_cache_entry.cc index e2e6503..8e1e92c6 100644 --- a/cc/paint/transfer_cache_entry.cc +++ b/cc/paint/transfer_cache_entry.cc
@@ -43,7 +43,7 @@ } // static -bool ServiceTransferCacheEntry::UsesGrContext(TransferCacheEntryType type) { +bool ServiceTransferCacheEntry::UsesGpuContext(TransferCacheEntryType type) { switch (type) { case TransferCacheEntryType::kRawMemory: case TransferCacheEntryType::kShader:
diff --git a/cc/paint/transfer_cache_entry.h b/cc/paint/transfer_cache_entry.h index 7b0f4f7..150e234 100644 --- a/cc/paint/transfer_cache_entry.h +++ b/cc/paint/transfer_cache_entry.h
@@ -12,6 +12,10 @@ class GrDirectContext; +namespace skgpu::graphite { +class Recorder; +} // namespace skgpu::graphite + namespace cc { // To add a new transfer cache entry type: @@ -70,8 +74,8 @@ static bool SafeConvertToType(uint32_t raw_type, TransferCacheEntryType* type); - // Returns true if the entry needs a GrContext during deserialization. - static bool UsesGrContext(TransferCacheEntryType type); + // Returns true if the entry needs a Skia GPU context during deserialization. + static bool UsesGpuContext(TransferCacheEntryType type); virtual ~ServiceTransferCacheEntry() = default; @@ -84,8 +88,11 @@ virtual size_t CachedSize() const = 0; // Deserialize the cache entry from the given span of memory with the given - // context. - virtual bool Deserialize(GrDirectContext* context, + // context. At most one of |gr_context| or |graphite_recorder| must be + // non-null, but it is ok to pass null for both parameters for entry types + // which do not need a GPU context - see UsesGpuContext, or for testing. + virtual bool Deserialize(GrDirectContext* gr_context, + skgpu::graphite::Recorder* graphite_recorder, base::span<const uint8_t> data) = 0; };
diff --git a/cc/paint/transfer_cache_fuzzer.cc b/cc/paint/transfer_cache_fuzzer.cc index ed0b1f0..4bbbf4a 100644 --- a/cc/paint/transfer_cache_fuzzer.cc +++ b/cc/paint/transfer_cache_fuzzer.cc
@@ -12,6 +12,7 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" +// TODO(crbug.com/1442381): Implement fuzzer with Skia Graphite backend. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Align data. ImageTransferCacheEntry requires 16-byte. const uint8_t* aligned_data = base::bits::AlignUp(data, 16); @@ -33,7 +34,8 @@ } base::span<const uint8_t> span(aligned_data, size - alignment_gap); - if (!entry->Deserialize(context_provider->GrContext(), span)) { + if (!entry->Deserialize(context_provider->GrContext(), + /*graphite_recorder=*/nullptr, span)) { return 0; }
diff --git a/cc/test/transfer_cache_test_helper.cc b/cc/test/transfer_cache_test_helper.cc index e04859f8..9bffb267 100644 --- a/cc/test/transfer_cache_test_helper.cc +++ b/cc/test/transfer_cache_test_helper.cc
@@ -33,7 +33,8 @@ if (!service_entry) return; - bool success = service_entry->Deserialize(context_, data); + bool success = + service_entry->Deserialize(context_, /*graphite_recorder=*/nullptr, data); if (!success) return;
diff --git a/chrome/VERSION b/chrome/VERSION index 22130ab..17f7949b 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=115 MINOR=0 -BUILD=5760 +BUILD=5761 PATCH=0
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni index d577a7fb..ab439a7 100644 --- a/chrome/android/chrome_java_resources.gni +++ b/chrome/android/chrome_java_resources.gni
@@ -376,6 +376,7 @@ "java/res/drawable/distilled_page_pref_background.xml", "java/res/drawable/distilled_page_prefs_button_bg.xml", "java/res/drawable/google_pay_with_divider.xml", + "java/res/drawable/history_empty_state_illustration.xml", "java/res/drawable/ic_add_box_rounded_corner.xml", "java/res/drawable/ic_add_to_home_screen.xml", "java/res/drawable/ic_arrow_forward_blue_24dp.xml",
diff --git a/chrome/android/java/res/drawable/history_empty_state_illustration.xml b/chrome/android/java/res/drawable/history_empty_state_illustration.xml new file mode 100644 index 0000000..d7c26a4 --- /dev/null +++ b/chrome/android/java/res/drawable/history_empty_state_illustration.xml
@@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2023 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="200dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="200dp"> + <path + android:fillColor="@color/empty_state_icon_bg_background_color" + android:pathData="m56.6,123h52.12c15.73,0 22.54,-19.92 10.1,-29.55l-43.05,-33.32c-9.3,-7.2 -22.93,-2.64 -26.03,8.71l-9.08,33.32c-2.86,10.5 5.04,20.84 15.92,20.84z"/> + <path + android:fillColor="@color/empty_state_icon_bg_foreground_color" + android:pathData="m160,85.58v56.07c0,4.61 -3.74,8.35 -8.35,8.35h-74.94c-10.92,0 -15.17,-14.19 -6.05,-20.19l77.16,-50.79c5.22,-3.44 12.18,0.31 12.18,6.56z"/> + <path + android:pathData="m70,100c0,16.57 13.43,30 30,30 16.57,0 30,-13.43 30,-30 0,-16.57 -13.43,-30 -30,-30 -9.4,0 -17.79,4.32 -23.29,11.09" + android:strokeColor="@color/empty_state_icon_color" + android:strokeWidth="2"/> + <path + android:pathData="m76,71v9c0,1.1 0.9,2 2,2h9" + android:strokeColor="@color/empty_state_icon_color" + android:strokeWidth="2"/> + <path + android:pathData="m100,80v20l12,12" + android:strokeColor="@color/empty_state_icon_color" + android:strokeWidth="2"/> +</vector>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenToast.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenToast.java index 4574f348..8a88d26 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenToast.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenToast.java
@@ -13,7 +13,9 @@ import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.widget.TextView; +import org.chromium.base.BuildInfo; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.tab.Tab; @@ -95,9 +97,12 @@ private void showNotificationToast() { hideNotificationToast(); - int resId = R.string.immersive_fullscreen_api_notification; + int toastTextId = R.string.immersive_fullscreen_api_notification; + if (BuildInfo.getInstance().isAutomotive) { + toastTextId = R.string.immersive_fullscreen_api_notification_automotive; + } mNotificationToast = Toast.makeTextWithPriority( - mActivity, resId, Toast.LENGTH_LONG, ToastPriority.HIGH); + mActivity, toastTextId, Toast.LENGTH_LONG, ToastPriority.HIGH); mNotificationToast.setGravity(Gravity.BOTTOM | Gravity.CENTER, 0, 0); mNotificationToast.show(); } @@ -259,6 +264,13 @@ R.layout.fullscreen_notification, null); addView = true; } + if (BuildInfo.getInstance().isAutomotive) { + TextView toastTextView = mNotificationToast.findViewById(R.id.text); + if (toastTextView != null) { + toastTextView.setText( + R.string.immersive_fullscreen_api_notification_automotive); + } + } mNotificationToast.setAlpha(0); mToastFadeAnimation = mNotificationToast.animate(); if (addView) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java index ed24aab..2fb16d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
@@ -347,7 +347,14 @@ mSelectableListLayout.configureWideDisplayStyle(); // 5. Initialize empty view. - mEmptyView = mSelectableListLayout.initializeEmptyView(R.string.history_manager_empty); + if (ChromeFeatureList.isEnabled(ChromeFeatureList.EMPTY_STATES)) { + mEmptyView = mSelectableListLayout.initializeEmptyStateView( + R.drawable.history_empty_state_illustration, + R.string.history_manager_empty_state, + R.string.history_manager_empty_state_view_or_clear_page_visited); + } else { + mEmptyView = mSelectableListLayout.initializeEmptyView(R.string.history_manager_empty); + } // 6. Load items. mContentManager.startLoadingItems();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/history/HistoryUITest.java b/chrome/android/junit/src/org/chromium/chrome/browser/history/HistoryUITest.java index f2849ce5d..0315ab4 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/history/HistoryUITest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/history/HistoryUITest.java
@@ -95,8 +95,8 @@ * Tests the History UI. */ @RunWith(BaseRobolectricTestRunner.class) -@DisableFeatures( - {ChromeFeatureList.HISTORY_JOURNEYS, ChromeFeatureList.BACK_GESTURE_REFACTOR_ACTIVITY}) +@DisableFeatures({ChromeFeatureList.HISTORY_JOURNEYS, + ChromeFeatureList.BACK_GESTURE_REFACTOR_ACTIVITY, ChromeFeatureList.EMPTY_STATES}) public class HistoryUITest { private static final int PAGE_INCREMENT = 2; private static final String HISTORY_SEARCH_QUERY = "some page"; @@ -228,6 +228,23 @@ @Test @SmallTest + @EnableFeatures({ChromeFeatureList.EMPTY_STATES}) + public void testRemove_SingleItem_EmptyState() throws Exception { + final HistoryItemView itemView = (HistoryItemView) getItemView(2); + + itemView.getRemoveButtonForTests().performClick(); + + // Check that one item was removed. + ShadowLooper.idleMainLooper(); + Assert.assertEquals(1, mHistoryProvider.markItemForRemovalCallback.getCallCount()); + Assert.assertEquals(1, mHistoryProvider.removeItemsCallback.getCallCount()); + Assert.assertEquals(3, mAdapter.getItemCount()); + Assert.assertEquals(View.VISIBLE, mRecyclerView.getVisibility()); + Assert.assertEquals(View.GONE, mHistoryManager.getEmptyViewForTests().getVisibility()); + } + + @Test + @SmallTest public void testRemove_AllItems() throws Exception { toggleItemSelection(2); toggleItemSelection(3); @@ -246,6 +263,25 @@ @Test @SmallTest + @EnableFeatures({ChromeFeatureList.EMPTY_STATES}) + public void testRemove_AllItems_EmptyState() throws Exception { + toggleItemSelection(2); + toggleItemSelection(3); + + performMenuAction(R.id.selection_mode_delete_menu_id); + + // Check that all items were removed. The onChangedCallback should be called three times - + // once for each item that is being removed and once for the removal of the header. + Assert.assertEquals(0, mAdapter.getItemCount()); + Assert.assertEquals(2, mHistoryProvider.markItemForRemovalCallback.getCallCount()); + Assert.assertEquals(1, mHistoryProvider.removeItemsCallback.getCallCount()); + Assert.assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEnabled()); + Assert.assertEquals(View.GONE, mRecyclerView.getVisibility()); + Assert.assertEquals(View.VISIBLE, mHistoryManager.getEmptyViewForTests().getVisibility()); + } + + @Test + @SmallTest public void testPrivacyDisclaimers_SignedOut() { // The user is signed out by default. Assert.assertEquals(1, mAdapter.getFirstGroupForTests().size());
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index aa3c201..33aef75f 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3824,6 +3824,10 @@ kOsCrOS, FEATURE_VALUE_TYPE( ash::features::kAllowEapDefaultCasWithoutSubjectVerification)}, + {"alt-click-and-six-pack-customization", + flag_descriptions::kAltClickAndSixPackCustomizationName, + flag_descriptions::kAltClickAndSixPackCustomizationDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kAltClickAndSixPackCustomization)}, {"apn-revamp", flag_descriptions::kApnRevampName, flag_descriptions::kApnRevampDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kApnRevamp)}, @@ -7566,6 +7570,10 @@ {"help-app-apps-discovery", flag_descriptions::kHelpAppAppsDiscoveryName, flag_descriptions::kHelpAppAppsDiscoveryDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kHelpAppAppsDiscovery)}, + {"help-app-auto-trigger-install-dialog", + flag_descriptions::kHelpAppAutoTriggerInstallDialogName, + flag_descriptions::kHelpAppAutoTriggerInstallDialogDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kHelpAppAutoTriggerInstallDialog)}, {"help-app-launcher-search", flag_descriptions::kHelpAppLauncherSearchName, flag_descriptions::kHelpAppLauncherSearchDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kHelpAppLauncherSearch)},
diff --git a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc index 8c657292..46417a9 100644 --- a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc +++ b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service_test_base.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/test/fake_web_app_provider.h" #include "chrome/browser/web_applications/test/test_web_app_url_loader.h" @@ -302,7 +302,7 @@ url_loader_ = url_loader.get(); auto externally_managed_app_manager = - std::make_unique<web_app::ExternallyManagedAppManagerImpl>(profile()); + std::make_unique<web_app::ExternallyManagedAppManager>(profile()); externally_managed_app_manager->SetUrlLoaderForTesting( std::move(url_loader));
diff --git a/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc b/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc index 7cc03a2..64b3335 100644 --- a/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc +++ b/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc
@@ -153,8 +153,21 @@ case AppType::kArc: return IntentHandlingMetrics::Platform::ARC; case AppType::kWeb: + case AppType::kSystemWeb: return IntentHandlingMetrics::Platform::PWA; - default: + case AppType::kUnknown: + case AppType::kBuiltIn: + case AppType::kCrostini: + case AppType::kChromeApp: + case AppType::kMacOs: + case AppType::kPluginVm: + case AppType::kStandaloneBrowser: + case AppType::kRemote: + case AppType::kBorealis: + case AppType::kStandaloneBrowserChromeApp: + case AppType::kExtension: + case AppType::kStandaloneBrowserExtension: + case AppType::kBruschetta: NOTREACHED(); return IntentHandlingMetrics::Platform::ARC; }
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 3203dd4..6cac0046 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -399,6 +399,8 @@ "arc/input_overlay/ui/action_label.h", "arc/input_overlay/ui/action_view.cc", "arc/input_overlay/ui/action_view.h", + "arc/input_overlay/ui/action_view_list_item.cc", + "arc/input_overlay/ui/action_view_list_item.h", "arc/input_overlay/ui/edit_finish_view.cc", "arc/input_overlay/ui/edit_finish_view.h", "arc/input_overlay/ui/editing_list.cc", @@ -419,6 +421,8 @@ "arc/input_overlay/ui/reposition_controller.h", "arc/input_overlay/ui/touch_point.cc", "arc/input_overlay/ui/touch_point.h", + "arc/input_overlay/ui/ui_utils.cc", + "arc/input_overlay/ui/ui_utils.h", "arc/input_overlay/util.cc", "arc/input_overlay/util.h", "arc/instance_throttle/arc_active_window_throttle_observer.cc", @@ -6443,31 +6447,13 @@ } fuzzer_test("create_fnmatch_query_fuzzer") { - sources = [ - "extensions/file_manager/create_fnmatch_query_fuzzer.cc", - "extensions/file_manager/search_by_pattern.cc", - "extensions/file_manager/search_by_pattern.h", - "file_manager/path_util.h", - "fileapi/recent_arc_media_source.h", - "fileapi/recent_disk_source.h", - "fileapi/recent_drive_source.h", - "fileapi/recent_file.h", - "fileapi/recent_model.h", - "fileapi/recent_model_factory.h", - "fileapi/recent_source.h", - "guest_os/guest_id.h", - "guest_os/public/types.h", - ] + sources = [ "extensions/file_manager/create_fnmatch_query_fuzzer.cc" ] deps = [ + ":ash", "//base", - "//chrome/browser/profiles:profile", - "//chromeos/ash/components/dbus:vm_applications_apps_proto", - "//chromeos/ash/components/drivefs/mojom:mojom", - "//components/drive:drive", - "//content/public/browser", - "//storage/browser", - "//ui/file_manager/base/gn:file_types_data_cpp", - "//url", + "//chrome/browser", + "//components/exo/wayland:ui_controls_protocol", + "//components/exo/wayland:weston_test", ] }
diff --git a/chrome/browser/ash/app_list/app_list_test_util.cc b/chrome/browser/ash/app_list/app_list_test_util.cc index 0a6ab30..02e0aa9f 100644 --- a/chrome/browser/ash/app_list/app_list_test_util.cc +++ b/chrome/browser/ash/app_list/app_list_test_util.cc
@@ -7,7 +7,7 @@ #include "base/feature_list.h" #include "base/files/file_path.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/test/fake_web_app_provider.h" #include "chrome/browser/web_applications/test/test_web_app_url_loader.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" @@ -64,8 +64,7 @@ url_loader_ = url_loader.get(); auto externally_managed_app_manager = - std::make_unique<web_app::ExternallyManagedAppManagerImpl>( - testing_profile); + std::make_unique<web_app::ExternallyManagedAppManager>(testing_profile); externally_managed_app_manager->SetUrlLoaderForTesting(std::move(url_loader)); auto* const provider = web_app::FakeWebAppProvider::Get(testing_profile);
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action.h b/chrome/browser/ash/arc/input_overlay/actions/action.h index 2175e62..2c5d9c1 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action.h
@@ -87,6 +87,7 @@ // |input_element| should overlap the current displayed binding. If it is // partially overlapped, then we only unbind the overlapped input. virtual void UnbindInput(const InputElement& input_element) = 0; + virtual ActionType GetType() = 0; // This is called for editing the actions before change is saved. Or for // loading the customized data to override the default input mapping.
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc index d738211..fe9be790 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc +++ b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc
@@ -404,6 +404,10 @@ } } +ActionType ActionMove::GetType() { + return ActionType::MOVE; +} + bool ActionMove::RewriteKeyEvent(const ui::KeyEvent* key_event, const gfx::RectF& content_bounds, const gfx::Transform* rotation_transform,
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_move.h b/chrome/browser/ash/arc/input_overlay/actions/action_move.h index 44f536b..cbd9a04 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_move.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action_move.h
@@ -36,6 +36,7 @@ DisplayOverlayController* display_overlay_controller) override; void UnbindInput(const InputElement& input_element) override; std::unique_ptr<ActionProto> ConvertToProtoIfCustomized() const override; + ActionType GetType() override; void set_move_distance(int move_distance) { move_distance_ = move_distance; } int move_distance() { return move_distance_; }
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc b/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc index 970fe0ae..91efd1e 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc +++ b/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc
@@ -296,6 +296,10 @@ PostUnbindInputProcess(); } +ActionType ActionTap::GetType() { + return ActionType::TAP; +} + bool ActionTap::RewriteKeyEvent(const ui::KeyEvent* key_event, const gfx::RectF& content_bounds, const gfx::Transform* rotation_transform,
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_tap.h b/chrome/browser/ash/arc/input_overlay/actions/action_tap.h index 7659626..fd9d0aa 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_tap.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action_tap.h
@@ -31,6 +31,7 @@ DisplayOverlayController* display_overlay_controller) override; void UnbindInput(const InputElement& input_element) override; std::unique_ptr<ActionProto> ConvertToProtoIfCustomized() const override; + ActionType GetType() override; private: class ActionTapView;
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.cc b/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.cc new file mode 100644 index 0000000..e6d0ac1 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.cc
@@ -0,0 +1,82 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.h" + +#include <memory> + +#include "ash/bubble/bubble_utils.h" +#include "ash/style/rounded_container.h" +#include "ash/style/typography.h" +#include "chrome/browser/ash/arc/input_overlay/actions/action.h" +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" +#include "chrome/browser/ash/arc/input_overlay/ui/ui_utils.h" +#include "ui/chromeos/styles/cros_tokens_color_mappings.h" +#include "ui/views/background.h" +#include "ui/views/layout/table_layout.h" + +namespace arc::input_overlay { + +ActionViewListItem::ActionViewListItem(DisplayOverlayController* controller, + Action* action) + : controller_(controller), action_(action) { + Init(); +} + +void ActionViewListItem::Init() { + SetUseDefaultFillLayout(true); + auto* container = AddChildView(std::make_unique<ash::RoundedContainer>()); + container->SetBorderInsets(gfx::Insets::VH(14, 16)); + container->SetBackground( + views::CreateThemedSolidBackground(cros_tokens::kCrosSysSystemOnBase)); + container->SetLayoutManager(std::make_unique<views::TableLayout>()) + ->AddColumn(/*h_align=*/views::LayoutAlignment::kStart, + /*v_align=*/views::LayoutAlignment::kStart, + /*horizontal_resize=*/1.0f, + /*size_type=*/views::TableLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0) + .AddColumn(/*h_align=*/views::LayoutAlignment::kEnd, + /*v_align=*/views::LayoutAlignment::kCenter, + /*horizontal_resize=*/1.0f, + /*size_type=*/views::TableLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0) + .AddRows(1, /*vertical_resize=*/views::TableLayout::kFixedSize); + + switch (action_->GetType()) { + case ActionType::TAP: + SetActionTapListItem(container); + break; + case ActionType::MOVE: + SetActionMoveListItem(container); + break; + default: + NOTREACHED(); + } +} + +ActionViewListItem::~ActionViewListItem() = default; + +void ActionViewListItem::SetActionTapListItem(views::View* container) { + // Set list item as: + // -------------------------- + // | |Name tag| |a| | + // -------------------------- + // TODO(b/270969479): Replace the hardcoded string. + container->AddChildView(CreateNameTag(u"title", u"sub-title")); + container->AddChildView(std::make_unique<views::LabelButton>( + views::Button::PressedCallback(), u"a")); +} + +void ActionViewListItem::SetActionMoveListItem(views::View* container) { + // Set list item as: + // ----------------------------- + // | |Name tag| |w| | + // | |a|s|d|| + // ----------------------------- + // TODO(b/270969479): Replace the hardcoded string. + container->AddChildView(CreateNameTag(u"title", u"sub-title")); + container->AddChildView(CreateActionMoveEditForKeyboard(action_)); +} + +} // namespace arc::input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.h b/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.h new file mode 100644 index 0000000..dcdf5b28 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.h
@@ -0,0 +1,42 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_VIEW_LIST_ITEM_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_VIEW_LIST_ITEM_H_ + +#include "base/memory/raw_ptr.h" +#include "ui/views/view.h" + +namespace arc::input_overlay { + +class Action; +class DisplayOverlayController; + +// ActionViewListItem shows in EditingList and is associated with each of +// Action. +// ---------------------------- +// | |Name tag| |keys| | +// ---------------------------- + +class ActionViewListItem : public views::View { + public: + ActionViewListItem(DisplayOverlayController* controller, Action* action); + ActionViewListItem(const ActionViewListItem&) = delete; + ActionViewListItem& operator=(const ActionViewListItem&) = delete; + ~ActionViewListItem() override; + + private: + void Init(); + + // Set list item of different types. + void SetActionTapListItem(views::View* container); + void SetActionMoveListItem(views::View* container); + + raw_ptr<DisplayOverlayController> controller_; + raw_ptr<Action> action_; +}; + +} // namespace arc::input_overlay + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_VIEW_LIST_ITEM_H_
diff --git a/chrome/browser/ash/arc/input_overlay/ui/editing_list.cc b/chrome/browser/ash/arc/input_overlay/ui/editing_list.cc index 8586345..6326fde0 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/editing_list.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/editing_list.cc
@@ -14,7 +14,9 @@ #include "ash/style/typography.h" #include "base/notreached.h" #include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/ash/arc/input_overlay/actions/action.h" #include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" +#include "chrome/browser/ash/arc/input_overlay/ui/action_view_list_item.h" #include "chrome/grit/component_extension_resources.h" #include "ui/chromeos/styles/cros_tokens_color_mappings.h" #include "ui/views/background.h" @@ -29,7 +31,6 @@ namespace { constexpr int kMainContainerWidth = 296; -constexpr int kMainContainerZeroStateHeight = 320; } // namespace @@ -141,8 +142,30 @@ } void EditingList::AddControlListContent(views::View* container) { - // TODO(b/270969479): Add scrollable container here. - NOTIMPLEMENTED(); + // Add list content as: + // -------------------------- + // | ---------------------- | + // | | ActionViewListItem | | + // | ---------------------- | + // | ---------------------- | + // | | ActionViewListItem | | + // | ---------------------- | + // | ...... | + // -------------------------- + // TODO(b/270969479): Wrap |scroll_content| in a scroll view. + auto* scroll_content = + container->AddChildView(std::make_unique<views::View>()); + scroll_content + ->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical, + /*inside_border_insets=*/gfx::Insets(), + /*between_child_spacing=*/8)) + ->set_main_axis_alignment(views::BoxLayout::MainAxisAlignment::kCenter); + DCHECK(controller_); + for (const auto& action : controller_->touch_injector()->actions()) { + scroll_content->AddChildView( + std::make_unique<ActionViewListItem>(controller_, action.get())); + } } void EditingList::OnAddButtonPressed() { @@ -157,11 +180,7 @@ } gfx::Size EditingList::CalculatePreferredSize() const { - if (HasControls()) { - // TODO(b/270969479): The height will be dynamic depending on the list. - return gfx::Size(kMainContainerWidth, 80); - } - return gfx::Size(kMainContainerWidth, kMainContainerZeroStateHeight); + return gfx::Size(kMainContainerWidth, GetHeightForWidth(kMainContainerWidth)); } } // namespace arc::input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/ui_utils.cc b/chrome/browser/ash/arc/input_overlay/ui/ui_utils.cc new file mode 100644 index 0000000..b077bf65 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/ui_utils.cc
@@ -0,0 +1,78 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/ui_utils.h" + +#include "ash/bubble/bubble_utils.h" +#include "ash/style/typography.h" +#include "chrome/browser/ash/arc/input_overlay/actions/action.h" +#include "ui/chromeos/styles/cros_tokens_color_mappings.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/layout/flex_layout.h" +#include "ui/views/layout/table_layout.h" +#include "ui/views/view.h" + +namespace arc::input_overlay { + +std::unique_ptr<views::View> CreateNameTag(const std::u16string& title, + const std::u16string& sub_title) { + auto name_tag = std::make_unique<views::View>(); + name_tag->SetLayoutManager(std::make_unique<views::FlexLayout>()) + ->SetOrientation(views::LayoutOrientation::kVertical) + .SetMainAxisAlignment(views::LayoutAlignment::kStart) + .SetCrossAxisAlignment(views::LayoutAlignment::kStart); + name_tag->AddChildView( + ash::bubble_utils::CreateLabel(ash::TypographyToken::kCrosButton1, title, + cros_tokens::kCrosRefNeutral100)); + name_tag->AddChildView(ash::bubble_utils::CreateLabel( + ash::TypographyToken::kCrosAnnotation2, sub_title, + cros_tokens::kCrosSysSecondary)); + return name_tag; +} + +std::unique_ptr<views::View> CreateActionMoveEditForKeyboard(Action* action) { + auto keys = std::make_unique<views::View>(); + // Create a 2x3 table with column and row padding of 4. + keys->SetLayoutManager(std::make_unique<views::TableLayout>()) + ->AddColumn(/*h_align=*/views::LayoutAlignment::kCenter, + /*v_align=*/views::LayoutAlignment::kCenter, + /*horizontal_resize=*/1.0f, + /*size_type=*/views::TableLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0) + .AddPaddingColumn(/*horizontal_resize=*/views::TableLayout::kFixedSize, + /*width=*/4) + .AddColumn(/*h_align=*/views::LayoutAlignment::kCenter, + /*v_align=*/views::LayoutAlignment::kCenter, + /*horizontal_resize=*/1.0f, + /*size_type=*/views::TableLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0) + .AddPaddingColumn(/*horizontal_resize=*/views::TableLayout::kFixedSize, + /*width=*/4) + .AddColumn(/*h_align=*/views::LayoutAlignment::kCenter, + /*v_align=*/views::LayoutAlignment::kCenter, + /*horizontal_resize=*/1.0f, + /*size_type=*/views::TableLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0) + .AddRows(1, /*vertical_resize=*/views::TableLayout::kFixedSize) + .AddPaddingRow(/*vertical_resize=*/views::TableLayout::kFixedSize, + /*height=*/4) + .AddRows(1, /*vertical_resize=*/views::TableLayout::kFixedSize); + // Column 1 row 1 is empty. + keys->AddChildView(std::make_unique<views::View>()); + // TODO(b/270969479): Replace the hardcoded text. + keys->AddChildView(std::make_unique<views::LabelButton>( + views::Button::PressedCallback(), u"w")); + // Column 3 row 1 is empty. + keys->AddChildView(std::make_unique<views::View>()); + // TODO(b/270969479): Replace the hardcoded text. + keys->AddChildView(std::make_unique<views::LabelButton>( + views::Button::PressedCallback(), u"a")); + keys->AddChildView(std::make_unique<views::LabelButton>( + views::Button::PressedCallback(), u"s")); + keys->AddChildView(std::make_unique<views::LabelButton>( + views::Button::PressedCallback(), u"d")); + return keys; +} + +} // namespace arc::input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/ui_utils.h b/chrome/browser/ash/arc/input_overlay/ui/ui_utils.h new file mode 100644 index 0000000..498fecd5 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/ui_utils.h
@@ -0,0 +1,36 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_UI_UTILS_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_UI_UTILS_H_ + +#include <memory> +#include <string> + +namespace views { +class View; +} + +namespace arc::input_overlay { + +class Action; + +// Create name tag with title and sub-title as: +// ----------- +// |Title | +// |Sub-title| +// ----------- +std::unique_ptr<views::View> CreateNameTag(const std::u16string& title, + const std::u16string& sub_title); + +// Create key layout view for ActionMove. +// ------------- +// | | w | | +// |-----------| +// | a | s | d | +// ------------- +std::unique_ptr<views::View> CreateActionMoveEditForKeyboard(Action* action); +} // namespace arc::input_overlay + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_UI_UTILS_H_
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index 63740c7..704c3bd 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -274,6 +274,7 @@ "//chrome/browser:browser_process", "//chrome/browser/ash:print_job_info_proto", "//chrome/browser/ash/smart_reader", + "//chrome/browser/ash/system_web_apps:system_web_apps", "//chrome/browser/ash/system_web_apps/types:types", "//chrome/browser/ash/telemetry_extension/diagnostics", "//chrome/browser/ash/telemetry_extension/events",
diff --git a/chrome/browser/ash/crosapi/browser_manager.cc b/chrome/browser/ash/crosapi/browser_manager.cc index 96fa9458..3ff1252 100644 --- a/chrome/browser/ash/crosapi/browser_manager.cc +++ b/chrome/browser/ash/crosapi/browser_manager.cc
@@ -1222,7 +1222,7 @@ SetState(State::UNAVAILABLE); return; } - SetState(State::STARTING); + SetState(pass_post_login_params ? State::PRE_LAUNCHED : State::STARTING); LOG(WARNING) << "Launched lacros-chrome with pid " << lacros_process_.Pid(); channel.RemoteProcessLaunchAttempted(); } @@ -1314,7 +1314,8 @@ return; } - DCHECK(state_ == State::STARTING || state_ == State::RUNNING); + DCHECK(state_ == State::PRE_LAUNCHED || state_ == State::STARTING || + state_ == State::RUNNING); DCHECK(lacros_process_.IsValid()); browser_service_.reset(); @@ -1483,6 +1484,7 @@ DCHECK_EQ(session_manager::SessionManager::Get()->session_state(), session_manager::SessionState::ACTIVE); DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn()); + DCHECK_EQ(state_, State::PRE_LAUNCHED); // Ensure this isn't run multiple times. ash::SessionManagerClient::Get()->RemoveObserver(this); @@ -1519,6 +1521,9 @@ DPCHECK(write_success); postlogin_pipe_fd_.reset(); + // Lacros launch is unblocked now. + SetState(State::STARTING); + // Post `DryRunToCollectUMA()` to send UMA stats about sizes of files/dirs // inside the profile data directory. base::ThreadPool::PostTask( @@ -1765,6 +1770,7 @@ pending_actions_.PushOrCancel(std::move(action)); return; case State::CREATING_LOG_FILE: + case State::PRE_LAUNCHED: case State::STARTING: LOG(WARNING) << "lacros-chrome is in the process of launching"; pending_actions_.PushOrCancel(std::move(action));
diff --git a/chrome/browser/ash/crosapi/browser_manager.h b/chrome/browser/ash/crosapi/browser_manager.h index 103f5e7..e7e6a0c 100644 --- a/chrome/browser/ash/crosapi/browser_manager.h +++ b/chrome/browser/ash/crosapi/browser_manager.h
@@ -419,7 +419,11 @@ // Lacros-chrome is creating a new log file to log to. CREATING_LOG_FILE, - // Lacros-chrome is launching. + // Lacros-chrome has been pre-launched at login screen, and it's waiting to + // be unblocked post-login. + PRE_LAUNCHED, + + // Lacros-chrome is launching, or resuming a pre-launched instance. STARTING, // Mojo connection to lacros-chrome is established so, it's in
diff --git a/chrome/browser/ash/crosapi/url_handler_ash.cc b/chrome/browser/ash/crosapi/url_handler_ash.cc index 9aff13f..23b5152a 100644 --- a/chrome/browser/ash/crosapi/url_handler_ash.cc +++ b/chrome/browser/ash/crosapi/url_handler_ash.cc
@@ -118,6 +118,12 @@ GURL(kChromeUrlPrefix + crosapi::gurl_os_handler_utils::AshOsUrlHost(target_url)); } + absl::optional<ash::SystemWebAppType> swa_type = + ash::GetCapturingSystemAppForURL( + ProfileManager::GetPrimaryUserProfile(), target_url); + if (swa_type.has_value()) { + return false; + } } else { LOG(ERROR) << "Invalid URL passed to UrlHandlerAsh::OpenUrl:" << url; return false;
diff --git a/chrome/browser/ash/drive/drive_integration_service.cc b/chrome/browser/ash/drive/drive_integration_service.cc index 9c11f4c..c4caa69 100644 --- a/chrome/browser/ash/drive/drive_integration_service.cc +++ b/chrome/browser/ash/drive/drive_integration_service.cc
@@ -1669,9 +1669,28 @@ return; } - // TODO(b/234921400): Replace this with a call to DriveFS once implemented. - base::SequencedTaskRunner::GetCurrentDefault()->PostTask(FROM_HERE, - std::move(callback)); + GetDriveFsInterface()->UpdateFromPairedDoc( + drive_path, + base::BindOnce(&DriveIntegrationService::OnUpdateFromPairedDocComplete, + weak_ptr_factory_.GetWeakPtr(), drive_path, + std::move(callback))); +} + +void DriveIntegrationService::OnUpdateFromPairedDocComplete( + const base::FilePath& drive_path, + base::OnceClosure callback, + drive::FileError error) { + if (error != drive::FileError::FILE_ERROR_OK) { + LOG(ERROR) << "Error in UpdateFromPairedDoc: " << error; + std::move(callback).Run(); + return; + } + + GetDriveFsInterface()->GetItemFromCloudStore( + drive_path, base::BindOnce([](drive::FileError error) { + LOG_IF(ERROR, error != drive::FileError::FILE_ERROR_OK) + << "Error in GetItemFromCloudStore: " << error; + }).Then(std::move(callback))); } void DriveIntegrationService::ImmediatelyUpload(
diff --git a/chrome/browser/ash/drive/drive_integration_service.h b/chrome/browser/ash/drive/drive_integration_service.h index 40eab9f..5ee1a45 100644 --- a/chrome/browser/ash/drive/drive_integration_service.h +++ b/chrome/browser/ash/drive/drive_integration_service.h
@@ -431,6 +431,10 @@ drivefs::mojom::DriveFs::ToggleSyncForPathCallback callback, bool exists); + void OnUpdateFromPairedDocComplete(const base::FilePath& drive_path, + base::OnceClosure callback, + drive::FileError error); + friend class DriveIntegrationServiceFactory; raw_ptr<Profile, ExperimentalAsh> profile_;
diff --git a/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc b/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc index f9a1a348..6090f39 100644 --- a/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc +++ b/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc
@@ -2030,6 +2030,8 @@ return api::autotest_private::LacrosState::kStopped; case crosapi::BrowserManager::State::CREATING_LOG_FILE: return api::autotest_private::LacrosState::kCreatingLogFile; + case crosapi::BrowserManager::State::PRE_LAUNCHED: + return api::autotest_private::LacrosState::kPreLaunched; case crosapi::BrowserManager::State::STARTING: return api::autotest_private::LacrosState::kStarting; case crosapi::BrowserManager::State::RUNNING:
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_drive.cc b/chrome/browser/ash/extensions/file_manager/private_api_drive.cc index 07c67f58..eb60de2c 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_drive.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_drive.cc
@@ -1045,4 +1045,22 @@ return RespondNow(NoArguments()); } +ExtensionFunction::ResponseAction +FileManagerPrivateCalculateBulkPinRequiredSpaceFunction::Run() { + Profile* const profile = Profile::FromBrowserContext(browser_context()); + drive::DriveIntegrationService* integration_service = + drive::util::GetIntegrationServiceByProfile(profile); + if (!integration_service) { + return RespondNow(Error("Drive not available")); + } + + drivefs::pinning::PinManager* const p = integration_service->GetPinManager(); + if (!p) { + return RespondNow(Error("Pin Manager not available")); + } + + p->CalculateRequiredSpace(); + return RespondNow(NoArguments()); +} + } // namespace extensions
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_drive.h b/chrome/browser/ash/extensions/file_manager/private_api_drive.h index e262598..b28a75b 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_drive.h +++ b/chrome/browser/ash/extensions/file_manager/private_api_drive.h
@@ -225,6 +225,20 @@ ResponseAction Run() override; }; +// Implements the chrome.fileManagerPrivate.calculateBulkPinRequiredSpace +// method. +class FileManagerPrivateCalculateBulkPinRequiredSpaceFunction + : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.calculateBulkPinRequiredSpace", + FILEMANAGERPRIVATE_CALCULATEBULKPINREQUIREDSPACE) + + protected: + ~FileManagerPrivateCalculateBulkPinRequiredSpaceFunction() override = default; + + ResponseAction Run() override; +}; + } // namespace extensions #endif // CHROME_BROWSER_ASH_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_util.cc b/chrome/browser/ash/extensions/file_manager/private_api_util.cc index d18262e2..7747249 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_util.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_util.cc
@@ -274,6 +274,24 @@ return extensions::api::file_manager_private::BULK_PIN_STAGE_NONE; } +bool IsPinManagerAvailableAndSyncingForProfile(Profile* profile) { + if (!profile) { + return false; + } + drive::DriveIntegrationService* integration_service = + drive::DriveIntegrationServiceFactory::FindForProfile(profile); + if (!integration_service || !integration_service->IsMounted() || + !integration_service->GetPinManager()) { + return false; + } + auto* const pin_manager = integration_service->GetPinManager(); + if (pin_manager->GetProgress().stage != + drivefs::pin_manager_types::mojom::Stage::kSyncing) { + return false; + } + return true; +} + } // namespace // Creates an instance and starts the process. @@ -392,11 +410,27 @@ properties_->present = metadata->available_offline; properties_->dirty = metadata->dirty; properties_->hosted = drivefs::IsHosted(metadata->type); + properties_->available_offline = metadata->available_offline || *properties_->hosted; properties_->available_when_metered = metadata->available_offline || *properties_->hosted; properties_->pinned = metadata->pinned; + + // When the bulk pinning feature is enabled, folders can't be pinned + // automatically to provide a way to intercept items being added to these + // folders. However items in the folders will be pinned, so to ensure the UI + // shows these folders as available offline, return these items as pinned and + // available offline. This should not include shortcuts. + if (drive::util::IsDriveFsBulkPinningEnabled() && + IsPinManagerAvailableAndSyncingForProfile(running_profile_) && + metadata->type == drivefs::mojom::FileMetadata::Type::kDirectory && + !metadata->shortcut_details) { + properties_->pinned = true; + properties_->available_offline = true; + properties_->available_when_metered = true; + } + properties_->shared = metadata->shared; properties_->starred = metadata->starred;
diff --git a/chrome/browser/ash/file_manager/copy_or_move_io_task_impl.cc b/chrome/browser/ash/file_manager/copy_or_move_io_task_impl.cc index 2cfddb8..8fb09a1 100644 --- a/chrome/browser/ash/file_manager/copy_or_move_io_task_impl.cc +++ b/chrome/browser/ash/file_manager/copy_or_move_io_task_impl.cc
@@ -33,6 +33,10 @@ #include "chrome/browser/ash/file_manager/io_task_util.h" #include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/ash/file_manager/volume_manager.h" +#include "chrome/browser/policy/profile_policy_connector.h" +#include "chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" +#include "components/user_manager/user_manager.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "google_apis/common/task_util.h" @@ -184,6 +188,23 @@ progress_callback_ = std::move(progress_callback); complete_callback_ = std::move(complete_callback); + // TODO(b/280947989) remove this code once Multi-user sign-in is deprecated. + // Prevent files being copied or moved to ODFS if there is a managed user + // present amongst other logged in users. Ensures managed user's files can't + // be leaked to a non-managed user's ODFS b/278644796. + if (ash::cloud_upload::UrlIsOnODFS(profile_, + progress_->GetDestinationFolder())) { + // Check none of the logged in users are managed. + for (auto* user : user_manager::UserManager::Get()->GetLoggedInUsers()) { + Profile* user_profile = Profile::FromBrowserContext( + ash::BrowserContextHelper::Get()->GetBrowserContextByUser(user)); + if (user_profile->GetProfilePolicyConnector()->IsManaged()) { + Complete(State::kError); + return; + } + } + } + if (progress_->sources.size() == 0) { Complete(State::kSuccess); return;
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest.cc b/chrome/browser/ash/file_manager/file_manager_browsertest.cc index 0447928..79f291e9 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest.cc
@@ -1548,7 +1548,9 @@ TestCase("driveEncryptionBadge"), TestCase("driveDeleteDialogDoesntMentionPermanentDelete"), TestCase("driveInlineSyncStatusSingleFile").EnableInlineStatusSync(), - TestCase("driveInlineSyncStatusParentFolder").EnableInlineStatusSync() + TestCase("driveInlineSyncStatusParentFolder").EnableInlineStatusSync(), + TestCase("driveFolderShouldShowOfflineTickWhenBulkPinningEnabled") + .EnableBulkPinning() // TODO(b/189173190): Enable // TestCase("driveEnableDocsOfflineDialog"), // TODO(b/189173190): Enable
diff --git a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc index d6ea51c..42b3956 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc +++ b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc
@@ -38,33 +38,6 @@ {"voice.google.com", ""}, {"mail.google.com", "/chat"}, }; -// The default denylist of domains and paths that will turn off multi word -// suggestion. -const char* kDeniedDomainsForMultiwordSuggester[] = { - "amazon", - "b.corp.google", - "buganizer.corp.google", - "cider.corp.google", - "classroom.google", - "desmos", - "docs.google", - "facebook", - "instagram", - "mail.google", - "outlook.live", - "outlook.office", - "quizlet", - // TODO(b/209696920): remove web.skype.com from the list after compatibility - // issues are solved. - "web.skype", - "whatsapp", - "youtube", -}; - -// exceptions where multi word suggestion is enabled. -const char* kAllowedDomainsAndPathsForMultiwordSuggester[][2] = { - {"mail.google", "/chat"}}; - const char* kTestUrls[] = { "e14s-test", "simple_textarea.html", @@ -300,9 +273,7 @@ // Deny-list (will block if matched, otherwise allow) bool multi_word_suggestions_allowed = - (!IsMatchedSubDomain(kDeniedDomainsForMultiwordSuggester, current_url) || - IsMatchedSubDomainWithPathPrefix( - kAllowedDomainsAndPathsForMultiwordSuggester, current_url)) && + !IsAssistiveInputDisabled(current_url) && !IsMatchedApp(kDeniedAppsForMultiwordSuggester, window_properties) && !IsMatchedExactUrl(kDeniedUrlsForMultiwordSuggester, current_url);
diff --git a/chrome/browser/ash/input_method/autocorrect_manager.cc b/chrome/browser/ash/input_method/autocorrect_manager.cc index 1afde3a7..2216f41 100644 --- a/chrome/browser/ash/input_method/autocorrect_manager.cc +++ b/chrome/browser/ash/input_method/autocorrect_manager.cc
@@ -1220,7 +1220,7 @@ void AutocorrectManager::OnTextFieldContextualInfoChanged( const TextFieldContextualInfo& info) { - disabled_by_rule_ = IsAutoCorrectDisabled(info); + disabled_by_rule_ = IsAssistiveInputDisabled(info.tab_url); if (disabled_by_rule_) { LogAssistiveAutocorrectInternalState( AutocorrectInternalStates::kAppIsInDenylist);
diff --git a/chrome/browser/ash/input_method/ime_rules_config.cc b/chrome/browser/ash/input_method/ime_rules_config.cc index e96aad9..a8c145c 100644 --- a/chrome/browser/ash/input_method/ime_rules_config.cc +++ b/chrome/browser/ash/input_method/ime_rules_config.cc
@@ -13,8 +13,9 @@ namespace input_method { namespace { -// The default denylist of domains that will turn off auto_correct feature. -const char* kDefaultAutocorrectDomainDenylist[] = { +// The default denylist of domains that will turn off autocorrect and multi word +// suggestions. +const char* kDefaultDomainDenylist[] = { "amazon", "b.corp.google", "buganizer.corp.google", @@ -24,15 +25,20 @@ "docs.google", "facebook", "instagram", + "mail.google", "outlook.live", "outlook.office", "quizlet", "reddit", + "web.skype", "teams.microsoft", "twitter", "whatsapp", "youtube", }; + +// exceptions where the features are enabled. +const char* kAllowedDomainsWithPaths[][2] = {{"mail.google", "/chat"}}; } // namespace // Checks if domain is a sub-domain of url @@ -60,14 +66,29 @@ base::StartsWith(url.path(), path_prefix); } -bool IsAutoCorrectDisabled(const TextFieldContextualInfo& info) { - // Check the default domain denylist rules. - for (const char* domain : kDefaultAutocorrectDomainDenylist) { - if (IsSubDomain(info.tab_url, domain)) { +bool IsMatchedSubDomain(const GURL& url) { + for (const char* domain : kDefaultDomainDenylist) { + if (IsSubDomain(url, domain)) { return true; } } return false; } + +bool IsMatchedSubDomainWithPathPrefix(const GURL& url) { + for (const auto& [domain, path_prefix] : kAllowedDomainsWithPaths) { + if (IsSubDomainWithPathPrefix(url, domain, path_prefix)) { + return true; + } + } + return false; +} + +bool IsAssistiveInputDisabled(const absl::optional<GURL>& url) { + if (!url.has_value()) { + return false; + } + return IsMatchedSubDomain(*url) && !IsMatchedSubDomainWithPathPrefix(*url); +} } // namespace input_method } // namespace ash
diff --git a/chrome/browser/ash/input_method/ime_rules_config.h b/chrome/browser/ash/input_method/ime_rules_config.h index 832477f..1e3b4ff 100644 --- a/chrome/browser/ash/input_method/ime_rules_config.h +++ b/chrome/browser/ash/input_method/ime_rules_config.h
@@ -11,7 +11,7 @@ namespace input_method { // Runs the rule check against contextual info. -bool IsAutoCorrectDisabled(const TextFieldContextualInfo& info); +bool IsAssistiveInputDisabled(const absl::optional<GURL>& current_url); // Runs the rule check against url bool IsMultiWordSuggestDisabled(const GURL& url);
diff --git a/chrome/browser/ash/input_method/ime_rules_config_unittest.cc b/chrome/browser/ash/input_method/ime_rules_config_unittest.cc index fdb5d64..cb680a3 100644 --- a/chrome/browser/ash/input_method/ime_rules_config_unittest.cc +++ b/chrome/browser/ash/input_method/ime_rules_config_unittest.cc
@@ -9,14 +9,6 @@ namespace ash { namespace input_method { -namespace { - -TextFieldContextualInfo FakeTextFieldContextualInfo(GURL url) { - TextFieldContextualInfo info; - info.tab_url = url; - return info; -} -} // namespace class ImeRulesConfigAutoCorrectDisabledTest : public testing::TestWithParam<std::string> { @@ -55,8 +47,7 @@ "http://www.abc.smile.amazon.com.au/abc+com+au/some/other/text")); TEST_P(ImeRulesConfigAutoCorrectDisabledTest, IsAutoCorrectDisabled) { - EXPECT_TRUE( - IsAutoCorrectDisabled(FakeTextFieldContextualInfo(GURL(GetParam())))); + EXPECT_TRUE(IsAssistiveInputDisabled(GURL(GetParam()))); } class ImeRulesConfigAutoCorrectEnabledTest @@ -84,8 +75,7 @@ "http://.com/test")); TEST_P(ImeRulesConfigAutoCorrectEnabledTest, IsAutoCorrectEnabled) { - EXPECT_FALSE( - IsAutoCorrectDisabled(FakeTextFieldContextualInfo(GURL(GetParam())))); + EXPECT_FALSE(IsAssistiveInputDisabled(GURL(GetParam()))); } } // namespace input_method } // namespace ash
diff --git a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc index d518135d..659e97d 100644 --- a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc
@@ -901,7 +901,6 @@ web_contents->GetPrimaryMainFrame()->GetProcess()->GetID(), web_contents->GetPrimaryMainFrame()->GetRoutingID(), url::Origin::Create(GURL(kExampleUrl)), media_id, - /*extension_name=*/"", content::DesktopStreamRegistryType::kRegistryStreamTypeDesktop); MaybeStartScreenShare( @@ -931,8 +930,7 @@ web_contents->GetPrimaryMainFrame()->GetRoutingID())); extensions::TabCaptureRegistry::Get(browser()->profile()) ->AddRequest(web_contents, /*extension_id=*/"", /*is_anonymous=*/false, - GURL(kExampleUrl), media_id, /*extension_name=*/"", - web_contents); + GURL(kExampleUrl), media_id, web_contents); MaybeStartScreenShare( std::make_unique<TabCaptureAccessHandler>(), web_contents,
diff --git a/chrome/browser/ash/web_applications/help_app/help_app_untrusted_ui_config.cc b/chrome/browser/ash/web_applications/help_app/help_app_untrusted_ui_config.cc index 77f73c6..c37444e 100644 --- a/chrome/browser/ash/web_applications/help_app/help_app_untrusted_ui_config.cc +++ b/chrome/browser/ash/web_applications/help_app/help_app_untrusted_ui_config.cc
@@ -87,6 +87,9 @@ "HelpAppAppsDiscovery", base::FeatureList::IsEnabled(features::kHelpAppAppsDiscovery)); source->AddBoolean( + "HelpAppAutoTriggerInstallDialog", + base::FeatureList::IsEnabled(features::kHelpAppAutoTriggerInstallDialog)); + source->AddBoolean( "HelpAppSearchServiceIntegration", base::FeatureList::IsEnabled(features::kEnableLocalSearchService)); source->AddBoolean("isCloudGamingDevice",
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index 125598d..7f815184 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -244,6 +244,7 @@ #include "ash/webui/help_app_ui/help_app_ui.h" #include "ash/webui/help_app_ui/help_app_ui.mojom.h" #include "ash/webui/help_app_ui/search/search.mojom.h" +#include "ash/webui/media_app_ui/media_app_guest_ui.h" #include "ash/webui/media_app_ui/media_app_ui.h" #include "ash/webui/media_app_ui/media_app_ui.mojom.h" #include "ash/webui/multidevice_debug/proximity_auth_ui.h" @@ -1536,6 +1537,9 @@ registry.ForWebUI<ash::feedback::OsFeedbackUntrustedUI>() .Add<color_change_listener::mojom::PageHandler>(); + + registry.ForWebUI<ash::MediaAppGuestUI>() + .Add<color_change_listener::mojom::PageHandler>(); #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
diff --git a/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc b/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc index bfd66a8..b5a9fa0f6 100644 --- a/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc +++ b/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc
@@ -5,15 +5,56 @@ #include "chrome/browser/devtools/protocol/devtools_protocol_test_support.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/autofill/content/browser/content_autofill_driver.h" +#include "components/autofill/content/browser/test_autofill_manager_injector.h" +#include "components/autofill/core/browser/browser_autofill_manager.h" +#include "components/autofill/core/browser/test_autofill_manager_waiter.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "testing/gmock/include/gmock/gmock.h" -using DevToolsAutofillTest = DevToolsProtocolTestBase; - namespace { -IN_PROC_BROWSER_TEST_F(DevToolsAutofillTest, DISABLED_TriggerCreditCard) { +// Adds waiting capabilities to BrowserAutofillManager. +class TestAutofillManager : public autofill::BrowserAutofillManager { + public: + TestAutofillManager(autofill::ContentAutofillDriver* driver, + autofill::AutofillClient* client) + : BrowserAutofillManager(driver, client, "en-US") {} + + static TestAutofillManager* GetForRenderFrameHost( + content::RenderFrameHost* rfh) { + return static_cast<TestAutofillManager*>( + autofill::ContentAutofillDriver::GetForRenderFrameHost(rfh) + ->autofill_manager()); + } + + [[nodiscard]] testing::AssertionResult WaitForFormsSeen( + size_t num_awaited_calls) { + return forms_seen_.Wait(num_awaited_calls); + } + + private: + autofill::TestAutofillManagerWaiter forms_seen_{ + *this, + {autofill::AutofillManagerEvent::kFormsSeen}}; +}; + +class DevToolsAutofillTest : public DevToolsProtocolTestBase { + public: + content::RenderFrameHost* main_frame() { + return web_contents()->GetPrimaryMainFrame(); + } + TestAutofillManager* main_autofill_manager() { + return TestAutofillManager::GetForRenderFrameHost(main_frame()); + } + + private: + autofill::TestAutofillManagerInjector<TestAutofillManager> + autofill_manager_injector_; +}; + +IN_PROC_BROWSER_TEST_F(DevToolsAutofillTest, TriggerCreditCard) { embedded_test_server()->ServeFilesFromSourceDirectory( "chrome/test/data/autofill"); ASSERT_TRUE(embedded_test_server()->Start()); @@ -27,6 +68,8 @@ browser()->tab_strip_model()->GetActiveWebContents(), "CREDIT_CARD_NUMBER"); + EXPECT_TRUE(main_autofill_manager()->WaitForFormsSeen(1)); + content::RenderFrameHost* rfh = web_contents()->GetPrimaryMainFrame(); std::string object_id; @@ -58,7 +101,10 @@ card.Set("cvc", "123"); params.Set("card", std::move(card)); - SendCommand("Autofill.trigger", std::move(params)); + const base::Value::Dict* result = + SendCommandSync("Autofill.trigger", std::move(params)); + + EXPECT_EQ(*result, base::Value::Dict()); std::string ccNameResult = EvalJs(rfh, "document.getElementById('CREDIT_CARD_NAME_FULL').value")
diff --git a/chrome/browser/download/internal/android/BUILD.gn b/chrome/browser/download/internal/android/BUILD.gn index 107014a..3a24727 100644 --- a/chrome/browser/download/internal/android/BUILD.gn +++ b/chrome/browser/download/internal/android/BUILD.gn
@@ -189,6 +189,7 @@ "java/res/layout/download_rename_custom_dialog.xml", "java/res/layout/download_rename_extension_custom_dialog.xml", "java/res/layout/download_storage_summary.xml", + "java/res/layout/downloads_empty_state_view.xml", "java/res/layout/downloads_empty_view.xml", "java/res/layout/list_selection_handle_view.xml", "java/res/menu/download_manager_menu.xml",
diff --git a/chrome/browser/download/internal/android/java/res/layout/downloads_empty_state_view.xml b/chrome/browser/download/internal/android/java/res/layout/downloads_empty_state_view.xml new file mode 100644 index 0000000..3a3eec3 --- /dev/null +++ b/chrome/browser/download/internal/android/java/res/layout/downloads_empty_state_view.xml
@@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2023 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + <include layout="@layout/empty_state_view"/> + + <org.chromium.ui.widget.LoadingView + android:id="@+id/empty_state_loading" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + +</FrameLayout>
diff --git a/chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/empty/EmptyView.java b/chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/empty/EmptyView.java index 2d44829..2120a25e 100644 --- a/chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/empty/EmptyView.java +++ b/chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/empty/EmptyView.java
@@ -29,7 +29,7 @@ public EmptyView(Context context) { if (ChromeFeatureList.isEnabled(ChromeFeatureList.EMPTY_STATES)) { mView = (ViewGroup) LayoutInflater.from(context).inflate( - R.layout.empty_state_view, null); + R.layout.downloads_empty_state_view, null); mEmptyContainer = mView.findViewById(R.id.empty_state_container); mEmptyView = (TextView) mView.findViewById(R.id.empty_state_text_title);
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc index 1cb17c3..f7552f8 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
@@ -201,7 +201,7 @@ if (source.type != DesktopMediaID::TYPE_NONE) { result = content::DesktopStreamsRegistry::GetInstance()->RegisterStream( render_frame_host_id.child_id, render_frame_host_id.frame_routing_id, - url::Origin::Create(origin), source, extension()->name(), + url::Origin::Create(origin), source, content::kRegistryStreamTypeDesktop); }
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc index a8a7ac2..883b183 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
@@ -190,9 +190,9 @@ DesktopMediaID source = BuildDesktopMediaID(target_contents, ¶ms->options); TabCaptureRegistry* registry = TabCaptureRegistry::Get(browser_context()); - std::string device_id = registry->AddRequest( - target_contents, extension_id, false, extension()->url(), source, - extension()->name(), extension_web_contents); + std::string device_id = + registry->AddRequest(target_contents, extension_id, false, + extension()->url(), source, extension_web_contents); if (device_id.empty()) { return RespondNow(Error(kCapturingSameTab)); } @@ -255,7 +255,6 @@ // |consumer_contents| is the WebContents for which the stream is created. content::WebContents* consumer_contents = nullptr; - std::string consumer_name; GURL origin; if (params->options && params->options->consumer_tab_id) { if (!ExtensionTabUtil::GetTabById(*(params->options->consumer_tab_id), @@ -273,20 +272,16 @@ if (!network::IsUrlPotentiallyTrustworthy(origin)) { return RespondNow(Error(kTabUrlNotSecure)); } - - consumer_name = net::GetHostAndOptionalPort(origin); } else { origin = extension()->url(); - consumer_name = extension()->name(); consumer_contents = GetSenderWebContents(); } EXTENSION_FUNCTION_VALIDATE(consumer_contents); DesktopMediaID source = BuildDesktopMediaID(target_contents, nullptr); TabCaptureRegistry* registry = TabCaptureRegistry::Get(browser_context()); - std::string device_id = - registry->AddRequest(target_contents, extension_id, false, origin, source, - consumer_name, consumer_contents); + std::string device_id = registry->AddRequest( + target_contents, extension_id, false, origin, source, consumer_contents); if (device_id.empty()) { return RespondNow(Error(kCapturingSameTab)); }
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc index 797aa77d..f5ce52a5 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
@@ -177,7 +177,6 @@ bool is_anonymous, const GURL& origin, content::DesktopMediaID source, - const std::string& extension_name, content::WebContents* caller_contents) { std::string device_id; LiveRequest* const request = FindRequest(target_contents); @@ -201,8 +200,7 @@ if (main_frame) { device_id = content::DesktopStreamsRegistry::GetInstance()->RegisterStream( main_frame->GetProcess()->GetID(), main_frame->GetRoutingID(), - url::Origin::Create(origin), source, extension_name, - content::kRegistryStreamTypeTab); + url::Origin::Create(origin), source, content::kRegistryStreamTypeTab); } return device_id;
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h index f692e540..81cf0b125 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
@@ -62,7 +62,6 @@ bool is_anonymous, const GURL& origin, content::DesktopMediaID source, - const std::string& extension_name, content::WebContents* caller_contents); // Called by MediaStreamDevicesController to verify the request before
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index 33f6e9a..e6070f4 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -394,8 +394,6 @@ const chromeos::WindowPinType previous_type = window->GetProperty(lacros::kWindowPinTypeKey); - DCHECK_NE(previous_type, chromeos::WindowPinType::kTrustedPinned) - << "Extensions only set Trusted Pinned"; bool previous_pinned = previous_type == chromeos::WindowPinType::kTrustedPinned;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 12860d5..54ddd19 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -140,6 +140,11 @@ "expiry_milestone": 120 }, { + "name": "alt-click-and-six-pack-customization", + "owners": [ "michaelcheco", "cros-peripherals@google.com" ], + "expiry_milestone": 122 + }, + { "name": "always-enable-hdcp", "owners": [ "chromeos-gfx-video@google.com" ], // This flag is used for HDCP compliance testing on ChromeOS so should not @@ -4300,6 +4305,11 @@ "expiry_milestone": 116 }, { + "name": "help-app-auto-trigger-install-dialog", + "owners": [ "//ash/webui/help_app_ui/OWNERS" ], + "expiry_milestone": 117 + }, + { "name": "help-app-launcher-search", "owners": [ "//ash/webui/help_app_ui/OWNERS", "//chrome/browser/ash/app_list/search/OWNERS" ], "expiry_milestone": 115
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index cb7ed27..f52b6ca5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -4943,6 +4943,13 @@ "Shows settings to enable/disable scroll acceleration and to adjust the " "sensitivity for scrolling."; +const char kAltClickAndSixPackCustomizationName[] = + "Allow users to customize Alt-Click and 6-pack key remapping."; + +const char kAltClickAndSixPackCustomizationDescription[] = + "Shows settings to customize Alt-Click and 6-pack key remapping in the " + "keyboard settings page."; + const char kAlwaysEnableHdcpName[] = "Always enable HDCP for external displays"; const char kAlwaysEnableHdcpDescription[] = "Enables the specified type for HDCP whenever an external display is " @@ -5837,6 +5844,12 @@ const char kHelpAppAppsDiscoveryDescription[] = "Enables the ChromeOS Apps Discovery experience in the Help App."; +const char kHelpAppAutoTriggerInstallDialogName[] = + "Help App Auto Trigger Install Dialog"; +const char kHelpAppAutoTriggerInstallDialogDescription[] = + "Enables the logic that auto triggers the install dialog during the web " + "app install flow initiated from the Help App."; + const char kHelpAppLauncherSearchName[] = "Help App launcher search"; const char kHelpAppLauncherSearchDescription[] = "Enables showing search results from the help app in the launcher.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 16de394..d0cd0786 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2843,7 +2843,8 @@ extern const char kAllowScrollSettingsName[]; extern const char kAllowScrollSettingsDescription[]; - +extern const char kAltClickAndSixPackCustomizationName[]; +extern const char kAltClickAndSixPackCustomizationDescription[]; extern const char kAlwaysEnableHdcpName[]; extern const char kAlwaysEnableHdcpDescription[]; extern const char kAlwaysEnableHdcpDefault[]; @@ -3352,6 +3353,9 @@ extern const char kHelpAppAppsDiscoveryName[]; extern const char kHelpAppAppsDiscoveryDescription[]; +extern const char kHelpAppAutoTriggerInstallDialogName[]; +extern const char kHelpAppAutoTriggerInstallDialogDescription[]; + extern const char kHelpAppLauncherSearchName[]; extern const char kHelpAppLauncherSearchDescription[];
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.cc b/chrome/browser/media/router/mojo/media_router_desktop.cc index a6eacef..af91316 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.cc +++ b/chrome/browser/media/router/mojo/media_router_desktop.cc
@@ -101,20 +101,6 @@ ? nullptr : DualMediaSinkService::GetInstance()) {} -void MediaRouterDesktop::RegisterMediaRouteProvider( - mojom::MediaRouteProviderId provider_id, - mojo::PendingRemote<mojom::MediaRouteProvider> - media_route_provider_remote) { - mojo::Remote<mojom::MediaRouteProvider> bound_remote( - std::move(media_route_provider_remote)); - bound_remote.set_disconnect_handler( - base::BindOnce(&MediaRouterDesktop::OnProviderConnectionError, - weak_factory_.GetWeakPtr(), provider_id)); - media_route_providers_[provider_id] = std::move(bound_remote); - - SyncStateToMediaRouteProvider(provider_id); -} - void MediaRouterDesktop::OnSinksReceived( mojom::MediaRouteProviderId provider_id, const std::string& media_source,
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.h b/chrome/browser/media/router/mojo/media_router_desktop.h index 2465dab..adc2f6f 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.h +++ b/chrome/browser/media/router/mojo/media_router_desktop.h
@@ -44,9 +44,6 @@ private: // mojom::MediaRouter implementation. - void RegisterMediaRouteProvider(mojom::MediaRouteProviderId provider_id, - mojo::PendingRemote<mojom::MediaRouteProvider> - media_route_provider_remote) override; void OnSinksReceived(mojom::MediaRouteProviderId provider_id, const std::string& media_source, const std::vector<MediaSinkInternal>& internal_sinks,
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc index 7830fd70..b0956ce 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc +++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc
@@ -147,6 +147,8 @@ base::BindOnce(&MediaRouterMojoImpl::OnProviderConnectionError, AsWeakPtr(), provider_id)); media_route_providers_[provider_id] = std::move(bound_remote); + + SyncStateToMediaRouteProvider(provider_id); } void MediaRouterMojoImpl::OnIssue(const IssueInfo& issue) {
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc index 458cfcc..820e6a2 100644 --- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc +++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -417,7 +417,7 @@ request.requested_video_device_id, main_frame->GetProcess()->GetID(), main_frame->GetRoutingID(), url::Origin::Create(request.security_origin), - /*extension_name=*/nullptr, content::kRegistryStreamTypeDesktop); + content::kRegistryStreamTypeDesktop); } // Received invalid device id.
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler_unittest.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler_unittest.cc index 3916789..5438e67 100644 --- a/chrome/browser/media/webrtc/desktop_capture_access_handler_unittest.cc +++ b/chrome/browser/media/webrtc/desktop_capture_access_handler_unittest.cc
@@ -361,7 +361,6 @@ url::Origin::Create(origin), content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, content::DesktopMediaID::kFakeId), - /*extension_name=*/"", content::DesktopStreamRegistryType::kRegistryStreamTypeDesktop); ProcessGenerateStreamRequest(id, origin, /*extension=*/nullptr, &result, @@ -524,7 +523,6 @@ url::Origin::Create(GURL(kOrigin)), content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, content::DesktopMediaID::kFakeId), - /*extension_name=*/"", content::DesktopStreamRegistryType::kRegistryStreamTypeDesktop); blink::mojom::MediaStreamRequestResult result = blink::mojom::MediaStreamRequestResult::NOT_SUPPORTED; @@ -557,7 +555,6 @@ url::Origin::Create(GURL(kOrigin)), content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, content::DesktopMediaID::kFakeId), - /*extension_name=*/"", content::DesktopStreamRegistryType::kRegistryStreamTypeDesktop); blink::mojom::MediaStreamRequestResult result = blink::mojom::MediaStreamRequestResult::NOT_SUPPORTED;
diff --git a/chrome/browser/media/webrtc/tab_capture_access_handler_unittest.cc b/chrome/browser/media/webrtc/tab_capture_access_handler_unittest.cc index d99de36..50d200f2 100644 --- a/chrome/browser/media/webrtc/tab_capture_access_handler_unittest.cc +++ b/chrome/browser/media/webrtc/tab_capture_access_handler_unittest.cc
@@ -110,7 +110,7 @@ extensions::TabCaptureRegistry::Get(profile())->AddRequest( web_contents(), /*extension_id=*/"", /*is_anonymous=*/false, - GURL(kOrigin), source, /*extension_name=*/"", web_contents()); + GURL(kOrigin), source, web_contents()); blink::mojom::MediaStreamRequestResult result = kInvalidResult; blink::mojom::StreamDevices devices; @@ -145,7 +145,7 @@ extensions::TabCaptureRegistry::Get(profile())->AddRequest( web_contents(), /*extension_id=*/"", /*is_anonymous=*/false, - GURL(kOrigin), source, /*extension_name=*/"", web_contents()); + GURL(kOrigin), source, web_contents()); blink::mojom::MediaStreamRequestResult result = kInvalidResult; blink::mojom::StreamDevices devices; @@ -177,7 +177,7 @@ extensions::TabCaptureRegistry::Get(profile())->AddRequest( web_contents(), /*extension_id=*/"", /*is_anonymous=*/false, - GURL(kOrigin), source, /*extension_name=*/"", web_contents()); + GURL(kOrigin), source, web_contents()); blink::mojom::MediaStreamRequestResult result = kInvalidResult; blink::mojom::StreamDevices devices; @@ -210,7 +210,7 @@ extensions::TabCaptureRegistry::Get(profile())->AddRequest( web_contents(), /*extension_id=*/"", /*is_anonymous=*/false, - GURL(kOrigin), source, /*extension_name=*/"", web_contents()); + GURL(kOrigin), source, web_contents()); blink::mojom::MediaStreamRequestResult result = kInvalidResult; blink::mojom::StreamDevices devices;
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc index 35847a9..03a4b027 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc
@@ -198,17 +198,6 @@ local_state->GetBoolean(prefs::kKerberosEnabled); #endif // BUILDFLAG(IS_CHROMEOS) -// TODO(crbug.com/1295308): Remove the following check after Chromad is -// deprecated. -#if BUILDFLAG(IS_CHROMEOS_ASH) - if (!auth_dynamic_params->allow_gssapi_library_load) { - policy::BrowserPolicyConnectorAsh* connector = - g_browser_process->platform_part()->browser_policy_connector_ash(); - auth_dynamic_params->allow_gssapi_library_load = - connector->IsActiveDirectoryManaged(); - } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - return auth_dynamic_params; }
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html index 4ce897a..d158d2a6 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html
@@ -154,7 +154,9 @@ </style> <div id="searchShadow"> - <cr-search-field id="search" label="Search Emojis" autofocus="true"> + <cr-search-field id="search" + label="[[getSearchPlaceholderLabel(gifSupport)]]" + autofocus="true"> </cr-search-field> <div id="category-button-group"> <template is="dom-repeat" items="[[categoryMetadata]]">
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.ts b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.ts index 6b7bec4..33a22e6 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.ts +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.ts
@@ -97,6 +97,12 @@ } } + // TODO(b/281609806): Remove this compatibility logic once gif support is + // turned on by default + private getSearchPlaceholderLabel(gifSupport: boolean): string { + return gifSupport ? 'Search' : 'Search emojis'; + } + /** * Processes the changes to the data and determines whether indexing is * needed or not. It also triggers indexing if mode is not lazy and there
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 29bec5e7..f7bd7189 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -2917,6 +2917,12 @@ <message name="IDS_HISTORY_MANAGER_EMPTY" desc="Indicates that there are no browsing history items."> Pages that you visit appear here </message> + <message name="IDS_HISTORY_MANAGER_EMPTY_STATE" desc="Indicates that there are no browsing history items."> + You’ll find your history here + </message> + <message name="IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED" desc="Indicates that users can view or clear page visited here"> + You can see the pages you’ve visited or clear them from your history + </message> <message name="IDS_HISTORY_MANAGER_NO_RESULTS" desc="Text explaining that no browsing history items match a search query."> Can’t find that page. Check your spelling or try a search on <ph name="SEARCH_ENGINE">%1$s<ex>Google</ex></ph>. </message>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE.png.sha1 new file mode 100644 index 0000000..07963db9 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE.png.sha1
@@ -0,0 +1 @@ +ccadcae0505b5f93f7e1e7633e55c7f3e79ad095 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED.png.sha1 new file mode 100644 index 0000000..07963db9 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED.png.sha1
@@ -0,0 +1 @@ +ccadcae0505b5f93f7e1e7633e55c7f3e79ad095 \ No newline at end of file
diff --git a/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc b/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc index dfeca1a..d3ba3006 100644 --- a/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc +++ b/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc
@@ -24,9 +24,9 @@ namespace { // The total number of Ash accelerators. -constexpr int kAshAcceleratorsTotalNum = 144; +constexpr int kAshAcceleratorsTotalNum = 146; // The hash of Ash accelerators. -constexpr char kAshAcceleratorsHash[] = "6db1b4e8a1ecec573f2d05580a67b2ae"; +constexpr char kAshAcceleratorsHash[] = "25a4b6ba184008ce1d4af917c57cb25b"; #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Internal builds add an extra accelerator for the Feedback app. // The total number of Chrome accelerators (available on Chrome OS).
diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc index 39ff12ce..f7e88ad 100644 --- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc +++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc
@@ -592,6 +592,7 @@ window->SetProperty(chromeos::kEscHoldToExitFullscreen, true); } else if (borealis::BorealisWindowManager::IsBorealisWindow(window)) { window->SetProperty(chromeos::kUseOverviewToExitFullscreen, true); + window->SetProperty(chromeos::kNoExitFullscreenOnLock, true); window->SetProperty(chromeos::kUseOverviewToExitPointerLock, true); } else if (crostini::IsCrostiniWindow(window)) { window->SetProperty(chromeos::kUseOverviewToExitFullscreen, true);
diff --git a/chrome/browser/ui/web_applications/web_app_launch_utils.cc b/chrome/browser/ui/web_applications/web_app_launch_utils.cc index d45ec05..06bdbfd 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_utils.cc +++ b/chrome/browser/ui/web_applications/web_app_launch_utils.cc
@@ -620,6 +620,7 @@ void UpdateLaunchStats(content::WebContents* web_contents, const AppId& app_id, const GURL& launch_url) { + CHECK(web_contents != nullptr); Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext());
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc index 6bcd911c..597f8e8 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
@@ -172,28 +172,13 @@ } } -bool FileIsOnDriveFS(Profile* profile, const base::FilePath& file_path) { +bool PathIsOnDriveFS(Profile* profile, const base::FilePath& file_path) { drive::DriveIntegrationService* integration_service = drive::DriveIntegrationServiceFactory::FindForProfile(profile); base::FilePath relative_path; return integration_service->GetRelativeDrivePath(file_path, &relative_path); } -bool FileIsOnODFS(Profile* profile, const FileSystemURL& url) { - ash::file_system_provider::util::FileSystemURLParser parser(url); - if (!parser.Parse()) { - return false; - } - - file_system_provider::ProviderId provider_id = - file_system_provider::ProviderId::CreateFromExtensionId( - file_manager::file_tasks::GetODFSExtensionId(profile)); - if (parser.file_system()->GetFileSystemInfo().provider_id() != provider_id) { - return false; - } - return true; -} - bool HasWordFile(const std::vector<storage::FileSystemURL>& file_urls) { for (auto& url : file_urls) { for (const std::string& extension : @@ -284,15 +269,15 @@ // the files before opening. void CloudOpenTask::OpenOrMoveFiles() { if (cloud_provider_ == CloudProvider::kGoogleDrive && - FileIsOnDriveFS(profile_, file_urls_.front().path())) { + PathIsOnDriveFS(profile_, file_urls_.front().path())) { // The files are on Drive already. OpenAlreadyHostedDriveUrls(); } else if (cloud_provider_ == CloudProvider::kOneDrive && - FileIsOnODFS(profile_, file_urls_.front())) { + UrlIsOnODFS(profile_, file_urls_.front())) { // The files are on OneDrive already, selected from ODFS. OpenODFSUrls(); } else if (cloud_provider_ == CloudProvider::kOneDrive && - FileIsOnAndroidOneDrive(profile_, file_urls_.front())) { + UrlIsOnAndroidOneDrive(profile_, file_urls_.front())) { // The files are on OneDrive already, selected from Android OneDrive. OpenAndroidOneDriveUrlsIfAccountMatchedODFS(); } else { @@ -411,7 +396,22 @@ CloudUploadDialog::IsOfficeWebAppInstalled(profile)); } -bool FileIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url) { +bool UrlIsOnODFS(Profile* profile, const FileSystemURL& url) { + ash::file_system_provider::util::FileSystemURLParser parser(url); + if (!parser.Parse()) { + return false; + } + + file_system_provider::ProviderId provider_id = + file_system_provider::ProviderId::CreateFromExtensionId( + file_manager::file_tasks::GetODFSExtensionId(profile)); + if (parser.file_system()->GetFileSystemInfo().provider_id() != provider_id) { + return false; + } + return true; +} + +bool UrlIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url) { std::string authority; std::string root_document_id; base::FilePath path; @@ -476,7 +476,7 @@ absl::optional<ODFSFileSystemAndPath> AndroidOneDriveUrlToODFS( Profile* profile, const FileSystemURL& android_onedrive_file_url) { - if (!FileIsOnAndroidOneDrive(profile, android_onedrive_file_url)) { + if (!UrlIsOnAndroidOneDrive(profile, android_onedrive_file_url)) { LOG(ERROR) << "File not on Android OneDrive"; return absl::nullopt; }
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h index e90ee76..aa142bc 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h
@@ -200,8 +200,11 @@ // is not mounted or the Office PWA is not installed. Returns False otherwise. bool ShouldFixUpOffice(Profile* profile, const CloudProvider cloud_provider); -// Returns True if the file is on the Android OneDrive DocumentsProvider. -bool FileIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url); +// Returns True if the url is on ODFS. +bool UrlIsOnODFS(Profile* profile, const FileSystemURL& url); + +// Returns True if the url is on the Android OneDrive DocumentsProvider. +bool UrlIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url); // Return the email from the Root Document Id of the Android OneDrive // DocumentsProvider.
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index 8b0b3c5..e466411 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -61,8 +61,6 @@ "externally_managed_app_install_task.h", "externally_managed_app_manager.cc", "externally_managed_app_manager.h", - "externally_managed_app_manager_impl.cc", - "externally_managed_app_manager_impl.h", "externally_managed_app_registration_task.cc", "externally_managed_app_registration_task.h", "file_utils_wrapper.cc", @@ -794,7 +792,7 @@ "commands/install_preloaded_verified_app_command_browsertest.cc", "commands/update_protocol_handler_approval_command_browsertest.cc", "externally_installed_web_app_prefs_browsertest.cc", - "externally_managed_app_manager_impl_browsertest.cc", + "externally_managed_app_manager_browsertest.cc", "isolated_web_apps/get_isolated_web_app_browsing_data_command_browsertest.cc", "isolated_web_apps/install_isolated_web_app_from_command_line_browsertest.cc", "isolated_web_apps/isolated_web_app_browsertest.cc",
diff --git a/chrome/browser/web_applications/commands/callback_command.h b/chrome/browser/web_applications/commands/callback_command.h index 0d506ce..9ef5e95 100644 --- a/chrome/browser/web_applications/commands/callback_command.h +++ b/chrome/browser/web_applications/commands/callback_command.h
@@ -35,7 +35,6 @@ void StartWithLock(std::unique_ptr<LockType> lock) override; const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void OnSyncSourceRemoved() override {} void OnShutdown() override {} private:
diff --git a/chrome/browser/web_applications/commands/externally_managed_install_command.cc b/chrome/browser/web_applications/commands/externally_managed_install_command.cc index f7cf2599c..53ee33a 100644 --- a/chrome/browser/web_applications/commands/externally_managed_install_command.cc +++ b/chrome/browser/web_applications/commands/externally_managed_install_command.cc
@@ -89,8 +89,6 @@ weak_factory_.GetWeakPtr())); } -void ExternallyManagedInstallCommand::OnSyncSourceRemoved() {} - void ExternallyManagedInstallCommand::OnShutdown() { Abort(webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); }
diff --git a/chrome/browser/web_applications/commands/externally_managed_install_command.h b/chrome/browser/web_applications/commands/externally_managed_install_command.h index 1e7e57a..79725a8 100644 --- a/chrome/browser/web_applications/commands/externally_managed_install_command.h +++ b/chrome/browser/web_applications/commands/externally_managed_install_command.h
@@ -62,7 +62,6 @@ // WebAppCommandTemplate<NoopLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<NoopLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.cc b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.cc index afcd330..0f58fea 100644 --- a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.cc +++ b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.cc
@@ -72,11 +72,6 @@ weak_factory_.GetWeakPtr())); } -void FetchInstallabilityForChromeManagement::OnSyncSourceRemoved() { - // No action needed. Any changes to installation status will correctly be read - // & reflected in the command result. -} - void FetchInstallabilityForChromeManagement::OnShutdown() { Abort(InstallableCheckResult::kNotInstallable); }
diff --git a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.h b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.h index a06d4d62..c39b30e 100644 --- a/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.h +++ b/chrome/browser/web_applications/commands/fetch_installability_for_chrome_management.h
@@ -56,7 +56,6 @@ // WebAppCommandTemplate<NoopLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<NoopLock>) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc index 7e634e01..cb9f274c 100644 --- a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc +++ b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc
@@ -195,8 +195,6 @@ } } -void FetchManifestAndInstallCommand::OnSyncSourceRemoved() {} - void FetchManifestAndInstallCommand::OnShutdown() { Abort(webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); }
diff --git a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.h b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.h index 05886724..555396b 100644 --- a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.h +++ b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.h
@@ -57,7 +57,6 @@ // WebAppCommandTemplate<NoopLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<NoopLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; content::WebContents* GetInstallingWebContents() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/install_app_locally_command.cc b/chrome/browser/web_applications/commands/install_app_locally_command.cc index 19afea4..dff1f7c 100644 --- a/chrome/browser/web_applications/commands/install_app_locally_command.cc +++ b/chrome/browser/web_applications/commands/install_app_locally_command.cc
@@ -128,8 +128,6 @@ ReportResultAndShutdown(CommandResult::kSuccess); } -void InstallAppLocallyCommand::OnSyncSourceRemoved() {} - void InstallAppLocallyCommand::OnShutdown() { ReportResultAndShutdown(CommandResult::kShutdown); }
diff --git a/chrome/browser/web_applications/commands/install_app_locally_command.h b/chrome/browser/web_applications/commands/install_app_locally_command.h index 85048b1..4dccc38 100644 --- a/chrome/browser/web_applications/commands/install_app_locally_command.h +++ b/chrome/browser/web_applications/commands/install_app_locally_command.h
@@ -29,7 +29,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<AppLock> app_lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/install_from_info_command.cc b/chrome/browser/web_applications/commands/install_from_info_command.cc index 8c43b897..1052f94 100644 --- a/chrome/browser/web_applications/commands/install_from_info_command.cc +++ b/chrome/browser/web_applications/commands/install_from_info_command.cc
@@ -198,8 +198,6 @@ did_uninstall_and_replace)); } -void InstallFromInfoCommand::OnSyncSourceRemoved() {} - void InstallFromInfoCommand::OnShutdown() { Abort(webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); return;
diff --git a/chrome/browser/web_applications/commands/install_from_info_command.h b/chrome/browser/web_applications/commands/install_from_info_command.h index 0573be9..a2a7967 100644 --- a/chrome/browser/web_applications/commands/install_from_info_command.h +++ b/chrome/browser/web_applications/commands/install_from_info_command.h
@@ -78,7 +78,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<AppLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/install_from_sync_command.cc b/chrome/browser/web_applications/commands/install_from_sync_command.cc index efea58b..875c1f8 100644 --- a/chrome/browser/web_applications/commands/install_from_sync_command.cc +++ b/chrome/browser/web_applications/commands/install_from_sync_command.cc
@@ -128,13 +128,6 @@ webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); } -void InstallFromSyncCommand::OnSyncSourceRemoved() { - // Since this is a sync install command, if an uninstall is queued, just - // cancel this command. - ReportResultAndDestroy(params_.app_id, - webapps::InstallResultCode::kHaltedBySyncUninstall); -} - const LockDescription& InstallFromSyncCommand::lock_description() const { return *lock_description_; }
diff --git a/chrome/browser/web_applications/commands/install_from_sync_command.h b/chrome/browser/web_applications/commands/install_from_sync_command.h index e3447706..39709fd7 100644 --- a/chrome/browser/web_applications/commands/install_from_sync_command.h +++ b/chrome/browser/web_applications/commands/install_from_sync_command.h
@@ -72,7 +72,6 @@ // WebAppCommandTemplate<SharedWebContentsWithAppLock>: const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void OnSyncSourceRemoved() override; void OnShutdown() override; void StartWithLock( std::unique_ptr<SharedWebContentsWithAppLock> lock) override;
diff --git a/chrome/browser/web_applications/commands/install_from_sync_command_unittest.cc b/chrome/browser/web_applications/commands/install_from_sync_command_unittest.cc index c9a93eb7..1a295179 100644 --- a/chrome/browser/web_applications/commands/install_from_sync_command_unittest.cc +++ b/chrome/browser/web_applications/commands/install_from_sync_command_unittest.cc
@@ -728,51 +728,5 @@ loop.Run(); } -TEST_F(InstallFromSyncTest, SyncUninstall) { - auto data_retriever = - std::make_unique<testing::StrictMock<MockDataRetriever>>(); - - command_manager_url_loader().AddPrepareForLoadResults( - {WebAppUrlLoader::Result::kUrlLoaded}); - url_loader().SetNextLoadUrlResult(kWebAppUrl, - WebAppUrlLoader::Result::kUrlLoaded); - - base::RunLoop loop; - WebAppDataRetriever::GetWebAppInstallInfoCallback callback; - EXPECT_CALL(*data_retriever, - GetWebAppInstallInfo(testing::_, base::test::IsNotNullCallback())) - .WillOnce( - [&](content::WebContents* web_contents, - WebAppDataRetriever::GetWebAppInstallInfoCallback arg_callback) { - callback = std::move(arg_callback); - loop.Quit(); - }); - - const AppId app_id = GenerateAppId(/*manifest_id=*/absl::nullopt, kWebAppUrl); - bool result_populated = false; - InstallResult result; - auto command = - CreateCommand(std::move(data_retriever), CreateParams(app_id, kWebAppUrl), - base::BindLambdaForTesting( - [&](const AppId& id, webapps::InstallResultCode code) { - result_populated = true; - result.installed_app_id = id; - result.install_code = code; - })); - command_manager().ScheduleCommand(std::move(command)); - loop.Run(); - command_manager().NotifySyncSourceRemoved({app_id}); - - // Running this should do nothing. - ASSERT_FALSE(callback.is_null()); - std::move(callback).Run(CreateSiteInstallInfo()); - - ASSERT_TRUE(result_populated); - EXPECT_EQ(webapps::InstallResultCode::kHaltedBySyncUninstall, - result.install_code); - EXPECT_EQ(result.installed_app_id, app_id); - EXPECT_FALSE(registrar().IsInstalled(app_id)); -} - } // namespace } // namespace web_app
diff --git a/chrome/browser/web_applications/commands/install_placeholder_command.cc b/chrome/browser/web_applications/commands/install_placeholder_command.cc index 0b269670..48ef282a 100644 --- a/chrome/browser/web_applications/commands/install_placeholder_command.cc +++ b/chrome/browser/web_applications/commands/install_placeholder_command.cc
@@ -70,8 +70,6 @@ return base::Value(debug_value_.Clone()); } -void InstallPlaceholderCommand::OnSyncSourceRemoved() {} - void InstallPlaceholderCommand::OnShutdown() { Abort(webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); }
diff --git a/chrome/browser/web_applications/commands/install_placeholder_command.h b/chrome/browser/web_applications/commands/install_placeholder_command.h index 5a0407ce..7b53089 100644 --- a/chrome/browser/web_applications/commands/install_placeholder_command.h +++ b/chrome/browser/web_applications/commands/install_placeholder_command.h
@@ -50,7 +50,6 @@ void StartWithLock(std::unique_ptr<AppLock> lock) override; const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void OnSyncSourceRemoved() override; void OnShutdown() override; private:
diff --git a/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.cc b/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.cc index 81d6d971..8b6c576 100644 --- a/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.cc +++ b/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.cc
@@ -124,8 +124,6 @@ webapps::InstallResultCode::kCancelledOnWebAppProviderShuttingDown); } -void InstallPreloadedVerifiedAppCommand::OnSyncSourceRemoved() {} - void InstallPreloadedVerifiedAppCommand::OnManifestParsed( blink::mojom::ManifestPtr manifest) { // Note that most errors during parsing (e.g. errors to do with parsing a
diff --git a/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.h b/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.h index 8250770..c81ebce 100644 --- a/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.h +++ b/chrome/browser/web_applications/commands/install_preloaded_verified_app_command.h
@@ -76,7 +76,6 @@ // WebAppCommandTemplate<SharedWebContentsLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<SharedWebContentsLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/manifest_update_check_command.h b/chrome/browser/web_applications/commands/manifest_update_check_command.h index 98c88b0..a70380a 100644 --- a/chrome/browser/web_applications/commands/manifest_update_check_command.h +++ b/chrome/browser/web_applications/commands/manifest_update_check_command.h
@@ -65,7 +65,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; - void OnSyncSourceRemoved() override {} void OnShutdown() override; base::Value ToDebugValue() const override; void StartWithLock(std::unique_ptr<AppLock> lock) override;
diff --git a/chrome/browser/web_applications/commands/manifest_update_finalize_command.h b/chrome/browser/web_applications/commands/manifest_update_finalize_command.h index 43f8854..5bbacbf 100644 --- a/chrome/browser/web_applications/commands/manifest_update_finalize_command.h +++ b/chrome/browser/web_applications/commands/manifest_update_finalize_command.h
@@ -47,7 +47,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; - void OnSyncSourceRemoved() override {} void OnShutdown() override; base::Value ToDebugValue() const override; void StartWithLock(std::unique_ptr<AppLock> lock) override;
diff --git a/chrome/browser/web_applications/commands/os_integration_synchronize_command.cc b/chrome/browser/web_applications/commands/os_integration_synchronize_command.cc index dbed066..6b6410ea 100644 --- a/chrome/browser/web_applications/commands/os_integration_synchronize_command.cc +++ b/chrome/browser/web_applications/commands/os_integration_synchronize_command.cc
@@ -51,8 +51,6 @@ std::move(synchronize_callback_)); } -void OsIntegrationSynchronizeCommand::OnSyncSourceRemoved() {} - void OsIntegrationSynchronizeCommand::OnShutdown() { DCHECK(!synchronize_callback_.is_null()); SignalCompletionAndSelfDestruct(CommandResult::kShutdown,
diff --git a/chrome/browser/web_applications/commands/os_integration_synchronize_command.h b/chrome/browser/web_applications/commands/os_integration_synchronize_command.h index c6b5f81f..f914a09 100644 --- a/chrome/browser/web_applications/commands/os_integration_synchronize_command.h +++ b/chrome/browser/web_applications/commands/os_integration_synchronize_command.h
@@ -32,7 +32,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<AppLock> app_lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/run_on_os_login_command.h b/chrome/browser/web_applications/commands/run_on_os_login_command.h index 9702953..a40ecfb 100644 --- a/chrome/browser/web_applications/commands/run_on_os_login_command.h +++ b/chrome/browser/web_applications/commands/run_on_os_login_command.h
@@ -54,7 +54,6 @@ // WebAppCommandTemplate<AppLock>: const LockDescription& lock_description() const override; void StartWithLock(std::unique_ptr<AppLock> lock) override; - void OnSyncSourceRemoved() override {} void OnShutdown() override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/commands/sub_app_install_command.h b/chrome/browser/web_applications/commands/sub_app_install_command.h index ae6c547..22e6f06d5 100644 --- a/chrome/browser/web_applications/commands/sub_app_install_command.h +++ b/chrome/browser/web_applications/commands/sub_app_install_command.h
@@ -64,7 +64,6 @@ // WebAppCommandTemplate<SharedWebContentsWithAppLock>: void StartWithLock( std::unique_ptr<SharedWebContentsWithAppLock> lock) override; - void OnSyncSourceRemoved() override {} void OnShutdown() override; private:
diff --git a/chrome/browser/web_applications/commands/update_file_handler_command.h b/chrome/browser/web_applications/commands/update_file_handler_command.h index 558e3961..78f37f3 100644 --- a/chrome/browser/web_applications/commands/update_file_handler_command.h +++ b/chrome/browser/web_applications/commands/update_file_handler_command.h
@@ -35,7 +35,6 @@ void StartWithLock(std::unique_ptr<AppLock> lock) override; const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void OnSyncSourceRemoved() override {} void OnShutdown() override; private:
diff --git a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc index 5fc5ab8..c8abba6 100644 --- a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc +++ b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc
@@ -145,8 +145,6 @@ std::move(callback_)); } -void UpdateProtocolHandlerApprovalCommand::OnSyncSourceRemoved() {} - void UpdateProtocolHandlerApprovalCommand::OnShutdown() { SignalCompletionAndSelfDestruct(CommandResult::kShutdown, std::move(callback_));
diff --git a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.h b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.h index cceced0..f2a6e68 100644 --- a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.h +++ b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.h
@@ -38,7 +38,6 @@ void StartWithLock(std::unique_ptr<AppLock> lock) override; const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void OnSyncSourceRemoved() override; void OnShutdown() override; private:
diff --git a/chrome/browser/web_applications/commands/web_app_command.h b/chrome/browser/web_applications/commands/web_app_command.h index 3a179671..e3a6a85 100644 --- a/chrome/browser/web_applications/commands/web_app_command.h +++ b/chrome/browser/web_applications/commands/web_app_command.h
@@ -123,14 +123,6 @@ LockAcquiredCallback on_lock_acquired, const base::Location& location) = 0; - // This is called when the sync system has triggered an uninstall for an app - // id that is relevant to this command and this command is running - // (`StartWithLock()` has been called). Relevance is determined by the - // `WebAppCommandLock::IsAppLocked()` function for this command's lock). The - // web app should still be in the registry, but it will no longer have the - // `WebAppManagement::kSync` source and `is_uninstalling()` will return true. - virtual void OnSyncSourceRemoved() = 0; - // Signals the system is shutting down. Used to cancel any pending operations, // if possible, to prevent re-entry. Only called if the command has been // started.
diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc index e6f06de..e275d6acc 100644 --- a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc +++ b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc
@@ -142,12 +142,6 @@ MaybeFinishUninstallAndDestruct(); } -void WebAppUninstallCommand::OnSyncSourceRemoved() { - // TODO(crbug.com/1320086): remove after uninstall from sync is async. - Abort(webapps::UninstallResultCode::kNoAppToUninstall); - return; -} - void WebAppUninstallCommand::OnShutdown() { Abort(webapps::UninstallResultCode::kError); return;
diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command.h b/chrome/browser/web_applications/commands/web_app_uninstall_command.h index f8da1fa2..fba3159 100644 --- a/chrome/browser/web_applications/commands/web_app_uninstall_command.h +++ b/chrome/browser/web_applications/commands/web_app_uninstall_command.h
@@ -76,7 +76,6 @@ // WebAppCommandTemplate<AllAppsLock>: void StartWithLock(std::unique_ptr<AllAppsLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; const LockDescription& lock_description() const override; base::Value ToDebugValue() const override;
diff --git a/chrome/browser/web_applications/extensions/web_app_uninstall_and_replace_job_unittest.cc b/chrome/browser/web_applications/extensions/web_app_uninstall_and_replace_job_unittest.cc index 40cb246..1e7a895 100644 --- a/chrome/browser/web_applications/extensions/web_app_uninstall_and_replace_job_unittest.cc +++ b/chrome/browser/web_applications/extensions/web_app_uninstall_and_replace_job_unittest.cc
@@ -63,7 +63,6 @@ base::Value ToDebugValue() const override { return base::Value(); } - void OnSyncSourceRemoved() override {} void OnShutdown() override {} private:
diff --git a/chrome/browser/web_applications/externally_managed_app_manager.cc b/chrome/browser/web_applications/externally_managed_app_manager.cc index bee1e1e..fd22025 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager.cc
@@ -12,6 +12,7 @@ #include "base/check_is_test.h" #include "base/containers/contains.h" +#include "base/feature_list.h" #include "base/functional/callback_helpers.h" #include "base/ranges/algorithm.h" #include "base/stl_util.h" @@ -19,13 +20,20 @@ #include "base/task/single_thread_task_runner.h" #include "base/values.h" #include "build/chromeos_buildflags.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/web_applications/externally_managed_app_install_task.h" +#include "chrome/browser/web_applications/externally_managed_app_registration_task.h" #include "chrome/browser/web_applications/locks/all_apps_lock.h" #include "chrome/browser/web_applications/web_app_command_scheduler.h" #include "chrome/browser/web_applications/web_app_install_utils.h" #include "chrome/browser/web_applications/web_app_registrar.h" +#include "chrome/browser/web_applications/web_app_registry_update.h" #include "chrome/browser/web_applications/web_contents/web_app_data_retriever.h" #include "chrome/browser/web_applications/web_contents/web_app_url_loader.h" +#include "chrome/common/chrome_features.h" #include "components/webapps/browser/install_result_code.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/url_constants.h" #if BUILDFLAG(IS_CHROMEOS) #include "base/containers/cxx20_erase.h" @@ -73,9 +81,26 @@ ExternallyManagedAppManager::SynchronizeRequest::SynchronizeRequest( SynchronizeRequest&& other) = default; -ExternallyManagedAppManager::ExternallyManagedAppManager() = default; +struct ExternallyManagedAppManager::TaskAndCallback { + TaskAndCallback(std::unique_ptr<ExternallyManagedAppInstallTask> task, + OnceInstallCallback callback) + : task(std::move(task)), callback(std::move(callback)) {} + ~TaskAndCallback() = default; + + std::unique_ptr<ExternallyManagedAppInstallTask> task; + OnceInstallCallback callback; +}; + +ExternallyManagedAppManager::ExternallyManagedAppManager(Profile* profile) + : profile_(profile), url_loader_(std::make_unique<WebAppUrlLoader>()) {} + ExternallyManagedAppManager::~ExternallyManagedAppManager() { DCHECK(!registration_callback_); + // Extra check to verify that web_contents is released even if + // shutdown somehow has not been invoked. + if (!IsShuttingDown()) { + Shutdown(); + } } void ExternallyManagedAppManager::SetSubsystems( @@ -87,6 +112,53 @@ command_scheduler_ = command_scheduler; } +void ExternallyManagedAppManager::InstallNow( + ExternalInstallOptions install_options, + OnceInstallCallback callback) { + pending_installs_.push_front(std::make_unique<TaskAndCallback>( + CreateInstallationTask(std::move(install_options)), std::move(callback))); + + PostMaybeStartNext(); +} + +void ExternallyManagedAppManager::Install( + ExternalInstallOptions install_options, + OnceInstallCallback callback) { + pending_installs_.push_back(std::make_unique<TaskAndCallback>( + CreateInstallationTask(std::move(install_options)), std::move(callback))); + + PostMaybeStartNext(); +} + +void ExternallyManagedAppManager::InstallApps( + std::vector<ExternalInstallOptions> install_options_list, + const RepeatingInstallCallback& callback) { + for (auto& install_options : install_options_list) { + pending_installs_.push_back(std::make_unique<TaskAndCallback>( + CreateInstallationTask(std::move(install_options)), callback)); + } + + PostMaybeStartNext(); +} + +void ExternallyManagedAppManager::UninstallApps( + std::vector<GURL> uninstall_urls, + ExternalInstallSource install_source, + const UninstallCallback& callback) { + for (auto& url : uninstall_urls) { + finalizer()->UninstallExternalWebAppByUrl( + url, ConvertExternalInstallSourceToSource(install_source), + ConvertExternalInstallSourceToUninstallSource(install_source), + base::BindOnce( + [](const UninstallCallback& callback, const GURL& app_url, + webapps::UninstallResultCode code) { + callback.Run(app_url, + code == webapps::UninstallResultCode::kSuccess); + }, + callback, url)); + } +} + void ExternallyManagedAppManager::SynchronizeInstalledApps( std::vector<ExternalInstallOptions> desired_apps_install_options, ExternalInstallSource install_source, @@ -109,6 +181,300 @@ std::move(callback))); } +void ExternallyManagedAppManager::Shutdown() { + is_in_shutdown_ = true; + pending_registrations_.clear(); + current_registration_.reset(); + pending_installs_.clear(); + url_loader_.reset(); + // `current_install_` keeps a pointer to `web_contents_` so destroy it before + // releasing the WebContents. + current_install_.reset(); + ReleaseWebContents(); +} + +void ExternallyManagedAppManager::SetUrlLoaderForTesting( + std::unique_ptr<WebAppUrlLoader> url_loader) { + CHECK_IS_TEST(); + url_loader_ = std::move(url_loader); +} + +void ExternallyManagedAppManager::SetDataRetrieverFactoryForTesting( + base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> factory) { + CHECK_IS_TEST(); + data_retriever_factory_for_testing_ = std::move(factory); +} + +void ExternallyManagedAppManager::ReleaseWebContents() { + DCHECK(pending_registrations_.empty()); + DCHECK(!current_registration_); + DCHECK(pending_installs_.empty()); + DCHECK(!current_install_); + + web_contents_.reset(); +} + +std::unique_ptr<ExternallyManagedAppInstallTask> +ExternallyManagedAppManager::CreateInstallationTask( + ExternalInstallOptions install_options) { + std::unique_ptr<ExternallyManagedAppInstallTask> install_task = + std::make_unique<ExternallyManagedAppInstallTask>( + profile_, url_loader_.get(), ui_manager(), finalizer(), + command_scheduler(), std::move(install_options)); + if (data_retriever_factory_for_testing_) { + CHECK_IS_TEST(); + install_task->SetDataRetrieverFactoryForTesting( // IN-TEST + data_retriever_factory_for_testing_); + } + return install_task; +} + +std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> +ExternallyManagedAppManager::StartRegistration(GURL install_url) { + DCHECK(!IsShuttingDown()); + ExternallyManagedAppRegistrationTask::RegistrationCallback callback = + base::BindOnce(&ExternallyManagedAppManager::OnRegistrationFinished, + weak_ptr_factory_.GetWeakPtr(), install_url); + return std::make_unique<ExternallyManagedAppRegistrationTask>( + std::move(install_url), url_loader_.get(), web_contents_.get(), + std::move(callback)); +} + +void ExternallyManagedAppManager::OnRegistrationFinished( + const GURL& install_url, + RegistrationResultCode result) { + DCHECK_EQ(current_registration_->install_url(), install_url); + + if (registration_callback_) { + registration_callback_.Run(install_url, result); + } + + current_registration_.reset(); + PostMaybeStartNext(); +} + +void ExternallyManagedAppManager::PostMaybeStartNext() { + base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(&ExternallyManagedAppManager::MaybeStartNext, + weak_ptr_factory_.GetWeakPtr())); +} + +void ExternallyManagedAppManager::MaybeStartNext() { + if (current_install_ || IsShuttingDown()) { + return; + } + command_scheduler()->ScheduleCallbackWithLock<AllAppsLock>( + "ExternallyManagedAppManager::MaybeStartNext", + std::make_unique<AllAppsLockDescription>(), + base::BindOnce(&ExternallyManagedAppManager::MaybeStartNextOnLockAcquired, + weak_ptr_factory_.GetWeakPtr())); +} + +void ExternallyManagedAppManager::MaybeStartNextOnLockAcquired( + AllAppsLock& lock) { + if (current_install_ || IsShuttingDown()) { + return; + } + + while (!pending_installs_.empty()) { + std::unique_ptr<TaskAndCallback> front = + std::move(pending_installs_.front()); + pending_installs_.pop_front(); + + const ExternalInstallOptions& install_options = + front->task->install_options(); + + if (install_options.force_reinstall) { + StartInstallationTask(std::move(front)); + return; + } + + absl::optional<AppId> app_id = + lock.registrar().LookupExternalAppId(install_options.install_url); + + // If the URL is not in web_app registrar, + // then no external source has installed it. + if (!app_id.has_value()) { + StartInstallationTask(std::move(front)); + return; + } + + if (lock.registrar().IsInstalled(app_id.value())) { + if (install_options.wait_for_windows_closed && + lock.ui_manager().GetNumWindowsForApp(app_id.value()) != 0) { + lock.ui_manager().NotifyOnAllAppWindowsClosed( + app_id.value(), + base::BindOnce(&ExternallyManagedAppManager::Install, + weak_ptr_factory_.GetWeakPtr(), install_options, + std::move(front->callback))); + continue; + } + + // If the app is already installed, only reinstall it if the app is a + // placeholder app and the client asked for it to be reinstalled. + if (install_options.reinstall_placeholder && + lock.registrar().IsPlaceholderApp( + app_id.value(), ConvertExternalInstallSourceToSource( + install_options.install_source))) { + StartInstallationTask(std::move(front)); + return; + } + + // TODO(crbug.com/1300321): Investigate re-install of the app for all + // WebAppManagement sources. + if ((ConvertExternalInstallSourceToSource( + install_options.install_source) == WebAppManagement::kPolicy) && + (!lock.registrar() + .GetAppById(app_id.value()) + ->IsPolicyInstalledApp())) { + StartInstallationTask(std::move(front)); + return; + } else { + // Add install source before returning the result. + ScopedRegistryUpdate update(&lock.sync_bridge()); + WebApp* app_to_update = update->UpdateApp(app_id.value()); + app_to_update->AddSource(ConvertExternalInstallSourceToSource( + install_options.install_source)); + app_to_update->AddInstallURLToManagementExternalConfigMap( + ConvertExternalInstallSourceToSource( + install_options.install_source), + install_options.install_url); + } + std::move(front->callback) + .Run(install_options.install_url, + ExternallyManagedAppManager::InstallResult( + webapps::InstallResultCode::kSuccessAlreadyInstalled, + app_id)); + continue; + } + + // If neither of the above conditions applies, the app probably got + // uninstalled but it wasn't been removed from the map. We should install + // the app in this case. + StartInstallationTask(std::move(front)); + return; + } + DCHECK(!current_install_); + + if (current_registration_ || RunNextRegistration()) { + return; + } + + ReleaseWebContents(); +} + +void ExternallyManagedAppManager::StartInstallationTask( + std::unique_ptr<TaskAndCallback> task) { + if (IsShuttingDown()) { + return; + } + DCHECK(!current_install_); + DCHECK(!is_in_shutdown_); + if (current_registration_) { + // Preempt current registration. + pending_registrations_.push_front(current_registration_->install_url()); + current_registration_.reset(); + } + + current_install_ = std::move(task); + CreateWebContentsIfNecessary(); + current_install_->task->Install( + web_contents_.get(), + base::BindOnce(&ExternallyManagedAppManager::OnInstalled, + weak_ptr_factory_.GetWeakPtr())); +} + +bool ExternallyManagedAppManager::RunNextRegistration() { + if (pending_registrations_.empty() || IsShuttingDown()) { + if (registrations_complete_callback_) { + std::move(registrations_complete_callback_).Run(); + } + return false; + } + + GURL url_to_check = std::move(pending_registrations_.front()); + pending_registrations_.pop_front(); + current_registration_ = StartRegistration(std::move(url_to_check)); + return true; +} + +void ExternallyManagedAppManager::CreateWebContentsIfNecessary() { + DCHECK(!IsShuttingDown()); + if (web_contents_) { + return; + } + + web_contents_ = content::WebContents::Create( + content::WebContents::CreateParams(profile_)); + CreateWebAppInstallTabHelpers(web_contents_.get()); +} + +void ExternallyManagedAppManager::OnInstalled( + ExternallyManagedAppManager::InstallResult result) { + if (result.app_id && IsSuccess(result.code)) { + MaybeEnqueueServiceWorkerRegistration( + current_install_->task->install_options()); + } + + // Post a task to avoid webapps::InstallableManager crashing and do so before + // running the callback in case the callback tries to install another + // app. + PostMaybeStartNext(); + + std::unique_ptr<TaskAndCallback> task_and_callback; + task_and_callback.swap(current_install_); + std::move(task_and_callback->callback) + .Run(task_and_callback->task->install_options().install_url, result); +} + +void ExternallyManagedAppManager::MaybeEnqueueServiceWorkerRegistration( + const ExternalInstallOptions& install_options) { + if (!base::FeatureList::IsEnabled( + features::kDesktopPWAsCacheDuringDefaultInstall)) { + return; + } + + if (IsShuttingDown()) { + return; + } + + if (install_options.only_use_app_info_factory) { + return; + } + + if (!install_options.load_and_await_service_worker_registration) { + return; + } + + // TODO(crbug.com/809304): Call CreateWebContentsIfNecessary() instead of + // checking web_contents_ once major migration of default hosted apps to web + // apps has completed. + // Temporarily using offline manifest migrations (in which |web_contents_| + // is nullptr) in order to avoid overwhelming migrated-to web apps with hits + // for service worker registrations. + if (!web_contents_) { + return; + } + + GURL url = install_options.service_worker_registration_url.value_or( + install_options.install_url); + if (url.is_empty()) { + return; + } + if (url.scheme() == content::kChromeUIScheme) { + return; + } + if (url.scheme() == content::kChromeUIUntrustedScheme) { + return; + } + + pending_registrations_.push_back(url); +} + +bool ExternallyManagedAppManager::IsShuttingDown() { + return is_in_shutdown_ || profile()->ShutdownStarted(); +} + void ExternallyManagedAppManager::SynchronizeInstalledAppsOnLockAcquired( std::vector<ExternalInstallOptions> desired_apps_install_options, ExternalInstallSource install_source, @@ -203,13 +569,6 @@ registrations_complete_callback_ = std::move(callback); } -void ExternallyManagedAppManager::OnRegistrationFinished( - const GURL& install_url, - RegistrationResultCode result) { - if (registration_callback_) - registration_callback_.Run(install_url, result); -} - void ExternallyManagedAppManager::InstallForSynchronizeCallback( ExternalInstallSource source, const GURL& install_url,
diff --git a/chrome/browser/web_applications/externally_managed_app_manager.h b/chrome/browser/web_applications/externally_managed_app_manager.h index 967f416..98168c2 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager.h +++ b/chrome/browser/web_applications/externally_managed_app_manager.h
@@ -18,16 +18,27 @@ #include "chrome/browser/web_applications/web_app_id.h" #include "url/gurl.h" +class GURL; +class Profile; + namespace webapps { enum class InstallResultCode; } +namespace content { +class WebContents; +} // namespace content + namespace web_app { class AllAppsLock; +class ExternallyManagedAppInstallTask; class WebAppInstallFinalizer; class WebAppCommandScheduler; class WebAppUiManager; +class ExternallyManagedAppRegistrationTaskBase; +class WebAppUrlLoader; +class WebAppDataRetriever; enum class RegistrationResultCode { kSuccess, kAlreadyRegistered, kTimeout }; @@ -84,7 +95,7 @@ std::map<GURL /*install_url*/, InstallResult> install_results, std::map<GURL /*install_url*/, bool /*succeeded*/> uninstall_results)>; - ExternallyManagedAppManager(); + explicit ExternallyManagedAppManager(Profile* profile); ExternallyManagedAppManager(const ExternallyManagedAppManager&) = delete; ExternallyManagedAppManager& operator=(const ExternallyManagedAppManager&) = delete; @@ -103,7 +114,7 @@ // Fails if the same operation has been queued before. Should only be used in // response to a user action e.g. the user clicked an install button. virtual void InstallNow(ExternalInstallOptions install_options, - OnceInstallCallback callback) = 0; + OnceInstallCallback callback); // Queues an installation operation the end of current tasks. Runs its // callback with the URL in |install_options| and with the id of the installed @@ -111,7 +122,7 @@ // // Fails if the same operation has been queued before. virtual void Install(ExternalInstallOptions install_options, - OnceInstallCallback callback) = 0; + OnceInstallCallback callback); // Adds a task to the queue of operations for each ExternalInstallOptions in // |install_options_list|. Runs |callback| with the URL of the corresponding @@ -121,7 +132,7 @@ // succeeded. virtual void InstallApps( std::vector<ExternalInstallOptions> install_options_list, - const RepeatingInstallCallback& callback) = 0; + const RepeatingInstallCallback& callback); // Adds a task to the queue of operations for each GURL in // |uninstall_urls|. Runs |callback| with the URL of the corresponding @@ -130,7 +141,7 @@ // whether or not the uninstallation actually succeeded. virtual void UninstallApps(std::vector<GURL> uninstall_urls, ExternalInstallSource install_source, - const UninstallCallback& callback) = 0; + const UninstallCallback& callback); // Installs an app for each ExternalInstallOptions in // |desired_apps_install_options| and uninstalls any apps in @@ -155,19 +166,33 @@ void SetRegistrationsCompleteCallbackForTesting(base::OnceClosure callback); void ClearSynchronizeRequestsForTesting(); - virtual void Shutdown() = 0; + void Shutdown(); + + void SetUrlLoaderForTesting(std::unique_ptr<WebAppUrlLoader> url_loader); + void SetDataRetrieverFactoryForTesting( + base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> factory); protected: WebAppUiManager* ui_manager() { return ui_manager_; } WebAppInstallFinalizer* finalizer() { return finalizer_; } WebAppCommandScheduler* command_scheduler() { return command_scheduler_; } + virtual void ReleaseWebContents(); + + virtual std::unique_ptr<ExternallyManagedAppInstallTask> + CreateInstallationTask(ExternalInstallOptions install_options); + + virtual std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> + StartRegistration(GURL launch_url); + virtual void OnRegistrationFinished(const GURL& launch_url, RegistrationResultCode result); - base::OnceClosure registrations_complete_callback_; + Profile* profile() { return profile_; } private: + struct TaskAndCallback; + struct SynchronizeRequest { SynchronizeRequest(SynchronizeCallback callback, std::vector<ExternalInstallOptions> pending_installs, @@ -202,14 +227,55 @@ bool succeeded); void ContinueOrCompleteSynchronization(ExternalInstallSource source); + void PostMaybeStartNext(); + + void MaybeStartNext(); + void MaybeStartNextOnLockAcquired(AllAppsLock& lock); + + void StartInstallationTask(std::unique_ptr<TaskAndCallback> task); + + bool RunNextRegistration(); + + void CreateWebContentsIfNecessary(); + + void OnInstalled(ExternallyManagedAppManager::InstallResult result); + + void MaybeEnqueueServiceWorkerRegistration( + const ExternalInstallOptions& install_options); + + bool IsShuttingDown(); + + base::OnceClosure registrations_complete_callback_; + raw_ptr<WebAppUiManager, DanglingUntriaged> ui_manager_ = nullptr; raw_ptr<WebAppInstallFinalizer> finalizer_ = nullptr; raw_ptr<WebAppCommandScheduler, DanglingUntriaged> command_scheduler_ = nullptr; + const raw_ptr<Profile> profile_; + + bool is_in_shutdown_ = false; + base::flat_map<ExternalInstallSource, SynchronizeRequest> synchronize_requests_; + // unique_ptr so that it can be replaced in tests. + std::unique_ptr<WebAppUrlLoader> url_loader_; + // Allows tests to set the data retriever for install tasks. + base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> + data_retriever_factory_for_testing_; + + std::unique_ptr<content::WebContents> web_contents_; + + std::unique_ptr<TaskAndCallback> current_install_; + + base::circular_deque<std::unique_ptr<TaskAndCallback>> pending_installs_; + + std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> + current_registration_; + + base::circular_deque<GURL> pending_registrations_; + RegistrationCallback registration_callback_; base::WeakPtrFactory<ExternallyManagedAppManager> weak_ptr_factory_{this};
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_impl_browsertest.cc b/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc similarity index 95% rename from chrome/browser/web_applications/externally_managed_app_manager_impl_browsertest.cc rename to chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc index 785a3c0e..34507d6 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager_impl_browsertest.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager_browsertest.cc
@@ -1,9 +1,8 @@ -// Copyright 2018 The Chromium Authors +// Copyright 2023 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/web_applications/web_app_controller_browsertest.h" -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -14,6 +13,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" +#include "chrome/browser/ui/web_applications/web_app_controller_browsertest.h" #include "chrome/browser/web_applications/external_install_options.h" #include "chrome/browser/web_applications/externally_managed_app_registration_task.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" @@ -44,7 +44,7 @@ namespace web_app { -class ExternallyManagedAppManagerImplBrowserTest +class ExternallyManagedAppManagerBrowserTest : public WebAppControllerBrowserTest { protected: void SetUpOnMainThread() override { @@ -86,7 +86,7 @@ }; class ExternallyManagedBrowserTestWithPrefMigrationRead - : public ExternallyManagedAppManagerImplBrowserTest, + : public ExternallyManagedAppManagerBrowserTest, public testing::WithParamInterface<test::ExternalPrefMigrationTestCases> { public: ExternallyManagedBrowserTestWithPrefMigrationRead() { @@ -303,7 +303,7 @@ // Installing a placeholder app with a custom icon should succeed, even we have // to retry fetching the icon once. // This feature is ChromeOS-only. -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, PlaceholderInstallSucceedsWithCustomIconAfterRetry) { // Fail the first time that this URL is loaded. std::string kIconRelativeUrl = "/banners/192x192-green.png"; @@ -352,7 +352,7 @@ // Tests that the browser doesn't crash if it gets shutdown with a pending // installation. -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, ShutdownWithPendingInstallation) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -368,7 +368,7 @@ // installation. } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, BypassServiceWorkerCheck) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL( @@ -383,7 +383,7 @@ EXPECT_EQ("Manifest test app", registrar().GetAppShortName(*app_id)); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, PerformServiceWorkerCheck) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL( @@ -395,8 +395,7 @@ EXPECT_TRUE(registrar().GetAppScopeInternal(app_id.value()).has_value()); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, - ForceReinstall) { +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, ForceReinstall) { ASSERT_TRUE(embedded_test_server()->Start()); absl::optional<AppId> app_id; { @@ -426,7 +425,7 @@ } } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, PolicyAppOverridesUserInstalledApp) { ASSERT_TRUE(embedded_test_server()->Start()); absl::optional<AppId> app_id; @@ -491,7 +490,7 @@ ASSERT_FALSE(id.has_value()); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, RegistrationSucceeds) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -512,7 +511,7 @@ content::ServiceWorkerCapability::SERVICE_WORKER_WITH_FETCH_HANDLER); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, RegistrationAlternateUrlSucceeds) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -535,7 +534,7 @@ content::ServiceWorkerCapability::SERVICE_WORKER_WITH_FETCH_HANDLER); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, RegistrationSkipped) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -557,7 +556,7 @@ content::ServiceWorkerCapability::NO_SERVICE_WORKER); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, AlreadyRegistered) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -596,7 +595,7 @@ } } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, CannotFetchManifest) { // With a flaky network connection, clients may request an app whose manifest // cannot currently be retrieved. The app display mode is then assumed to be @@ -644,7 +643,7 @@ EXPECT_FALSE(registrar().GetAppThemeColor(*app_id).has_value()); } -IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerImplBrowserTest, +IN_PROC_BROWSER_TEST_F(ExternallyManagedAppManagerBrowserTest, RegistrationTimeout) { ASSERT_TRUE(embedded_test_server()->Start()); ExternallyManagedAppRegistrationTask::SetTimeoutForTesting(0); @@ -713,11 +712,11 @@ test::ExternalPrefMigrationTestCases::kEnableMigrationReadDB), test::GetExternalPrefMigrationTestName); -class ExternallyManagedAppManagerImplBrowserTestShortcut - : public ExternallyManagedAppManagerImplBrowserTest, +class ExternallyManagedAppManagerBrowserTestShortcut + : public ExternallyManagedAppManagerBrowserTest, public testing::WithParamInterface<bool> { public: - ExternallyManagedAppManagerImplBrowserTestShortcut() { + ExternallyManagedAppManagerBrowserTestShortcut() { scoped_feature_list_.InitWithFeatures( {webapps::features::kCreateShortcutIgnoresManifest}, {}); } @@ -727,7 +726,7 @@ }; // Tests behavior when ExternalInstallOptions.install_as_shortcut is enabled -IN_PROC_BROWSER_TEST_P(ExternallyManagedAppManagerImplBrowserTestShortcut, +IN_PROC_BROWSER_TEST_P(ExternallyManagedAppManagerBrowserTestShortcut, InstallAsShortcut) { ASSERT_TRUE(embedded_test_server()->Start()); GURL install_url( @@ -758,7 +757,7 @@ } INSTANTIATE_TEST_SUITE_P(All, - ExternallyManagedAppManagerImplBrowserTestShortcut, + ExternallyManagedAppManagerBrowserTestShortcut, ::testing::Bool()); } // namespace web_app
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_impl.cc b/chrome/browser/web_applications/externally_managed_app_manager_impl.cc deleted file mode 100644 index e6e9921..0000000 --- a/chrome/browser/web_applications/externally_managed_app_manager_impl.cc +++ /dev/null
@@ -1,393 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" - -#include <memory> -#include <string> -#include <utility> -#include <vector> - -#include "base/check_is_test.h" -#include "base/feature_list.h" -#include "base/functional/bind.h" -#include "base/functional/callback_helpers.h" -#include "base/task/single_thread_task_runner.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/web_applications/externally_managed_app_manager.h" -#include "chrome/browser/web_applications/externally_managed_app_registration_task.h" -#include "chrome/browser/web_applications/locks/all_apps_lock.h" -#include "chrome/browser/web_applications/web_app.h" -#include "chrome/browser/web_applications/web_app_command_scheduler.h" -#include "chrome/browser/web_applications/web_app_install_finalizer.h" -#include "chrome/browser/web_applications/web_app_install_utils.h" -#include "chrome/browser/web_applications/web_app_registrar.h" -#include "chrome/browser/web_applications/web_app_registry_update.h" -#include "chrome/browser/web_applications/web_app_sync_bridge.h" -#include "chrome/browser/web_applications/web_app_ui_manager.h" -#include "chrome/browser/web_applications/web_contents/web_app_data_retriever.h" -#include "chrome/browser/web_applications/web_contents/web_app_url_loader.h" -#include "chrome/common/chrome_features.h" -#include "components/webapps/browser/install_result_code.h" -#include "components/webapps/browser/uninstall_result_code.h" -#include "content/public/browser/web_contents.h" -#include "content/public/common/url_constants.h" - -namespace web_app { - -struct ExternallyManagedAppManagerImpl::TaskAndCallback { - TaskAndCallback(std::unique_ptr<ExternallyManagedAppInstallTask> task, - OnceInstallCallback callback) - : task(std::move(task)), callback(std::move(callback)) {} - ~TaskAndCallback() = default; - - std::unique_ptr<ExternallyManagedAppInstallTask> task; - OnceInstallCallback callback; -}; - -ExternallyManagedAppManagerImpl::ExternallyManagedAppManagerImpl( - Profile* profile) - : profile_(profile), url_loader_(std::make_unique<WebAppUrlLoader>()) {} - -ExternallyManagedAppManagerImpl::~ExternallyManagedAppManagerImpl() { - // Extra check to verify that web_contents is released even if - // shutdown somehow has not been invoked. - if (!IsShuttingDown()) { - Shutdown(); - } -} - -void ExternallyManagedAppManagerImpl::InstallNow( - ExternalInstallOptions install_options, - OnceInstallCallback callback) { - pending_installs_.push_front(std::make_unique<TaskAndCallback>( - CreateInstallationTask(std::move(install_options)), std::move(callback))); - - PostMaybeStartNext(); -} - -void ExternallyManagedAppManagerImpl::Install( - ExternalInstallOptions install_options, - OnceInstallCallback callback) { - pending_installs_.push_back(std::make_unique<TaskAndCallback>( - CreateInstallationTask(std::move(install_options)), std::move(callback))); - - PostMaybeStartNext(); -} - -void ExternallyManagedAppManagerImpl::InstallApps( - std::vector<ExternalInstallOptions> install_options_list, - const RepeatingInstallCallback& callback) { - for (auto& install_options : install_options_list) { - pending_installs_.push_back(std::make_unique<TaskAndCallback>( - CreateInstallationTask(std::move(install_options)), callback)); - } - - PostMaybeStartNext(); -} - -void ExternallyManagedAppManagerImpl::UninstallApps( - std::vector<GURL> uninstall_urls, - ExternalInstallSource install_source, - const UninstallCallback& callback) { - for (auto& url : uninstall_urls) { - finalizer()->UninstallExternalWebAppByUrl( - url, ConvertExternalInstallSourceToSource(install_source), - ConvertExternalInstallSourceToUninstallSource(install_source), - base::BindOnce( - [](const UninstallCallback& callback, const GURL& app_url, - webapps::UninstallResultCode code) { - callback.Run(app_url, - code == webapps::UninstallResultCode::kSuccess); - }, - callback, url)); - } -} - -void ExternallyManagedAppManagerImpl::Shutdown() { - is_in_shutdown_ = true; - pending_registrations_.clear(); - current_registration_.reset(); - pending_installs_.clear(); - url_loader_.reset(); - // `current_install_` keeps a pointer to `web_contents_` so destroy it before - // releasing the WebContents. - current_install_.reset(); - ReleaseWebContents(); -} - -void ExternallyManagedAppManagerImpl::SetUrlLoaderForTesting( - std::unique_ptr<WebAppUrlLoader> url_loader) { - CHECK_IS_TEST(); - url_loader_ = std::move(url_loader); -} - -void ExternallyManagedAppManagerImpl::SetDataRetrieverFactoryForTesting( - base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> factory) { - CHECK_IS_TEST(); - data_retriever_factory_for_testing_ = std::move(factory); -} - -void ExternallyManagedAppManagerImpl::ReleaseWebContents() { - DCHECK(pending_registrations_.empty()); - DCHECK(!current_registration_); - DCHECK(pending_installs_.empty()); - DCHECK(!current_install_); - - web_contents_.reset(); -} - -std::unique_ptr<ExternallyManagedAppInstallTask> -ExternallyManagedAppManagerImpl::CreateInstallationTask( - ExternalInstallOptions install_options) { - std::unique_ptr<ExternallyManagedAppInstallTask> install_task = - std::make_unique<ExternallyManagedAppInstallTask>( - profile_, url_loader_.get(), ui_manager(), finalizer(), - command_scheduler(), std::move(install_options)); - if (data_retriever_factory_for_testing_) { - CHECK_IS_TEST(); - install_task->SetDataRetrieverFactoryForTesting( // IN-TEST - data_retriever_factory_for_testing_); - } - return install_task; -} - -std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> -ExternallyManagedAppManagerImpl::StartRegistration(GURL install_url) { - DCHECK(!IsShuttingDown()); - ExternallyManagedAppRegistrationTask::RegistrationCallback callback = - base::BindOnce(&ExternallyManagedAppManagerImpl::OnRegistrationFinished, - weak_ptr_factory_.GetWeakPtr(), install_url); - return std::make_unique<ExternallyManagedAppRegistrationTask>( - std::move(install_url), url_loader_.get(), web_contents_.get(), - std::move(callback)); -} - -void ExternallyManagedAppManagerImpl::OnRegistrationFinished( - const GURL& install_url, - RegistrationResultCode result) { - DCHECK_EQ(current_registration_->install_url(), install_url); - ExternallyManagedAppManager::OnRegistrationFinished(install_url, result); - - current_registration_.reset(); - PostMaybeStartNext(); -} - -void ExternallyManagedAppManagerImpl::PostMaybeStartNext() { - base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, - base::BindOnce(&ExternallyManagedAppManagerImpl::MaybeStartNext, - weak_ptr_factory_.GetWeakPtr())); -} - -void ExternallyManagedAppManagerImpl::MaybeStartNext() { - if (current_install_ || IsShuttingDown()) { - return; - } - command_scheduler()->ScheduleCallbackWithLock<AllAppsLock>( - "ExternallyManagedAppManagerImpl::MaybeStartNext", - std::make_unique<AllAppsLockDescription>(), - base::BindOnce( - &ExternallyManagedAppManagerImpl::MaybeStartNextOnLockAcquired, - weak_ptr_factory_.GetWeakPtr())); -} - -void ExternallyManagedAppManagerImpl::MaybeStartNextOnLockAcquired( - AllAppsLock& lock) { - if (current_install_ || IsShuttingDown()) { - return; - } - - while (!pending_installs_.empty()) { - std::unique_ptr<TaskAndCallback> front = - std::move(pending_installs_.front()); - pending_installs_.pop_front(); - - const ExternalInstallOptions& install_options = - front->task->install_options(); - - if (install_options.force_reinstall) { - StartInstallationTask(std::move(front)); - return; - } - - absl::optional<AppId> app_id = - lock.registrar().LookupExternalAppId(install_options.install_url); - - // If the URL is not in web_app registrar, - // then no external source has installed it. - if (!app_id.has_value()) { - StartInstallationTask(std::move(front)); - return; - } - - if (lock.registrar().IsInstalled(app_id.value())) { - if (install_options.wait_for_windows_closed && - lock.ui_manager().GetNumWindowsForApp(app_id.value()) != 0) { - lock.ui_manager().NotifyOnAllAppWindowsClosed( - app_id.value(), - base::BindOnce(&ExternallyManagedAppManagerImpl::Install, - weak_ptr_factory_.GetWeakPtr(), install_options, - std::move(front->callback))); - continue; - } - - // If the app is already installed, only reinstall it if the app is a - // placeholder app and the client asked for it to be reinstalled. - if (install_options.reinstall_placeholder && - lock.registrar().IsPlaceholderApp( - app_id.value(), ConvertExternalInstallSourceToSource( - install_options.install_source))) { - StartInstallationTask(std::move(front)); - return; - } - - // TODO(crbug.com/1300321): Investigate re-install of the app for all - // WebAppManagement sources. - if ((ConvertExternalInstallSourceToSource( - install_options.install_source) == WebAppManagement::kPolicy) && - (!lock.registrar() - .GetAppById(app_id.value()) - ->IsPolicyInstalledApp())) { - StartInstallationTask(std::move(front)); - return; - } else { - // Add install source before returning the result. - ScopedRegistryUpdate update(&lock.sync_bridge()); - WebApp* app_to_update = update->UpdateApp(app_id.value()); - app_to_update->AddSource(ConvertExternalInstallSourceToSource( - install_options.install_source)); - app_to_update->AddInstallURLToManagementExternalConfigMap( - ConvertExternalInstallSourceToSource( - install_options.install_source), - install_options.install_url); - } - std::move(front->callback) - .Run(install_options.install_url, - ExternallyManagedAppManager::InstallResult( - webapps::InstallResultCode::kSuccessAlreadyInstalled, - app_id)); - continue; - } - - // If neither of the above conditions applies, the app probably got - // uninstalled but it wasn't been removed from the map. We should install - // the app in this case. - StartInstallationTask(std::move(front)); - return; - } - DCHECK(!current_install_); - - if (current_registration_ || RunNextRegistration()) - return; - - ReleaseWebContents(); -} - -void ExternallyManagedAppManagerImpl::StartInstallationTask( - std::unique_ptr<TaskAndCallback> task) { - if (IsShuttingDown()) { - return; - } - DCHECK(!current_install_); - DCHECK(!is_in_shutdown_); - if (current_registration_) { - // Preempt current registration. - pending_registrations_.push_front(current_registration_->install_url()); - current_registration_.reset(); - } - - current_install_ = std::move(task); - CreateWebContentsIfNecessary(); - current_install_->task->Install( - web_contents_.get(), - base::BindOnce(&ExternallyManagedAppManagerImpl::OnInstalled, - weak_ptr_factory_.GetWeakPtr())); -} - -bool ExternallyManagedAppManagerImpl::RunNextRegistration() { - if (pending_registrations_.empty() || IsShuttingDown()) { - if (registrations_complete_callback_) - std::move(registrations_complete_callback_).Run(); - return false; - } - - GURL url_to_check = std::move(pending_registrations_.front()); - pending_registrations_.pop_front(); - current_registration_ = StartRegistration(std::move(url_to_check)); - return true; -} - -void ExternallyManagedAppManagerImpl::CreateWebContentsIfNecessary() { - DCHECK(!IsShuttingDown()); - if (web_contents_) { - return; - } - - web_contents_ = content::WebContents::Create( - content::WebContents::CreateParams(profile_)); - CreateWebAppInstallTabHelpers(web_contents_.get()); -} - -void ExternallyManagedAppManagerImpl::OnInstalled( - ExternallyManagedAppManager::InstallResult result) { - if (result.app_id && IsSuccess(result.code)) { - MaybeEnqueueServiceWorkerRegistration( - current_install_->task->install_options()); - } - - // Post a task to avoid webapps::InstallableManager crashing and do so before - // running the callback in case the callback tries to install another - // app. - PostMaybeStartNext(); - - std::unique_ptr<TaskAndCallback> task_and_callback; - task_and_callback.swap(current_install_); - std::move(task_and_callback->callback) - .Run(task_and_callback->task->install_options().install_url, result); -} - -void ExternallyManagedAppManagerImpl::MaybeEnqueueServiceWorkerRegistration( - const ExternalInstallOptions& install_options) { - if (!base::FeatureList::IsEnabled( - features::kDesktopPWAsCacheDuringDefaultInstall)) { - return; - } - - if (IsShuttingDown()) { - return; - } - - if (install_options.only_use_app_info_factory) - return; - - if (!install_options.load_and_await_service_worker_registration) - return; - - // TODO(crbug.com/809304): Call CreateWebContentsIfNecessary() instead of - // checking web_contents_ once major migration of default hosted apps to web - // apps has completed. - // Temporarily using offline manifest migrations (in which |web_contents_| - // is nullptr) in order to avoid overwhelming migrated-to web apps with hits - // for service worker registrations. - if (!web_contents_) - return; - - GURL url = install_options.service_worker_registration_url.value_or( - install_options.install_url); - if (url.is_empty()) - return; - if (url.scheme() == content::kChromeUIScheme) - return; - if (url.scheme() == content::kChromeUIUntrustedScheme) - return; - - pending_registrations_.push_back(url); -} - -bool ExternallyManagedAppManagerImpl::IsShuttingDown() { - return is_in_shutdown_ || profile()->ShutdownStarted(); -} - -} // namespace web_app
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_impl.h b/chrome/browser/web_applications/externally_managed_app_manager_impl.h deleted file mode 100644 index a8dc5896..0000000 --- a/chrome/browser/web_applications/externally_managed_app_manager_impl.h +++ /dev/null
@@ -1,122 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_WEB_APPLICATIONS_EXTERNALLY_MANAGED_APP_MANAGER_IMPL_H_ -#define CHROME_BROWSER_WEB_APPLICATIONS_EXTERNALLY_MANAGED_APP_MANAGER_IMPL_H_ - -#include <memory> -#include <vector> - -#include "base/containers/circular_deque.h" -#include "base/functional/callback.h" -#include "base/memory/raw_ptr.h" -#include "base/memory/weak_ptr.h" -#include "chrome/browser/web_applications/external_install_options.h" -#include "chrome/browser/web_applications/externally_managed_app_install_task.h" -#include "chrome/browser/web_applications/externally_managed_app_manager.h" -#include "third_party/abseil-cpp/absl/types/optional.h" - -class GURL; -class Profile; - -namespace content { -class WebContents; -} // namespace content - -namespace web_app { - -class AllAppsLock; -class ExternallyManagedAppRegistrationTaskBase; -class WebAppUrlLoader; -class WebAppDataRetriever; - -// Installs, uninstalls, and updates any External Web Apps. This class should -// only be used from the UI thread. -class ExternallyManagedAppManagerImpl : public ExternallyManagedAppManager { - public: - explicit ExternallyManagedAppManagerImpl(Profile* profile); - ExternallyManagedAppManagerImpl(const ExternallyManagedAppManagerImpl&) = - delete; - ExternallyManagedAppManagerImpl& operator=( - const ExternallyManagedAppManagerImpl&) = delete; - ~ExternallyManagedAppManagerImpl() override; - - // ExternallyManagedAppManager: - void InstallNow(ExternalInstallOptions install_options, - OnceInstallCallback callback) override; - void Install(ExternalInstallOptions install_options, - OnceInstallCallback callback) override; - void InstallApps(std::vector<ExternalInstallOptions> install_options_list, - const RepeatingInstallCallback& callback) override; - void UninstallApps(std::vector<GURL> uninstall_urls, - ExternalInstallSource install_source, - const UninstallCallback& callback) override; - void Shutdown() override; - - void SetUrlLoaderForTesting(std::unique_ptr<WebAppUrlLoader> url_loader); - void SetDataRetrieverFactoryForTesting( - base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> factory); - - protected: - virtual void ReleaseWebContents(); - - virtual std::unique_ptr<ExternallyManagedAppInstallTask> - CreateInstallationTask(ExternalInstallOptions install_options); - - virtual std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> - StartRegistration(GURL launch_url); - - void OnRegistrationFinished(const GURL& launch_url, - RegistrationResultCode result) override; - - Profile* profile() { return profile_; } - - private: - struct TaskAndCallback; - - void PostMaybeStartNext(); - - void MaybeStartNext(); - void MaybeStartNextOnLockAcquired(AllAppsLock& lock); - - void StartInstallationTask(std::unique_ptr<TaskAndCallback> task); - - bool RunNextRegistration(); - - void CreateWebContentsIfNecessary(); - - void OnInstalled(ExternallyManagedAppManager::InstallResult result); - - void MaybeEnqueueServiceWorkerRegistration( - const ExternalInstallOptions& install_options); - - bool IsShuttingDown(); - - const raw_ptr<Profile> profile_; - - bool is_in_shutdown_ = false; - - // unique_ptr so that it can be replaced in tests. - std::unique_ptr<WebAppUrlLoader> url_loader_; - // Allows tests to set the data retriever for install tasks. - base::RepeatingCallback<std::unique_ptr<WebAppDataRetriever>()> - data_retriever_factory_for_testing_; - - std::unique_ptr<content::WebContents> web_contents_; - - std::unique_ptr<TaskAndCallback> current_install_; - - base::circular_deque<std::unique_ptr<TaskAndCallback>> pending_installs_; - - std::unique_ptr<ExternallyManagedAppRegistrationTaskBase> - current_registration_; - - base::circular_deque<GURL> pending_registrations_; - - base::WeakPtrFactory<ExternallyManagedAppManagerImpl> weak_ptr_factory_{this}; -}; - -} // namespace web_app - -#endif // CHROME_BROWSER_WEB_APPLICATIONS_EXTERNALLY_MANAGED_APP_MANAGER_IMPL_H_
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_impl_unittest.cc b/chrome/browser/web_applications/externally_managed_app_manager_impl_unittest.cc index 371d3f7..95ccd11 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager_impl_unittest.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager_impl_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include <map> #include <memory> @@ -148,7 +148,7 @@ bool should_save_requests_ = false; }; -class TestExternallyManagedAppManager : public ExternallyManagedAppManagerImpl { +class TestExternallyManagedAppManager : public ExternallyManagedAppManager { public: struct TestTaskResult { webapps::InstallResultCode code; @@ -159,7 +159,7 @@ Profile* profile, FakeWebAppProvider& provider, TestExternallyManagedAppInstallTaskManager& test_install_task_manager) - : ExternallyManagedAppManagerImpl(profile), + : ExternallyManagedAppManager(profile), provider_(provider), test_install_task_manager_(test_install_task_manager) {} @@ -250,7 +250,7 @@ } void ReleaseWebContents() override { - ExternallyManagedAppManagerImpl::ReleaseWebContents(); + ExternallyManagedAppManager::ReleaseWebContents(); // May be called more than once, if ExternallyManagedAppManager finishes all // tasks before it is shutdown. @@ -406,6 +406,15 @@ } // namespace +// Why is this called ExternallyManagedAppManagerImplTest and exists along side +// ExternallyManagedAppManagerTest unit tests? +// - Because ExternallyManagedAppManager used to be split up into +// ExternallyManagedAppManager and ExternallyManagedAppManagerImpl and each +// had tests written for them separately. +// - These tests are too volumous and baked with their own test suite class +// semantics that there's no easy way to merge them together. +// Let this file be legacy unit tests and prefer adding to the +// ExternallyManagedAppManagerTest unit test suite instead. class ExternallyManagedAppManagerImplTest : public WebAppTest, public testing::WithParamInterface<test::ExternalPrefMigrationTestCases> { @@ -552,7 +561,7 @@ return externally_managed_app_manager_impl_->install_run_count(); } - // Number of times ExternallyManagedAppManagerImpl::StartRegistration was + // Number of times ExternallyManagedAppManager::StartRegistration was // called. Reflects how many times we've tried to cache service worker // resources for a web app. size_t registration_run_count() {
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc b/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc index 0f4979e..7a6473a 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc
@@ -21,7 +21,7 @@ #include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/external_install_options.h" #include "chrome/browser/web_applications/externally_installed_web_app_prefs.h" -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/policy/web_app_policy_manager.h" @@ -394,8 +394,8 @@ void SetUp() override { WebAppTest::SetUp(); provider_ = web_app::FakeWebAppProvider::Get(profile()); - std::unique_ptr<ExternallyManagedAppManagerImpl> external_app_manager = - std::make_unique<ExternallyManagedAppManagerImpl>(profile()); + std::unique_ptr<ExternallyManagedAppManager> external_app_manager = + std::make_unique<ExternallyManagedAppManager>(profile()); external_app_manager->SetUrlLoaderForTesting( web_contents_manager_.CreateUrlLoader()); @@ -438,8 +438,8 @@ WebAppRegistrar& app_registrar() { return provider().registrar_unsafe(); } - ExternallyManagedAppManagerImpl& external_mananager() { - return static_cast<ExternallyManagedAppManagerImpl&>( + ExternallyManagedAppManager& external_mananager() { + return static_cast<ExternallyManagedAppManager&>( provider().externally_managed_app_manager()); }
diff --git a/chrome/browser/web_applications/isolated_web_apps/get_isolated_web_app_browsing_data_command.h b/chrome/browser/web_applications/isolated_web_apps/get_isolated_web_app_browsing_data_command.h index e8d82e94..deb210a37 100644 --- a/chrome/browser/web_applications/isolated_web_apps/get_isolated_web_app_browsing_data_command.h +++ b/chrome/browser/web_applications/isolated_web_apps/get_isolated_web_app_browsing_data_command.h
@@ -44,7 +44,6 @@ base::Value ToDebugValue() const override; void StartWithLock(std::unique_ptr<AllAppsLock> lock) override; void OnShutdown() override; - void OnSyncSourceRemoved() override {} private: void StoragePartitionSizeFetched(const url::Origin& iwa_origin, int64_t size);
diff --git a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.cc b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.cc index f6e2f3a..1846c05 100644 --- a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.cc +++ b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.cc
@@ -423,11 +423,6 @@ FinalizeInstall(install_info); } -void InstallIsolatedWebAppCommand::OnSyncSourceRemoved() { - // TODO(kuragin): Test cancellation on sync source removed event. - ReportFailure("Sync source removed."); -} - void InstallIsolatedWebAppCommand::OnShutdown() { // TODO(kuragin): Test cancellation of pending installation during system // shutdown.
diff --git a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h index 9ab7ca3..0ae6357 100644 --- a/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h +++ b/chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_command.h
@@ -111,7 +111,6 @@ const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; void StartWithLock(std::unique_ptr<AppLock> lock) override; - void OnSyncSourceRemoved() override; void OnShutdown() override; void SetDataRetrieverForTesting(
diff --git a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc index 7929411..051b711 100644 --- a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc +++ b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc
@@ -11,7 +11,7 @@ FakeExternallyManagedAppManager::FakeExternallyManagedAppManager( Profile* profile) - : ExternallyManagedAppManagerImpl(profile) {} + : ExternallyManagedAppManager(profile) {} FakeExternallyManagedAppManager::~FakeExternallyManagedAppManager() = default; @@ -33,8 +33,7 @@ base::BindOnce(std::move(callback), install_options.install_url)); return; } - ExternallyManagedAppManagerImpl::Install(install_options, - std::move(callback)); + ExternallyManagedAppManager::Install(install_options, std::move(callback)); } void FakeExternallyManagedAppManager::InstallApps( @@ -49,8 +48,7 @@ base::ranges::copy(install_options_list, std::back_inserter(install_requests_)); if (!drop_requests_for_testing_) { - ExternallyManagedAppManagerImpl::InstallApps(install_options_list, - callback); + ExternallyManagedAppManager::InstallApps(install_options_list, callback); } } @@ -70,8 +68,8 @@ } return; } - ExternallyManagedAppManagerImpl::UninstallApps(uninstall_urls, install_source, - callback); + ExternallyManagedAppManager::UninstallApps(uninstall_urls, install_source, + callback); } void FakeExternallyManagedAppManager::SetHandleInstallRequestCallback(
diff --git a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.h b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.h index 7bc03fe6..acac987 100644 --- a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.h +++ b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.h
@@ -7,12 +7,12 @@ #include <vector> -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "components/webapps/browser/install_result_code.h" namespace web_app { -class FakeExternallyManagedAppManager : public ExternallyManagedAppManagerImpl { +class FakeExternallyManagedAppManager : public ExternallyManagedAppManager { public: explicit FakeExternallyManagedAppManager(Profile* profile); ~FakeExternallyManagedAppManager() override;
diff --git a/chrome/browser/web_applications/web_app_command_manager.cc b/chrome/browser/web_applications/web_app_command_manager.cc index ff55ac8..72fc2627 100644 --- a/chrome/browser/web_applications/web_app_command_manager.cc +++ b/chrome/browser/web_applications/web_app_command_manager.cc
@@ -212,35 +212,6 @@ shared_web_contents_.reset(); } -void WebAppCommandManager::NotifySyncSourceRemoved( - const std::vector<AppId>& app_ids) { - if (is_in_shutdown_) - return; - - // To prevent map modification-during-iteration, make a copy of relevant - // commands. The main complications that can occur are a command calling - // `CompleteAndDestruct` or `ScheduleCommand` inside of the - // `OnSyncSourceRemoved` call. Because all commands are - // `StartWithLock()`ed asynchronously, we will never have to notify any - // commands that are newly scheduled. So at most one command needs to be - // notified per queue, and that command can be destroyed before we notify it. - std::vector<base::WeakPtr<WebAppCommand>> commands_to_notify; - for (const AppId& app_id : app_ids) { - for (const auto& [id, command] : commands_) { - if (base::Contains(command->lock_description().app_ids(), app_id)) { - if (command->IsStarted()) { - commands_to_notify.push_back(command->AsWeakPtr()); - } - } - } - } - for (const auto& command_ptr : commands_to_notify) { - if (!command_ptr) - continue; - command_ptr->OnSyncSourceRemoved(); - } -} - base::Value WebAppCommandManager::ToDebugValue() { base::Value::List command_log; for (const auto& command_value : command_debug_log_) {
diff --git a/chrome/browser/web_applications/web_app_command_manager.h b/chrome/browser/web_applications/web_app_command_manager.h index 6625cb9..a2bc0e35 100644 --- a/chrome/browser/web_applications/web_app_command_manager.h +++ b/chrome/browser/web_applications/web_app_command_manager.h
@@ -60,12 +60,6 @@ // have been `Start()`ed. void Shutdown(); - // Called by the sync integration when a list of apps have had their sync - // sources removed and `is_uninstalling()` set to true. Any commands - // whose `lock_description().app_ids()` match an id in `app_id` who have also - // been `StartWithLock()`ed will also be notified. - void NotifySyncSourceRemoved(const std::vector<AppId>& app_ids); - // Outputs a debug value of the state of the commands system, including // running and queued commands. base::Value ToDebugValue();
diff --git a/chrome/browser/web_applications/web_app_command_manager_unittest.cc b/chrome/browser/web_applications/web_app_command_manager_unittest.cc index d8276a8..475c6dde 100644 --- a/chrome/browser/web_applications/web_app_command_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_command_manager_unittest.cc
@@ -59,7 +59,6 @@ } MOCK_METHOD(void, StartWithLock, (std::unique_ptr<LockType>), (override)); - MOCK_METHOD(void, OnSyncSourceRemoved, (), (override)); MOCK_METHOD(void, OnShutdown, (), (override)); base::WeakPtr<MockCommand> AsWeakPtr() { return weak_factory_.GetWeakPtr(); } @@ -434,32 +433,6 @@ manager().Shutdown(); } -TEST_F(WebAppCommandManagerTest, NotifySyncCallsCompleteAndDestruct) { - testing::StrictMock<base::MockCallback<base::OnceClosure>> mock_closure; - auto command = std::make_unique<StrictMock<MockCommand<AppLock>>>( - std::make_unique<AppLockDescription>(kTestAppId)); - base::WeakPtr<MockCommand<AppLock>> command_ptr = command->AsWeakPtr(); - manager().ScheduleCommand(std::move(command)); - { - base::RunLoop loop; - EXPECT_CALL(*command_ptr, StartWithLock(testing::_)).WillOnce([&]() { - loop.Quit(); - }); - loop.Run(); - } - { - testing::InSequence in_sequence; - EXPECT_CALL(*command_ptr, OnSyncSourceRemoved()).Times(1).WillOnce([&]() { - ASSERT_TRUE(command_ptr); - command_ptr->CallSignalCompletionAndSelfDestruct(CommandResult::kSuccess, - mock_closure.Get()); - }); - EXPECT_CALL(*command_ptr, OnDestruction()).Times(1); - EXPECT_CALL(mock_closure, Run()).Times(1); - } - manager().NotifySyncSourceRemoved({kTestAppId}); -} - TEST_F(WebAppCommandManagerTest, MultipleCallbackCommands) { base::RunLoop loop; // Queue multiple callbacks to app queues, and gather output.
diff --git a/chrome/browser/web_applications/web_app_provider.cc b/chrome/browser/web_applications/web_app_provider.cc index 11d972b8..4e2ca89 100644 --- a/chrome/browser/web_applications/web_app_provider.cc +++ b/chrome/browser/web_applications/web_app_provider.cc
@@ -19,7 +19,7 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/web_applications/externally_managed_app_manager_impl.h" +#include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/file_utils_wrapper.h" #include "chrome/browser/web_applications/isolated_web_apps/install_isolated_web_app_from_command_line.h" #include "chrome/browser/web_applications/manifest_update_manager.h" @@ -256,7 +256,7 @@ install_manager_ = std::make_unique<WebAppInstallManager>(profile); manifest_update_manager_ = std::make_unique<ManifestUpdateManager>(); externally_managed_app_manager_ = - std::make_unique<ExternallyManagedAppManagerImpl>(profile); + std::make_unique<ExternallyManagedAppManager>(profile); preinstalled_web_app_manager_ = std::make_unique<PreinstalledWebAppManager>(profile); web_app_policy_manager_ = std::make_unique<WebAppPolicyManager>(profile);
diff --git a/chrome/build/lacros-arm.pgo.txt b/chrome/build/lacros-arm.pgo.txt index c9d64d1..a22376d 100644 --- a/chrome/build/lacros-arm.pgo.txt +++ b/chrome/build/lacros-arm.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-arm-generic-main-1683259166-83106eb03ad7b6c99d45bf59d0b3c4b7bd1f93b1.profdata +chrome-chromeos-arm-generic-main-1683590337-1642c75848c8942b7568ed245d41780e1ff3b02b.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index ddd11a77..7ac49e0 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1683561463-c7057013f3e871ed513786ef7561d95a3b9b06cf.profdata +chrome-chromeos-amd64-generic-main-1683575964-b9372cf90ec798d03b1ed0a3867ffbe16066f295.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 14e7e55a..4e559e2 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1683575964-3fd4c6a5f61418dcad11c59abd968a7747451027.profdata +chrome-mac-arm-main-1683611582-c5cf7b1993a8dedf860a718bf788855c0e34dad0.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index ef06650..79704a0 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1683546861-05232a03ac22f367a23cc53a5ad55cbad793a1c5.profdata +chrome-win32-main-1683611582-bde55612696259a3a9265a9e23e024db77734dee.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 7867f8a6..28df86b2 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1683579505-c7d03385e53d1debb9556705dd2dc0b71ca4e906.profdata +chrome-win64-main-1683601141-44ccdd8112d962796dc504ef8d54a47e2c10f742.profdata
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl index fe754eac..b96d5d6 100644 --- a/chrome/common/extensions/api/autotest_private.idl +++ b/chrome/common/extensions/api/autotest_private.idl
@@ -282,6 +282,7 @@ Unavailable, Stopped, CreatingLogFile, + PreLaunched, Starting, Running, Terminating
diff --git a/chrome/common/extensions/api/file_manager_private.idl b/chrome/common/extensions/api/file_manager_private.idl index 97718b4..6cf5e3c 100644 --- a/chrome/common/extensions/api/file_manager_private.idl +++ b/chrome/common/extensions/api/file_manager_private.idl
@@ -1964,6 +1964,10 @@ // Returns the current progress of the bulk pinning manager. static void getBulkPinProgress(GetBulkPinProgressCallback callback); + + // Starts calculating the space required to pin all the items in a users My + // drive. + static void calculateBulkPinRequiredSpace(); }; // Events supported by fileManagerPrivate API. These events are broadcasted.
diff --git a/chrome/test/interaction/webcontents_interaction_test_util.cc b/chrome/test/interaction/webcontents_interaction_test_util.cc index 3d18b51..430f1c0 100644 --- a/chrome/test/interaction/webcontents_interaction_test_util.cc +++ b/chrome/test/interaction/webcontents_interaction_test_util.cc
@@ -653,9 +653,23 @@ CHECK(web_contents()->GetController().LoadURLWithParams(params)); } else { // Regular web pages can be navigated directly. - const bool result = - content::BeginNavigateToURLFromRenderer(web_contents(), url); - CHECK(result); + // + // In an ideal world, this should use `BeginNavigateToURLFromRenderer()`, + // which verifies that the navigation successfully starts. However, + // `BeginNavigateToURLFromRenderer()` itself uses a RunLoop to listen for + // the navigation starting. + // + // For reasons that are not well understood, this is problematic when used + // in conjunction with the interaction sequence test utils, which often + // run the entire test inside a top-level RunLoop; the now nested RunLoop + // inside `BeginNavigateToURLFromRenderer()` never receives the + // `DidStartNavigation()` callback, and the test just ends up hanging. + // + // Use Execute() as a workaround this hang. Note that unlike the + // similarly-named `content::ExecJs()`, this helper does not actually + // validate or wait for the script to execute; hopefully, errors from + // navigation failures will be obvious enough in subsequent steps. + ExecuteJsLocal(web_contents(), content::JsReplace("location = $1", url)); } }
diff --git a/chromeos/ash/components/device_activity/device_activity_controller.cc b/chromeos/ash/components/device_activity/device_activity_controller.cc index 62e0185e..25552bf 100644 --- a/chromeos/ash/components/device_activity/device_activity_controller.cc +++ b/chromeos/ash/components/device_activity/device_activity_controller.cc
@@ -55,7 +55,6 @@ static const std::unordered_set<policy::DeviceMode>& DeviceModeEnterprise() { static const std::unordered_set<policy::DeviceMode> kModeEnterprise( {policy::DeviceMode::DEVICE_MODE_ENTERPRISE, - policy::DeviceMode::DEVICE_MODE_ENTERPRISE_AD, policy::DeviceMode::DEVICE_MODE_DEMO}); return kModeEnterprise; }
diff --git a/chromeos/ash/components/drivefs/fake_drivefs.h b/chromeos/ash/components/drivefs/fake_drivefs.h index 70d39d84..d60c64e 100644 --- a/chromeos/ash/components/drivefs/fake_drivefs.h +++ b/chromeos/ash/components/drivefs/fake_drivefs.h
@@ -99,6 +99,18 @@ drivefs::mojom::DriveFs::ImmediatelyUploadCallback callback), (override)); + MOCK_METHOD(void, + UpdateFromPairedDoc, + (const base::FilePath& path, + drivefs::mojom::DriveFs::UpdateFromPairedDocCallback callback), + (override)); + + MOCK_METHOD(void, + GetItemFromCloudStore, + (const base::FilePath& path, + drivefs::mojom::DriveFs::GetItemFromCloudStoreCallback callback), + (override)); + const base::FilePath& mount_path() { return mount_path_; } absl::optional<bool> IsItemPinned(const std::string& path);
diff --git a/chromeos/ash/components/drivefs/mojom/drivefs.mojom b/chromeos/ash/components/drivefs/mojom/drivefs.mojom index 9cb1ca7..3cd2465 100644 --- a/chromeos/ash/components/drivefs/mojom/drivefs.mojom +++ b/chromeos/ash/components/drivefs/mojom/drivefs.mojom
@@ -150,6 +150,14 @@ // Uploads a file by skipping any remaining queue time, if possible. ImmediatelyUpload(mojo_base.mojom.FilePath path) => (FileError error); + + // Forces the server to export any pending paired doc content into a new + // revision. + UpdateFromPairedDoc(mojo_base.mojom.FilePath path) => (FileError error); + + // Pulls the updated file content from the server into the cache, if a newer + // revision is available. + GetItemFromCloudStore(mojo_base.mojom.FilePath path) => (FileError error); }; // Implemented by Chrome, used from DriveFS.
diff --git a/chromeos/ash/services/recording/public/mojom/recording_service.mojom b/chromeos/ash/services/recording/public/mojom/recording_service.mojom index 603573e..ce13a3d 100644 --- a/chromeos/ash/services/recording/public/mojom/recording_service.mojom +++ b/chromeos/ash/services/recording/public/mojom/recording_service.mojom
@@ -92,6 +92,21 @@ // video content should be saved. Only ".webm" and ".gif" are currently // supported. // + // The *optional* pending_remotes `microphone_stream_factory` and + // `system_audio_stream_factory` should be provided if the microphone audio + // and system audio are desired to be recorded respectively. The following + // cases are possible: + // - Both `microphone_stream_factory` and `system_audio_stream_factory` are + // not bound: this means no audio recording is desired. + // - `microphone_stream_factory` is bound: this means only microphone audio is + // desired to be recorded. + // - `system_audio_stream_factory` is bound: this means only system audio is + // desired to be recorded. + // - Both `microphone_stream_factory` and `system_audio_stream_factory` are + // bound: this means both microphone and system audio will be recorded at + // the same time and will be mixed together to produce a single audio stream + // that will be muxed with the video. + // // The *optional* pending_remote `drive_fs_quota_delegate`, if provided, that // means that the given `output_file_path` lives on DriveFS, and the remaining // free space calculations has to be done through this delegate. @@ -122,7 +137,9 @@ RecordFullscreen( pending_remote<RecordingServiceClient> client, pending_remote<viz.mojom.FrameSinkVideoCapturer> video_capturer, - pending_remote<media.mojom.AudioStreamFactory>? audio_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? microphone_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? + system_audio_stream_factory, pending_remote<DriveFsQuotaDelegate>? drive_fs_quota_delegate, mojo_base.mojom.FilePath output_file_path, viz.mojom.FrameSinkId frame_sink_id, @@ -152,7 +169,9 @@ RecordWindow( pending_remote<RecordingServiceClient> client, pending_remote<viz.mojom.FrameSinkVideoCapturer> video_capturer, - pending_remote<media.mojom.AudioStreamFactory>? audio_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? microphone_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? + system_audio_stream_factory, pending_remote<DriveFsQuotaDelegate>? drive_fs_quota_delegate, mojo_base.mojom.FilePath output_file_path, viz.mojom.FrameSinkId frame_sink_id, @@ -177,7 +196,9 @@ RecordRegion( pending_remote<RecordingServiceClient> client, pending_remote<viz.mojom.FrameSinkVideoCapturer> video_capturer, - pending_remote<media.mojom.AudioStreamFactory>? audio_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? microphone_stream_factory, + pending_remote<media.mojom.AudioStreamFactory>? + system_audio_stream_factory, pending_remote<DriveFsQuotaDelegate>? drive_fs_quota_delegate, mojo_base.mojom.FilePath output_file_path, viz.mojom.FrameSinkId frame_sink_id,
diff --git a/chromeos/ash/services/recording/recording_service.cc b/chromeos/ash/services/recording/recording_service.cc index b4967d1..128bb56 100644 --- a/chromeos/ash/services/recording/recording_service.cc +++ b/chromeos/ash/services/recording/recording_service.cc
@@ -207,7 +207,10 @@ void RecordingService::RecordFullscreen( mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, - mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -217,8 +220,9 @@ StartNewRecording( std::move(client), std::move(video_capturer), - std::move(audio_stream_factory), std::move(drive_fs_quota_delegate), - output_file_path, + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), + std::move(drive_fs_quota_delegate), output_file_path, VideoCaptureParams::CreateForFullscreenCapture( frame_sink_id, frame_sink_size_dip, device_scale_factor)); } @@ -226,7 +230,10 @@ void RecordingService::RecordWindow( mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, - mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -237,7 +244,8 @@ DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); StartNewRecording(std::move(client), std::move(video_capturer), - std::move(audio_stream_factory), + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), std::move(drive_fs_quota_delegate), output_file_path, VideoCaptureParams::CreateForWindowCapture( frame_sink_id, subtree_capture_id, frame_sink_size_dip, @@ -247,7 +255,10 @@ void RecordingService::RecordRegion( mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, - mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -257,7 +268,8 @@ DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); StartNewRecording(std::move(client), std::move(video_capturer), - std::move(audio_stream_factory), + std::move(microphone_stream_factory), + std::move(system_audio_stream_factory), std::move(drive_fs_quota_delegate), output_file_path, VideoCaptureParams::CreateForRegionCapture( frame_sink_id, frame_sink_size_dip, device_scale_factor, @@ -462,7 +474,10 @@ void RecordingService::StartNewRecording( mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, - mojo::PendingRemote<media::mojom::AudioStreamFactory> audio_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, std::unique_ptr<VideoCaptureParams> capture_params) { @@ -479,7 +494,7 @@ base::BindOnce(&TerminateServiceImmediately)); current_video_capture_params_ = std::move(capture_params); - const bool should_record_audio = audio_stream_factory.is_valid(); + const bool should_record_audio = microphone_stream_factory.is_valid(); encoder_capabilities_ = CreateEncoderCapabilities(output_file_path); encoder_muxer_ = CreateEncoder( @@ -495,7 +510,7 @@ return; audio_capturer_ = audio::CreateInputDevice( - std::move(audio_stream_factory), + std::move(microphone_stream_factory), std::string(media::AudioDeviceDescription::kDefaultDeviceId), audio::DeadStreamDetection::kEnabled); DCHECK(audio_capturer_);
diff --git a/chromeos/ash/services/recording/recording_service.h b/chromeos/ash/services/recording/recording_service.h index b645371..e0ade5d1 100644 --- a/chromeos/ash/services/recording/recording_service.h +++ b/chromeos/ash/services/recording/recording_service.h
@@ -55,7 +55,9 @@ mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, mojo::PendingRemote<media::mojom::AudioStreamFactory> - audio_stream_factory, + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -65,7 +67,9 @@ mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, mojo::PendingRemote<media::mojom::AudioStreamFactory> - audio_stream_factory, + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -77,7 +81,9 @@ mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, mojo::PendingRemote<media::mojom::AudioStreamFactory> - audio_stream_factory, + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, const viz::FrameSinkId& frame_sink_id, @@ -122,7 +128,9 @@ mojo::PendingRemote<mojom::RecordingServiceClient> client, mojo::PendingRemote<viz::mojom::FrameSinkVideoCapturer> video_capturer, mojo::PendingRemote<media::mojom::AudioStreamFactory> - audio_stream_factory, + microphone_stream_factory, + mojo::PendingRemote<media::mojom::AudioStreamFactory> + system_audio_stream_factory, mojo::PendingRemote<mojom::DriveFsQuotaDelegate> drive_fs_quota_delegate, const base::FilePath& output_file_path, std::unique_ptr<VideoCaptureParams> capture_params);
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 8c03f0cc..72f378d 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-115-5735.6-1682934552-benchmark-115.0.5755.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-115-5735.12-1683543901-benchmark-115.0.5758.0-r1-redacted.afdo.xz
diff --git a/chromeos/ui/base/window_properties.cc b/chromeos/ui/base/window_properties.cc index 262c0c9..76ee889 100644 --- a/chromeos/ui/base/window_properties.cc +++ b/chromeos/ui/base/window_properties.cc
@@ -24,6 +24,7 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kEscHoldToExitFullscreen, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kUseOverviewToExitFullscreen, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kUseOverviewToExitPointerLock, false) +DEFINE_UI_CLASS_PROPERTY_KEY(bool, kNoExitFullscreenOnLock, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kTrackDefaultFrameColors, true) DEFINE_UI_CLASS_PROPERTY_KEY(SkColor, kFrameActiveColorKey, kDefaultFrameColor)
diff --git a/chromeos/ui/base/window_properties.h b/chromeos/ui/base/window_properties.h index ddc3fae0..5c02b744 100644 --- a/chromeos/ui/base/window_properties.h +++ b/chromeos/ui/base/window_properties.h
@@ -38,6 +38,14 @@ COMPONENT_EXPORT(CHROMEOS_UI_BASE) extern const ui::ClassProperty<bool>* const kEscHoldToExitFullscreen; +// Do not exit fullscreen on a screen lock. Note that this property becomes +// active only if `kUseOverviewToExitFullscreen` is true. Borealis apps set this +// to avoid exiting fullscreen on a screen lock. +// Do NOT use this property without consulting the security team for other use +// cases. +COMPONENT_EXPORT(CHROMEOS_UI_BASE) +extern const ui::ClassProperty<bool>* const kNoExitFullscreenOnLock; + // Whether to promote users to use Overview to exit fullscreen. // Borealis apps set this since they do not handle window size changes. COMPONENT_EXPORT(CHROMEOS_UI_BASE)
diff --git a/components/autofill/core/browser/personal_data_manager_cleaner.cc b/components/autofill/core/browser/personal_data_manager_cleaner.cc index 97cf305..e40c532 100644 --- a/components/autofill/core/browser/personal_data_manager_cleaner.cc +++ b/components/autofill/core/browser/personal_data_manager_cleaner.cc
@@ -168,11 +168,6 @@ } bool PersonalDataManagerCleaner::ApplyDedupingRoutine() { - if (!base::FeatureList::IsEnabled( - features::kAutofillEnableProfileDeduplication)) { - return false; - } - // Check if de-duplication has already been performed on this major version. if (!is_autofill_profile_cleanup_pending_) { DVLOG(1)
diff --git a/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc b/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc index 0f3c24c..ba1de55 100644 --- a/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc
@@ -271,9 +271,6 @@ // based on the deduped profiles. TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_CardsBillingAddressIdUpdated) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); - // A set of 6 profiles will be created. They should merge in this way: // 1 -> 2 -> 3 // 4 -> 5 @@ -414,9 +411,6 @@ // ranking score. TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_MergedProfileValues) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); - // Create a profile with a higher ranking score. AutofillProfile profile1; test::SetProfileInfo(&profile1, "Homer", "J", "Simpson", @@ -499,9 +493,6 @@ // that the resulting profiles have the right values. It has no effect on the // other profiles. TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_MultipleDedupes) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); - // Create a Homer home profile with a higher ranking score than other Homer // profiles. AutofillProfile Homer1; @@ -609,17 +600,12 @@ } TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_NopIfZeroProfiles) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); EXPECT_TRUE(personal_data_->GetProfiles().empty()); EXPECT_FALSE( personal_data_manager_cleaner_->ApplyDedupingRoutineForTesting()); } TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_NopIfOneProfile) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); - // Create a profile to dedupe. AutofillProfile profile; test::SetProfileInfo(&profile, "Homer", "J", "Simpson", @@ -636,9 +622,6 @@ // Tests that ApplyDedupingRoutine is not run a second time on the same major // version. TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_OncePerVersion) { - base::test::ScopedFeatureList feature; - feature.InitAndEnableFeature(features::kAutofillEnableProfileDeduplication); - // Create a profile to dedupe. AutofillProfile profile1; test::SetProfileInfo(&profile1, "Homer", "J", "Simpson",
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index d60218ae..8a81254 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -235,12 +235,6 @@ "AutofillEnableLabelPrecedenceForTurkishAddresses", base::FEATURE_DISABLED_BY_DEFAULT); -// When enabled, the address profile deduplication logic runs after the browser -// startup, once per chrome version. -BASE_FEATURE(kAutofillEnableProfileDeduplication, - "AutofillEnableProfileDeduplication", - base::FEATURE_ENABLED_BY_DEFAULT); - // Controls if Autofill supports merging subset names. // TODO(crbug.com/1098943): Remove once launched. BASE_FEATURE(kAutofillEnableSupportForMergingSubsetNames,
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index e0d6143..f087439e 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -90,8 +90,6 @@ COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableLabelPrecedenceForTurkishAddresses); COMPONENT_EXPORT(AUTOFILL) -BASE_DECLARE_FEATURE(kAutofillEnableProfileDeduplication); -COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableSupportForParsingWithSharedLabels); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableSupportForMergingSubsetNames);
diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd index efd6183..90dc200c 100644 --- a/components/browser_ui/strings/android/browser_ui_strings.grd +++ b/components/browser_ui/strings/android/browser_ui_strings.grd
@@ -887,6 +887,9 @@ <message name="IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION" desc="Notification message when a site has entered immersive fullscreen and the directions of how to exit."> Drag from top and touch the back button to exit full screen. </message> + <message name="IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION_AUTOMOTIVE" desc="Notification message when a site has entered immersive fullscreen and the directions of how to exit."> + Press the back button to exit full screen. + </message> <!-- WebApk name/icon report abuse dialog --> <message name="IDS_WEBAPK_REPORT_ABUSE_DIALOG_TITLE" desc="The title at the top of the report abuse dialog.">
diff --git a/components/browser_ui/strings/android/browser_ui_strings_grd/IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION_AUTOMOTIVE.png.sha1 b/components/browser_ui/strings/android/browser_ui_strings_grd/IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION_AUTOMOTIVE.png.sha1 new file mode 100644 index 0000000..ba029a30 --- /dev/null +++ b/components/browser_ui/strings/android/browser_ui_strings_grd/IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION_AUTOMOTIVE.png.sha1
@@ -0,0 +1 @@ +7ca4253d6eaeba366f48b1c2f9753310f8c9586b \ No newline at end of file
diff --git a/components/browser_ui/styles/android/java/res/values-night/colors.xml b/components/browser_ui/styles/android/java/res/values-night/colors.xml index d950ab1..2eab07d 100644 --- a/components/browser_ui/styles/android/java/res/values-night/colors.xml +++ b/components/browser_ui/styles/android/java/res/values-night/colors.xml
@@ -18,4 +18,6 @@ <!-- Empty states colors --> <color name="empty_state_icon_color">@color/material_primary_200</color> <color name="empty_state_icon_bg_color">@color/material_primary_800</color> + <color name="empty_state_icon_bg_background_color">@color/material_primary_900</color> + <color name="empty_state_icon_bg_foreground_color">@color/material_primary_800</color> </resources>
diff --git a/components/browser_ui/styles/android/java/res/values-v31/colors.xml b/components/browser_ui/styles/android/java/res/values-v31/colors.xml index 5cc0099..b0cf6de 100644 --- a/components/browser_ui/styles/android/java/res/values-v31/colors.xml +++ b/components/browser_ui/styles/android/java/res/values-v31/colors.xml
@@ -7,8 +7,10 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- GM3 dynamic colors for Android S and above.--> + <color name="material_primary_900">@color/material_dynamic_primary10</color> <color name="material_primary_800">@color/material_dynamic_primary20</color> <color name="material_primary_600">@color/material_dynamic_primary40</color> <color name="material_primary_200">@color/material_dynamic_primary80</color> + <color name="material_primary_100">@color/material_dynamic_primary90</color> <color name="material_primary_50">@color/material_dynamic_primary95</color> </resources> \ No newline at end of file
diff --git a/components/browser_ui/styles/android/java/res/values/colors.xml b/components/browser_ui/styles/android/java/res/values/colors.xml index 2d81546..475ff39 100644 --- a/components/browser_ui/styles/android/java/res/values/colors.xml +++ b/components/browser_ui/styles/android/java/res/values/colors.xml
@@ -54,5 +54,7 @@ <!-- Clank Empty States Colors--> <color name="empty_state_icon_bg_color">@color/material_primary_50</color> + <color name="empty_state_icon_bg_background_color">@color/material_primary_50</color> + <color name="empty_state_icon_bg_foreground_color">@color/material_primary_100</color> <color name="empty_state_icon_color">@color/material_primary_600</color> </resources>
diff --git a/components/browser_ui/widget/android/java/res/layout/empty_state_view.xml b/components/browser_ui/widget/android/java/res/layout/empty_state_view.xml index 812f79d..70707c8 100644 --- a/components/browser_ui/widget/android/java/res/layout/empty_state_view.xml +++ b/components/browser_ui/widget/android/java/res/layout/empty_state_view.xml
@@ -5,51 +5,43 @@ found in the LICENSE file. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/empty_state_container" android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/default_list_row_padding" + android:layout_marginStart="@dimen/default_list_row_padding" + android:gravity="center" + android:padding="@dimen/card_padding" + android:scaleType="fitCenter" + android:autoSizeTextType="uniform" + android:orientation="vertical"> - <LinearLayout - android:id="@+id/empty_state_container" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/default_list_row_padding" - android:layout_marginStart="@dimen/default_list_row_padding" - android:gravity="center" - android:padding="@dimen/card_padding" - android:orientation="vertical"> - - <ImageView - android:id="@+id/empty_state_icon" - android:contentDescription="@null" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - - <!-- TODO(crbugs/1439882) Replace the type style when '18pt Google Sans with 24pt leading' become available in Clank --> - <org.chromium.ui.widget.TextViewWithLeading - android:id="@+id/empty_state_text_title" - android:maxWidth="@dimen/empty_state_text_width" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAlignment="center" - android:textAppearance="@style/TextAppearance.TextLarge.Secondary" - app:leading="@dimen/text_size_large_leading"/> - - <org.chromium.ui.widget.TextViewWithLeading - android:id="@+id/empty_state_text_description" - android:maxWidth="@dimen/empty_state_text_width" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingTop="@dimen/empty_state_subheading_padding_top" - android:textAlignment="center" - android:textAppearance="@style/TextAppearance.TextMedium.Secondary" - app:leading="@dimen/text_size_medium_leading"/> - </LinearLayout> - - <org.chromium.ui.widget.LoadingView - android:id="@+id/empty_state_loading" + <ImageView + android:id="@+id/empty_state_icon" + android:contentDescription="@null" android:layout_width="wrap_content" android:layout_height="wrap_content" /> -</FrameLayout> + <!-- TODO(crbugs/1439882) Replace the type style when '18pt Google Sans with 24pt leading' become available in Clank --> + <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/empty_state_text_title" + android:maxWidth="@dimen/empty_state_text_width" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.TextLarge.Secondary" + app:leading="@dimen/text_size_large_leading"/> + + <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/empty_state_text_description" + android:maxWidth="@dimen/empty_state_text_width" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="@dimen/empty_state_subheading_padding_top" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.TextMedium.Secondary" + app:leading="@dimen/text_size_medium_leading"/> +</LinearLayout> +
diff --git a/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml b/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml index 0085748f..9ba75701 100644 --- a/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml +++ b/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml
@@ -37,6 +37,13 @@ android:visibility="gone" android:scrollbars="vertical" /> + <ViewStub + android:id="@+id/empty_state_view_stub" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout="@layout/empty_state_view" + android:layout_gravity="center" + android:padding="@dimen/card_padding" /> <org.chromium.components.browser_ui.widget.MaterialCardViewNoShadow android:id="@+id/empty_view_wrapper"
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableListLayout.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableListLayout.java index a0f3561f..03650e3b 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableListLayout.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableListLayout.java
@@ -12,6 +12,7 @@ import android.view.View; import android.view.ViewStub; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.Nullable; @@ -58,7 +59,9 @@ private RecyclerView.Adapter mAdapter; private ViewStub mToolbarStub; private TextView mEmptyView; + private TextView mEmptyStateSubHeadingView; private View mEmptyViewWrapper; + private ImageView mEmptyImageView; private LoadingView mLoadingView; private RecyclerView mRecyclerView; private ItemAnimator mItemAnimator; @@ -242,6 +245,32 @@ } /** + * Initializes the empty state view with an image, heading, and subheading. + * @param imageResId Image view to show when the selectable list is empty. + * @param emptyHeadingStringResId Heading string to show when the selectable list is empty. + * @param emptySubheadingStringResId SubString to show when the selectable list is empty. + * @return The {@link TextView} displayed when the list is empty. + */ + // @TODO: (crbugs.com/1443648) Refactor return value for ForTesting method + public TextView initializeEmptyStateView( + int imageResId, int emptyHeadingStringResId, int emptySubheadingStringResId) { + // Initialize and inflate empty state view stub. + ViewStub emptyViewStub = findViewById(R.id.empty_state_view_stub); + View emptyStateView = emptyViewStub.inflate(); + + // Initialize empty state resource. + mEmptyView = emptyStateView.findViewById(R.id.empty_state_text_title); + mEmptyStateSubHeadingView = emptyStateView.findViewById(R.id.empty_state_text_description); + mEmptyImageView = emptyStateView.findViewById(R.id.empty_state_icon); + mEmptyViewWrapper = emptyStateView.findViewById(R.id.empty_state_container); + + // Set empty state properties. + mEmptyImageView.setImageResource(imageResId); + setEmptyStateViewText(emptyHeadingStringResId, emptySubheadingStringResId); + return mEmptyView; + } + + /** * Sets the view text when the selectable list is empty. * @param emptyStringResId The string to show when the selectable list is empty. */ @@ -252,6 +281,18 @@ } /** + * Sets the view text when the selectable list is empty. + * @param emptyStringResId Heading string to show when the selectable list is empty. + * @param emptySubheadingStringResId SubString to show when the selectable list is empty. + */ + public void setEmptyStateViewText(int emptyHeadingStringResId, int emptySubheadingStringResId) { + mEmptyStringResId = emptyHeadingStringResId; + + mEmptyView.setText(mEmptyStringResId); + mEmptyStateSubHeadingView.setText(emptySubheadingStringResId); + } + + /** * Called when the view that owns the SelectableListLayout is destroyed. */ public void onDestroyed() {
diff --git a/components/exo/BUILD.gn b/components/exo/BUILD.gn index 5fba7eb..8482d3b 100644 --- a/components/exo/BUILD.gn +++ b/components/exo/BUILD.gn
@@ -307,6 +307,7 @@ "//base/test:test_support", "//cc", "//cc:test_support", + "//chromeos/ash/components/login/auth", "//chromeos/dbus/power", "//chromeos/dbus/power:power_manager_proto", "//chromeos/ui/base",
diff --git a/components/exo/DEPS b/components/exo/DEPS index 9612462..f58ece5 100644 --- a/components/exo/DEPS +++ b/components/exo/DEPS
@@ -33,6 +33,7 @@ "+components/viz/test", ], "ui_lock_controller_unittest\.cc": [ + "+chromeos/ash/components/login/auth", "+chromeos/dbus/power", "+chromeos/dbus/power_manager", ],
diff --git a/components/exo/ui_lock_controller.cc b/components/exo/ui_lock_controller.cc index fed387b..723e74a 100644 --- a/components/exo/ui_lock_controller.cc +++ b/components/exo/ui_lock_controller.cc
@@ -217,6 +217,14 @@ } } + // Notify again but this only notifies again the fullscreen notifier. + void NotifyAgainForFullscreen() { + ash::WindowState* window_state = ash::WindowState::Get(window_); + if (window_state->IsFullscreen()) { + OnFullscreen(); + } + } + void OnWindowDestroying(aura::Window* window) override { window_observation_.Reset(); window_state_observation_.Reset(); @@ -578,11 +586,17 @@ void UILockController::OnSurfaceFocused(Surface* gained_focus, Surface* lost_focus, bool has_focused_surface) { - if (gained_focus != focused_surface_to_unlock_) + if (gained_focus != focused_surface_to_unlock_) { StopTimer(); + } - if (gained_focus) - GetExitNotifier(this, gained_focus->window(), true); + if (gained_focus) { + ExitNotifier* exit_notifier = + GetExitNotifier(this, gained_focus->window(), true); + if (exit_notifier) { + exit_notifier->NotifyAgainForFullscreen(); + } + } } void UILockController::OnPointerCaptureEnabled(Pointer* pointer,
diff --git a/components/exo/ui_lock_controller_unittest.cc b/components/exo/ui_lock_controller_unittest.cc index 7557d14..cee83d0 100644 --- a/components/exo/ui_lock_controller_unittest.cc +++ b/components/exo/ui_lock_controller_unittest.cc
@@ -10,6 +10,7 @@ #include "base/feature_list.h" #include "base/test/power_monitor_test.h" #include "base/test/scoped_feature_list.h" +#include "chromeos/ash/components/login/auth/auth_events_recorder.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/power_manager/backlight.pb.h" @@ -138,6 +139,14 @@ void SetUp() override { test::ExoTestBase::SetUp(); seat_ = std::make_unique<Seat>(); + + // Order of window activations and observer callbacks is not trivial, e.g. + // lock screen widget is active when `OnLockStateChanged(locked=false)` + // callback is called. It's better to test them with views. + // `AuthEventsRecorder` is required for `set_show_lock_screen_views=true`. + auth_events_recorder_ = ash::AuthEventsRecorder::CreateForTesting(); + GetSessionControllerClient()->set_show_lock_screen_views(true); + WMHelper::GetInstance()->RegisterAppPropertyResolver( std::make_unique<TestPropertyResolver>()); } @@ -183,6 +192,7 @@ std::unique_ptr<Seat> seat_; base::test::ScopedFeatureList scoped_feature_list_; + std::unique_ptr<ash::AuthEventsRecorder> auth_events_recorder_; }; TEST_F(UILockControllerTest, HoldingEscapeExitsFullscreen) { @@ -577,6 +587,9 @@ } TEST_F(UILockControllerTest, PointerLockNotificationReshownOnUnlock) { + // Lock screen takes focus and it disables pointer capture. + GetSessionControllerClient()->set_show_lock_screen_views(false); + // Arrange: Set up a pointer capture notification, then let it expire. std::unique_ptr<ShellSurface> test_surface = BuildSurface(1024, 768); test_surface->SetApplicationId(kOverviewToExitAppId);
diff --git a/components/flags_ui/flags_test_helpers.cc b/components/flags_ui/flags_test_helpers.cc index 3802cd61..24eea3b 100644 --- a/components/flags_ui/flags_test_helpers.cc +++ b/components/flags_ui/flags_test_helpers.cc
@@ -24,23 +24,12 @@ namespace { -// Type of flag ownership file. -enum class FlagFile { kFlagMetadata, kFlagNeverExpire }; +constexpr char kMetadataFileName[] = "flag-metadata.json"; +constexpr char kNeverExpireFileName[] = "flag-never-expire-list.json"; -// Returns the filename based on the file enum. -std::string FlagFileName(FlagFile file) { - switch (file) { - case FlagFile::kFlagMetadata: - return "flag-metadata.json"; - case FlagFile::kFlagNeverExpire: - return "flag-never-expire-list.json"; - } -} - -// Returns the JSON file contents. -base::Value FileContents(FlagFile file) { - std::string filename = FlagFileName(file); - +// Returns the file contents of a named file under $SRC/chrome/browser +// interpreted as a JSON value. +base::Value ReadFileContentsAsJSON(const std::string& filename) { base::FilePath metadata_path; base::PathService::Get(base::DIR_SOURCE_ROOT, &metadata_path); JSONFileValueDeserializer deserializer( @@ -50,8 +39,8 @@ std::string error_message; std::unique_ptr<base::Value> json = deserializer.Deserialize(&error_code, &error_message); - DCHECK(json) << "Failed to load " << filename << ": " << error_code << " " - << error_message; + CHECK(json) << "Failed to load " << filename << ": " << error_code << " " + << error_message; return std::move(*json); } @@ -66,7 +55,7 @@ // Reads the flag metadata file. FlagMetadataMap LoadFlagMetadata() { - base::Value metadata_json = FileContents(FlagFile::kFlagMetadata); + base::Value metadata_json = ReadFileContentsAsJSON(kMetadataFileName); FlagMetadataMap metadata; for (const auto& entry_val : metadata_json.GetList()) { @@ -86,7 +75,7 @@ } std::vector<std::string> LoadFlagNeverExpireList() { - base::Value list_json = FileContents(FlagFile::kFlagNeverExpire); + base::Value list_json = ReadFileContentsAsJSON(kNeverExpireFileName); std::vector<std::string> result; for (const auto& entry : list_json.GetList()) { @@ -149,29 +138,6 @@ return owner.find_first_of(R"(()<>[]:;@\,/)") == std::string::npos; } -void EnsureNamesAreAlphabetical( - const std::vector<std::string>& normalized_names, - const std::vector<std::string>& names, - FlagFile file) { - if (normalized_names.size() < 2) - return; - - for (size_t i = 1; i < normalized_names.size(); ++i) { - if (i == normalized_names.size() - 1) { - // The last item on the list has less context. - EXPECT_TRUE(normalized_names[i - 1] < normalized_names[i]) - << "Correct alphabetical order does not place '" << names[i] - << "' after '" << names[i - 1] << "' in " << FlagFileName(file); - } else { - EXPECT_TRUE(normalized_names[i - 1] < normalized_names[i] && - normalized_names[i] < normalized_names[i + 1]) - << "Correct alphabetical order does not place '" << names[i] - << "' between '" << names[i - 1] << "' and '" << names[i + 1] - << "' in " << FlagFileName(file); - } - } -} - std::string NormalizeName(const std::string& name) { std::string normalized_name = base::ToLowerASCII(name); std::replace(normalized_name.begin(), normalized_name.end(), '_', '-'); @@ -179,6 +145,91 @@ return normalized_name; } +constexpr char kStartSentinel[] = "(start of file)"; + +using NameNameMap = std::map<std::string, std::string>; +using NameVector = std::vector<std::string>; + +// Given a NameVector, returns a map from each name n to the name preceding n in +// the NameVector. The returned map maps the first name to kStartSentinel. +// Preconditions: +// * There are no duplicates in |strings| +// * No entry in |strings| equals kStartSentinel +// Postconditions: +// * Every entry in |strings| appears as a key in the result map +// * Every entry in |strings| maps to another entry in |strings| or to +// kStartSentinel in the result map +NameNameMap BuildAfterMap(const NameVector& strings) { + NameNameMap after_map; + CHECK_NE(strings[0], kStartSentinel); + after_map[strings[0]] = kStartSentinel; + for (size_t i = 1; i < strings.size(); ++i) { + CHECK_NE(strings[i], kStartSentinel); + CHECK(!after_map.contains(strings[i])); + after_map[strings[i]] = strings[i - 1]; + } + + // Postconditions: + for (const auto& entry : strings) { + CHECK(after_map.contains(entry)); + } + + return after_map; +} + +// Given a vector of names, returns a vector of normalized names, and an inverse +// mapping from normalized name to previous name. The inverse mapping is +// populated only for names which were altered when normalized. +// Preconditions: none +// Postconditions: +// * Every (key, value) pair in |denormalized| have key != value +// * Every (key, value) pair in |denormalized| have key = NormalizeName(value) +std::pair<NameVector, NameNameMap> NormalizeNames(const NameVector& names) { + NameNameMap denormalized; + NameVector normalized; + for (const auto& name : names) { + std::string n = NormalizeName(name); + normalized.push_back(n); + if (n != name) { + denormalized[n] = name; + } + } + + // Postconditions: + for (const auto& pair : denormalized) { + CHECK_NE(pair.first, pair.second); + CHECK_EQ(pair.first, NormalizeName(pair.second)); + } + + return std::tie(normalized, denormalized); +} + +// Given a list of flag names, adds test failures for any that do not appear in +// alphabetical order. This is more complex than simply sorting the list and +// checking whether the order changed - this function is supposed to emit error +// messages which tell the user specifically which flags need to be moved and to +// where in the file. +void EnsureNamesAreAlphabetical(const NameVector& names, + const std::string& filename) { + auto [normalized, denormalized] = NormalizeNames(names); + auto was_after = BuildAfterMap(normalized); + + std::sort(normalized.begin(), normalized.end()); + auto goes_after = BuildAfterMap(normalized); + + auto denormalize = [&](const std::string& name) { + return denormalized.contains(name) ? denormalized[name] : name; + }; + + for (const auto& n : normalized) { + if (was_after[n] != goes_after[n]) { + ADD_FAILURE() << "In '" << filename << "': flag '" << denormalize(n) + << "' should be right after '" << denormalize(goes_after[n]) + << "'"; + } + } +} + bool IsUnexpireFlagFor(const flags_ui::FeatureEntry& entry, int milestone) { std::string expected_flag = base::StringPrintf("temporary-unexpire-flags-m%d", milestone); @@ -273,29 +324,24 @@ } void EnsureFlagsAreListedInAlphabeticalOrder() { - base::Value metadata_json = FileContents(FlagFile::kFlagMetadata); - - std::vector<std::string> normalized_names; - std::vector<std::string> names; - for (const auto& entry_val : metadata_json.GetList()) { - const base::Value::Dict& entry = entry_val.GetDict(); - normalized_names.push_back(NormalizeName(*entry.FindString("name"))); - names.push_back(*entry.FindString("name")); + { + auto json = ReadFileContentsAsJSON(kMetadataFileName); + std::vector<std::string> names; + for (const auto& entry : json.GetList()) { + names.push_back(*entry.GetDict().FindString("name")); + } + EnsureNamesAreAlphabetical(names, kMetadataFileName); } - EnsureNamesAreAlphabetical(normalized_names, names, FlagFile::kFlagMetadata); + { + auto json = ReadFileContentsAsJSON(kNeverExpireFileName); + std::vector<std::string> names; + for (const auto& entry : json.GetList()) { + names.push_back(entry.GetString()); + } - base::Value expiration_json = FileContents(FlagFile::kFlagNeverExpire); - - normalized_names.clear(); - names.clear(); - for (const auto& entry : expiration_json.GetList()) { - normalized_names.push_back(NormalizeName(entry.GetString())); - names.push_back(entry.GetString()); + EnsureNamesAreAlphabetical(names, kNeverExpireFileName); } - - EnsureNamesAreAlphabetical(normalized_names, names, - FlagFile::kFlagNeverExpire); } // TODO(https://crbug.com/1241068): Call this from the iOS flags unittests once
diff --git a/components/history/core/test/BUILD.gn b/components/history/core/test/BUILD.gn index 2c6132bc9..3ffa2aae 100644 --- a/components/history/core/test/BUILD.gn +++ b/components/history/core/test/BUILD.gn
@@ -44,6 +44,7 @@ if (is_ios) { sources += [ "thumbnail_ios.mm" ] + configs += [ "//build/config/compiler:enable_arc" ] } else { sources += [ "thumbnail.cc" ] }
diff --git a/components/history/core/test/thumbnail_ios.mm b/components/history/core/test/thumbnail_ios.mm index 70e454b..65fa7c5 100644 --- a/components/history/core/test/thumbnail_ios.mm +++ b/components/history/core/test/thumbnail_ios.mm
@@ -10,6 +10,10 @@ #include "components/history/core/test/thumbnail-inl.h" #include "ui/gfx/image/image.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace history { gfx::Image CreateGoogleThumbnailForTest() { @@ -22,8 +26,7 @@ static_cast<const void*>(kGoogleThumbnail)) length:sizeof(kGoogleThumbnail) freeWhenDone:NO]; - UIImage* image = [UIImage imageWithData:data scale:1]; - return gfx::Image([image retain]); + return gfx::Image([UIImage imageWithData:data scale:1]); } }
diff --git a/components/language/ios/browser/ios_language_detection_tab_helper.mm b/components/language/ios/browser/ios_language_detection_tab_helper.mm index d8b27c2..0eaf7b1 100644 --- a/components/language/ios/browser/ios_language_detection_tab_helper.mm +++ b/components/language/ios/browser/ios_language_detection_tab_helper.mm
@@ -25,6 +25,10 @@ #import "ios/web/public/navigation/navigation_context.h" #include "net/http/http_response_headers.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace language { // Note: This should stay in sync with the constant in language_detection.js.
diff --git a/components/metrics/net/net_metrics_log_uploader.cc b/components/metrics/net/net_metrics_log_uploader.cc index 55ea9d4..b7450bb 100644 --- a/components/metrics/net/net_metrics_log_uploader.cc +++ b/components/metrics/net/net_metrics_log_uploader.cc
@@ -22,7 +22,6 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" -#include "services/network/public/cpp/simple_url_loader_throttle.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h" #include "third_party/metrics_proto/reporting_info.pb.h" @@ -332,9 +331,6 @@ url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request), traffic_annotation); - if (network::SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)) - url_loader_->SetAllowBatching(); - if (should_encrypt) { std::string encrypted_message; if (!EncryptString(compressed_log_data, &encrypted_message)) {
diff --git a/components/nacl/loader/BUILD.gn b/components/nacl/loader/BUILD.gn index 2bb50210..cef9660 100644 --- a/components/nacl/loader/BUILD.gn +++ b/components/nacl/loader/BUILD.gn
@@ -52,6 +52,7 @@ if (is_mac) { sources += [ "nacl_main_platform_delegate_mac.mm" ] + configs += [ "//build/config/compiler:enable_arc" ] } if (is_linux || is_chromeos) {
diff --git a/components/nacl/loader/nacl_main_platform_delegate_mac.mm b/components/nacl/loader/nacl_main_platform_delegate_mac.mm index 6970388..6546876 100644 --- a/components/nacl/loader/nacl_main_platform_delegate_mac.mm +++ b/components/nacl/loader/nacl_main_platform_delegate_mac.mm
@@ -4,6 +4,10 @@ #include "components/nacl/loader/nacl_main_platform_delegate.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + void NaClMainPlatformDelegate::EnableSandbox( const content::MainFunctionParams& parameters) { // The sandbox on macOS is enabled as soon as main() executes, so there is
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn index 884831eeb..2820f7b 100644 --- a/components/ntp_tiles/BUILD.gn +++ b/components/ntp_tiles/BUILD.gn
@@ -79,6 +79,7 @@ "country_code_ios.h", "country_code_ios.mm", ] + configs += [ "//build/config/compiler:enable_arc" ] } if (enable_extensions) {
diff --git a/components/ntp_tiles/country_code_ios.mm b/components/ntp_tiles/country_code_ios.mm index b6ac40a1..b3a090b 100644 --- a/components/ntp_tiles/country_code_ios.mm +++ b/components/ntp_tiles/country_code_ios.mm
@@ -7,9 +7,13 @@ #include "base/strings/sys_string_conversions.h" #include "components/ntp_tiles/country_code_ios.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + std::string ntp_tiles::GetDeviceCountryCode() { - NSLocale *current_locale = [NSLocale currentLocale]; - NSString *country_code = [current_locale objectForKey:NSLocaleCountryCode]; + NSString* country_code = + [NSLocale.currentLocale objectForKey:NSLocaleCountryCode]; return base::SysNSStringToUTF8(country_code); }
diff --git a/components/password_manager/core/browser/ui/bulk_leak_check_service_adapter_unittest.cc b/components/password_manager/core/browser/ui/bulk_leak_check_service_adapter_unittest.cc index fd242eb7..a764588 100644 --- a/components/password_manager/core/browser/ui/bulk_leak_check_service_adapter_unittest.cc +++ b/components/password_manager/core/browser/ui/bulk_leak_check_service_adapter_unittest.cc
@@ -15,7 +15,9 @@ #include "base/strings/string_piece_forward.h" #include "base/strings/utf_string_conversions.h" #include "base/test/gmock_move_support.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" +#include "components/password_manager/core/browser/affiliation/fake_affiliation_service.h" #include "components/password_manager/core/browser/affiliation/mock_affiliation_service.h" #include "components/password_manager/core/browser/bulk_leak_check_service.h" #include "components/password_manager/core/browser/leak_detection/bulk_leak_check.h" @@ -25,6 +27,7 @@ #include "components/password_manager/core/browser/password_form.h" #include "components/password_manager/core/browser/test_password_store.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" +#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" @@ -94,9 +97,14 @@ using NiceMockBulkLeakCheck = ::testing::NiceMock<MockBulkLeakCheck>; -class BulkLeakCheckServiceAdapterTest : public ::testing::Test { +class BulkLeakCheckServiceAdapterTest : public testing::TestWithParam<bool> { public: BulkLeakCheckServiceAdapterTest() { + if (GetParam()) { + feature_list_.InitAndEnableFeature(features::kPasswordsGrouping); + } else { + feature_list_.InitAndDisableFeature(features::kPasswordsGrouping); + } auto factory = std::make_unique<MockLeakDetectionCheckFactory>(); factory_ = factory.get(); service_.set_leak_factory(std::move(factory)); @@ -124,11 +132,12 @@ void RunUntilIdle() { task_env_.RunUntilIdle(); } private: + base::test::ScopedFeatureList feature_list_; base::test::TaskEnvironment task_env_; signin::IdentityTestEnvironment identity_test_env_; scoped_refptr<TestPasswordStore> store_ = base::MakeRefCounted<TestPasswordStore>(); - MockAffiliationService affiliation_service_; + FakeAffiliationService affiliation_service_; SavedPasswordsPresenter presenter_{&affiliation_service_, store_, /*account_store=*/nullptr}; BulkLeakCheckService service_{ @@ -141,7 +150,7 @@ } // namespace -TEST_F(BulkLeakCheckServiceAdapterTest, OnCreation) { +TEST_P(BulkLeakCheckServiceAdapterTest, OnCreation) { EXPECT_EQ(0u, adapter().GetPendingChecksCount()); EXPECT_EQ(BulkLeakCheckService::State::kIdle, adapter().GetBulkLeakCheckState()); @@ -150,7 +159,7 @@ // Checks that starting a leak check correctly transforms the list of saved // passwords into LeakCheckCredentials and attaches the underlying password // forms as user data. -TEST_F(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheck) { +TEST_P(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheck) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kPassword1), MakeSavedPassword(kExampleOrg, kUsername2, kPassword2)}; @@ -175,7 +184,7 @@ EXPECT_THAT(credentials, CredentialsAre(std::cref(expected))); } -TEST_F(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheckAttachesData) { +TEST_P(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheckAttachesData) { constexpr char kKey[] = "key"; struct UserData : LeakCheckCredential::Data { std::unique_ptr<Data> Clone() override { return std::make_unique<Data>(); } @@ -201,7 +210,7 @@ // Tests that multiple credentials with effectively the same username are // correctly deduped before starting the leak check. -TEST_F(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheckDedupes) { +TEST_P(BulkLeakCheckServiceAdapterTest, StartBulkLeakCheckDedupes) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, u"alice", kPassword1), MakeSavedPassword(kExampleCom, u"ALICE", kPassword1), @@ -229,7 +238,7 @@ // Checks that trying to start a leak check when another check is already // running does nothing and returns false to the caller. -TEST_F(BulkLeakCheckServiceAdapterTest, MultipleStarts) { +TEST_P(BulkLeakCheckServiceAdapterTest, MultipleStarts) { store().AddLogin(MakeSavedPassword(kExampleCom, u"alice", kPassword1)); RunUntilIdle(); @@ -246,7 +255,7 @@ // Checks that stopping the leak check correctly resets the state of the bulk // leak check. -TEST_F(BulkLeakCheckServiceAdapterTest, StopBulkLeakCheck) { +TEST_P(BulkLeakCheckServiceAdapterTest, StopBulkLeakCheck) { store().AddLogin(MakeSavedPassword(kExampleCom, u"alice", kPassword1)); RunUntilIdle(); @@ -266,7 +275,7 @@ // Tests that editing a password through the presenter does not result in // another call to CheckCredentials with a corresponding change to the checked // password if the corresponding prefs are not set. -TEST_F(BulkLeakCheckServiceAdapterTest, OnEditedNoPrefs) { +TEST_P(BulkLeakCheckServiceAdapterTest, OnEditedNoPrefs) { prefs().SetBoolean(prefs::kPasswordLeakDetectionEnabled, false); prefs().SetBoolean(::prefs::kSafeBrowsingEnabled, false); @@ -287,7 +296,7 @@ // Tests that editing a password through the presenter will result in another // call to CheckCredentials with a corresponding change to the checked password // if the corresponding prefs are set. -TEST_F(BulkLeakCheckServiceAdapterTest, OnEditedWithPrefs) { +TEST_P(BulkLeakCheckServiceAdapterTest, OnEditedWithPrefs) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.in_store = PasswordForm::Store::kProfileStore; @@ -310,4 +319,6 @@ RunUntilIdle(); } +INSTANTIATE_TEST_SUITE_P(, BulkLeakCheckServiceAdapterTest, testing::Bool()); + } // namespace password_manager
diff --git a/components/password_manager/core/browser/ui/insecure_credentials_manager_unittest.cc b/components/password_manager/core/browser/ui/insecure_credentials_manager_unittest.cc index b55038b..0843e8a 100644 --- a/components/password_manager/core/browser/ui/insecure_credentials_manager_unittest.cc +++ b/components/password_manager/core/browser/ui/insecure_credentials_manager_unittest.cc
@@ -82,9 +82,14 @@ std::u16string(password)); } -class InsecureCredentialsManagerTest : public ::testing::Test { +class InsecureCredentialsManagerTest : public testing::TestWithParam<bool> { protected: InsecureCredentialsManagerTest() { + if (GetParam()) { + feature_list_.InitAndEnableFeature(features::kPasswordsGrouping); + } else { + feature_list_.InitAndDisableFeature(features::kPasswordsGrouping); + } store_->Init(/*prefs=*/nullptr, /*affiliated_match_helper=*/nullptr); presenter_.Init(); RunUntilIdle(); @@ -98,7 +103,6 @@ TestPasswordStore& store() { return *store_; } SavedPasswordsPresenter& presenter() { return presenter_; } InsecureCredentialsManager& provider() { return provider_; } - MockAffiliationService& affiliation_service() { return affiliation_service_; } void RunUntilIdle() { task_env_.RunUntilIdle(); } @@ -121,13 +125,16 @@ void AdvanceClock(base::TimeDelta time) { task_env_.AdvanceClock(time); } + bool IsGroupingEnabled() { return GetParam(); } + private: + base::test::ScopedFeatureList feature_list_; base::test::TaskEnvironment task_env_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; base::HistogramTester histogram_tester_; scoped_refptr<TestPasswordStore> store_ = base::MakeRefCounted<TestPasswordStore>(); - MockAffiliationService affiliation_service_; + FakeAffiliationService affiliation_service_; SavedPasswordsPresenter presenter_{&affiliation_service_, store_, /*account_store=*/nullptr}; InsecureCredentialsManager provider_{&presenter_, store_, @@ -137,7 +144,7 @@ } // namespace // Tests whether adding and removing an observer works as expected. -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, NotifyObserversAboutCompromisedCredentialChanges) { PasswordForm password_form = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -175,7 +182,7 @@ } // Tests whether adding and removing an observer works as expected. -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, NotifyObserversAboutSavedPasswordsChanges) { StrictMockInsecureCredentialsManagerObserver observer; provider().AddObserver(&observer); @@ -208,7 +215,7 @@ // Tests that the provider is able to join a single password with a compromised // credential. -TEST_F(InsecureCredentialsManagerTest, JoinSingleCredentials) { +TEST_P(InsecureCredentialsManagerTest, JoinSingleCredentials) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -223,7 +230,7 @@ // Tests that the provider is able to join a password with a credential that was // compromised in multiple ways. -TEST_F(InsecureCredentialsManagerTest, JoinPhishedAndLeaked) { +TEST_P(InsecureCredentialsManagerTest, JoinPhishedAndLeaked) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -241,7 +248,7 @@ // Tests that the provider reacts whenever the saved passwords or the // compromised credentials change. -TEST_F(InsecureCredentialsManagerTest, ReactToChangesInBothTables) { +TEST_P(InsecureCredentialsManagerTest, ReactToChangesInBothTables) { PasswordForm password1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); PasswordForm password2 = @@ -283,7 +290,7 @@ // Tests that the provider is able to join multiple passwords with compromised // credentials. -TEST_F(InsecureCredentialsManagerTest, JoinMultipleCredentials) { +TEST_P(InsecureCredentialsManagerTest, JoinMultipleCredentials) { PasswordForm password1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password1.password_issues.insert( @@ -306,7 +313,7 @@ // Tests that joining a compromised credential with multiple saved passwords for // the same signon_realm and username combination results in a single entry // when the passwords are the same. -TEST_F(InsecureCredentialsManagerTest, JoinWithMultipleRepeatedPasswords) { +TEST_P(InsecureCredentialsManagerTest, JoinWithMultipleRepeatedPasswords) { PasswordForm password1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password1.password_issues.insert( @@ -324,14 +331,14 @@ } #if !BUILDFLAG(IS_ANDROID) -TEST_F(InsecureCredentialsManagerTest, StartWeakCheckNotifiesOnCompletion) { +TEST_P(InsecureCredentialsManagerTest, StartWeakCheckNotifiesOnCompletion) { base::MockOnceClosure closure; provider().StartWeakCheck(closure.Get()); EXPECT_CALL(closure, Run); RunUntilIdle(); } -TEST_F(InsecureCredentialsManagerTest, StartWeakCheckOnEmptyPasswordsList) { +TEST_P(InsecureCredentialsManagerTest, StartWeakCheckOnEmptyPasswordsList) { EXPECT_THAT( histogram_tester().GetTotalCountsForPrefix("PasswordManager.WeakCheck"), IsEmpty()); @@ -351,7 +358,7 @@ "PasswordManager.WeakCheck.WeakPasswords", 0, 1); } -TEST_F(InsecureCredentialsManagerTest, WeakCredentialsNotFound) { +TEST_P(InsecureCredentialsManagerTest, WeakCredentialsNotFound) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kPassword1), MakeSavedPassword(kExampleCom, kUsername2, kPassword216)}; @@ -379,7 +386,7 @@ "PasswordManager.WeakCheck.PasswordScore", 4, 2); } -TEST_F(InsecureCredentialsManagerTest, DetectedWeakCredential) { +TEST_P(InsecureCredentialsManagerTest, DetectedWeakCredential) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1), MakeSavedPassword(kExampleCom, kUsername2, kPassword216)}; @@ -410,7 +417,7 @@ // Tests that credentials with the same signon_realm and username, but different // passwords will be both returned by GetInsecureCredentialEntries(). -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, FindBothWeakCredentialsWithDifferentPasswords) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1, u"element_1"), @@ -441,7 +448,7 @@ // Tests that credentials with the same signon_realm, username and passwords // will be joind and GetInsecureCredentialEntries() will return one credential. -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, JoinWeakCredentialsWithTheSamePasswords) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1, u"element_1"), @@ -468,7 +475,7 @@ "PasswordManager.WeakCheck.PasswordScore", 0, 1); } -TEST_F(InsecureCredentialsManagerTest, BothWeakAndCompromisedCredentialsExist) { +TEST_P(InsecureCredentialsManagerTest, BothWeakAndCompromisedCredentialsExist) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1), MakeSavedPassword(kExampleCom, kUsername2, kPassword216)}; @@ -511,7 +518,7 @@ // Checks that for a credential that is both weak and compromised, // GetInsecureCredentialEntries and GetInsecureCredentials will return this // credential in one instance. -TEST_F(InsecureCredentialsManagerTest, SingleCredentialIsWeakAndCompromised) { +TEST_P(InsecureCredentialsManagerTest, SingleCredentialIsWeakAndCompromised) { std::vector<PasswordForm> passwords = { MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1)}; @@ -543,7 +550,7 @@ // Test verifies that saving LeakCheckCredential via provider adds expected // compromised credential. -TEST_F(InsecureCredentialsManagerTest, SaveCompromisedPassword) { +TEST_P(InsecureCredentialsManagerTest, SaveCompromisedPassword) { PasswordForm password_form = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); LeakCheckCredential credential = MakeLeakCredential(kUsername1, kPassword1); @@ -564,7 +571,7 @@ // Test verifies that saving LeakCheckCredential doesn't occur for already // leaked passwords. -TEST_F(InsecureCredentialsManagerTest, SaveCompromisedPasswordForExistingLeak) { +TEST_P(InsecureCredentialsManagerTest, SaveCompromisedPasswordForExistingLeak) { PasswordForm password_form = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); LeakCheckCredential credential = MakeLeakCredential(kUsername1, kPassword1); @@ -589,7 +596,7 @@ .password_issues.at(InsecureType::kLeaked)); } -TEST_F(InsecureCredentialsManagerTest, MuteCompromisedCredential) { +TEST_P(InsecureCredentialsManagerTest, MuteCompromisedCredential) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -616,7 +623,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, UnmuteCompromisedMutedCredential) { +TEST_P(InsecureCredentialsManagerTest, UnmuteCompromisedMutedCredential) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -644,7 +651,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, UnmuteCompromisedNotMutedCredential) { +TEST_P(InsecureCredentialsManagerTest, UnmuteCompromisedNotMutedCredential) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -672,7 +679,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, UnmuteCompromisedMutedCredentialWithMultipleInsecurityTypes) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -715,7 +722,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, FilterThenUnmuteMultipleInsecurityTypes) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -776,7 +783,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, MuteCompromisedCredentialOnMutedIsNoOp) { +TEST_P(InsecureCredentialsManagerTest, MuteCompromisedCredentialOnMutedIsNoOp) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -802,7 +809,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, MuteCompromisedCredentialLeakedMutesMultipleInsecurityTypes) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -842,7 +849,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, FilterThenMuteMultipleInsecurityTypes) { +TEST_P(InsecureCredentialsManagerTest, FilterThenMuteMultipleInsecurityTypes) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password.password_issues.insert( @@ -903,7 +910,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, MuteWeakPasswordNoOp) { +TEST_P(InsecureCredentialsManagerTest, MuteWeakPasswordNoOp) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -940,7 +947,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, UnMuteWeakPasswordNoOp) { +TEST_P(InsecureCredentialsManagerTest, UnMuteWeakPasswordNoOp) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -978,7 +985,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, MuteReusedPasswordNoOp) { +TEST_P(InsecureCredentialsManagerTest, MuteReusedPasswordNoOp) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -1015,7 +1022,7 @@ .is_muted.value()); } -TEST_F(InsecureCredentialsManagerTest, UnMuteReusedPasswordNoOp) { +TEST_P(InsecureCredentialsManagerTest, UnMuteReusedPasswordNoOp) { PasswordForm password = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -1053,7 +1060,7 @@ } // Test verifies that editing Compromised Credential makes it secure. -TEST_F(InsecureCredentialsManagerTest, UpdateCompromisedPassword) { +TEST_P(InsecureCredentialsManagerTest, UpdateCompromisedPassword) { PasswordForm password_form = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); password_form.password_issues.insert( @@ -1075,7 +1082,7 @@ #if !BUILDFLAG(IS_ANDROID) // Test verifies that editing a weak credential to another weak credential // continues to be treated weak. -TEST_F(InsecureCredentialsManagerTest, UpdatedWeakPasswordBecomesStrong) { +TEST_P(InsecureCredentialsManagerTest, UpdatedWeakPasswordBecomesStrong) { #if BUILDFLAG(IS_IOS) base::test::ScopedFeatureList feature_list( password_manager::features::kIOSPasswordCheckup); @@ -1102,7 +1109,7 @@ // Test verifies that editing a weak credential to another weak credential // continues to be treated weak. -TEST_F(InsecureCredentialsManagerTest, UpdatedWeakPasswordRemainsWeak) { +TEST_P(InsecureCredentialsManagerTest, UpdatedWeakPasswordRemainsWeak) { #if BUILDFLAG(IS_IOS) base::test::ScopedFeatureList feature_list( password_manager::features::kIOSPasswordCheckup); @@ -1130,7 +1137,7 @@ // Verifues that GetInsecureCredentialEntries() returns sorted weak credentials // by using CreateSortKey. -TEST_F(InsecureCredentialsManagerTest, GetWeakCredentialsReturnsSortedData) { +TEST_P(InsecureCredentialsManagerTest, GetWeakCredentialsReturnsSortedData) { const std::vector<PasswordForm> password_forms = { MakeSavedPassword("http://example-a.com", u"user_a1", u"pwd"), MakeSavedPassword("http://example-a.com", u"user_a2", u"pwd"), @@ -1154,7 +1161,7 @@ // Verifues that GetInsecureCredentialEntries() returns sorted weak credentials // by using CreateSortKey. -TEST_F(InsecureCredentialsManagerTest, GetInsecureCredentialEntries) { +TEST_P(InsecureCredentialsManagerTest, GetInsecureCredentialEntries) { const std::vector<PasswordForm> password_forms = { MakeSavedPassword("http://example-a.com", u"user_a1", u"pwd"), MakeSavedPassword("http://example-a.com", u"user_a2", u"pwd")}; @@ -1170,11 +1177,11 @@ CredentialUIEntry(password_forms[1]))); } -TEST_F(InsecureCredentialsManagerTest, GetInsecureCredentialsReused) { +TEST_P(InsecureCredentialsManagerTest, GetInsecureCredentialsReused) { PasswordForm form1 = MakeSavedPassword(kExampleCom, kUsername1, kWeakPassword1); PasswordForm form2 = - MakeSavedPassword(kExampleCom, kUsername2, kWeakPassword1); + MakeSavedPassword("https://example2.com/", kUsername2, kWeakPassword1); store().AddLogin(form1); store().AddLogin(form2); @@ -1190,7 +1197,7 @@ kDelay, 1); } -TEST_F(InsecureCredentialsManagerTest, UpdatingReusedPasswordFixesTheIssue) { +TEST_P(InsecureCredentialsManagerTest, UpdatingReusedPasswordFixesTheIssue) { #if BUILDFLAG(IS_IOS) base::test::ScopedFeatureList scoped_feature_list( password_manager::features::kIOSPasswordCheckup); @@ -1200,7 +1207,8 @@ #endif PasswordForm form1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); - PasswordForm form2 = MakeSavedPassword(kExampleCom, kUsername2, kPassword1); + PasswordForm form2 = + MakeSavedPassword("https://example2.com/", kUsername2, kPassword1); store().AddLogin(form1); store().AddLogin(form2); @@ -1220,10 +1228,16 @@ EXPECT_THAT(provider().GetInsecureCredentialEntries(), IsEmpty()); } -TEST_F(InsecureCredentialsManagerTest, ReuseCheckUsesAffiliationInfo) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - password_manager::features::kPasswordsGrouping); +TEST_P(InsecureCredentialsManagerTest, ReuseCheckUsesAffiliationInfo) { + if (!IsGroupingEnabled()) { + return; + } + MockAffiliationService mock_affiliation_service; + SavedPasswordsPresenter presenter{&mock_affiliation_service, &store(), + nullptr}; + InsecureCredentialsManager provider{&presenter, &store(), nullptr}; + presenter.Init(); + RunUntilIdle(); // Setup two credentials with the same passwords that belong to two affiliated // groups. Those should *not* be flagged for password reuse. @@ -1236,21 +1250,21 @@ grouped_facets[0].facets.push_back(facet); facet.uri = FacetURI::FromPotentiallyInvalidSpec(form2.signon_realm); grouped_facets[0].facets.push_back(facet); - EXPECT_CALL(affiliation_service(), GetGroupingInfo) + EXPECT_CALL(mock_affiliation_service, GetGroupingInfo) .WillRepeatedly(base::test::RunOnceCallback<1>(grouped_facets)); store().AddLogin(form1); store().AddLogin(form2); RunUntilIdle(); - provider().StartReuseCheck(); + provider.StartReuseCheck(); RunUntilIdle(); - EXPECT_THAT(provider().GetInsecureCredentialEntries(), IsEmpty()); + EXPECT_THAT(provider.GetInsecureCredentialEntries(), IsEmpty()); } #else -TEST_F(InsecureCredentialsManagerTest, GetInsecureCredentialsFiltersWeak) { +TEST_P(InsecureCredentialsManagerTest, GetInsecureCredentialsFiltersWeak) { PasswordForm password1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); PasswordForm password2 = @@ -1271,7 +1285,7 @@ #endif // !BUILDFLAG(IS_ANDROID) -TEST_F(InsecureCredentialsManagerTest, +TEST_P(InsecureCredentialsManagerTest, GetInsecureCredentialsFiltersDuplicates) { PasswordForm password1 = MakeSavedPassword(kExampleCom, kUsername1, kPassword1); @@ -1417,4 +1431,6 @@ #endif // !BUILDFLAG(IS_ANDROID) +INSTANTIATE_TEST_SUITE_P(, InsecureCredentialsManagerTest, testing::Bool()); + } // namespace password_manager
diff --git a/components/security_state/ios/security_state_utils.mm b/components/security_state/ios/security_state_utils.mm index cfe72dde..02d3dbe 100644 --- a/components/security_state/ios/security_state_utils.mm +++ b/components/security_state/ios/security_state_utils.mm
@@ -15,6 +15,10 @@ #import "ios/web/public/web_state.h" #include "url/origin.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace security_state { MaliciousContentStatus GetMaliciousContentStatus(
diff --git a/components/segmentation_platform/internal/database/config_holder.cc b/components/segmentation_platform/internal/database/config_holder.cc index e674fb08..82e0392 100644 --- a/components/segmentation_platform/internal/database/config_holder.cc +++ b/components/segmentation_platform/internal/database/config_holder.cc
@@ -3,14 +3,56 @@ // found in the LICENSE file. #include "components/segmentation_platform/internal/database/config_holder.h" + #include "components/segmentation_platform/internal/config_parser.h" +#include "components/segmentation_platform/internal/metadata/metadata_utils.h" namespace segmentation_platform { ConfigHolder::ConfigHolder(std::vector<std::unique_ptr<Config>> configs) : configs_(std::move(configs)), - all_segment_ids_(GetAllSegmentIdsFromConfigs(configs_)) {} + all_segment_ids_(GetAllSegmentIdsFromConfigs(configs_)) { + for (const auto& config : configs_) { + if (metadata_utils::ConfigUsesLegacyOutput(config.get())) { + legacy_output_segmentation_keys_.insert(config->segmentation_key); + } else { + // Non legacy segment IDs must have a 1:1 relationship with segmentation + // keys. These checks ensure that. + CHECK(config->segments.size() <= 1) + << "segmentation_key: " << config->segmentation_key + << " must not have multiple segments."; + + for (const auto& segment_id : config->segments) { + CHECK(!segmentation_key_by_segment_id_.contains(segment_id.first)) + << "segment_id: " << proto::SegmentId_Name(segment_id.first) + << " was found in two segmentation keys: " + << segmentation_key_by_segment_id_.at(segment_id.first) << " and " + << config->segmentation_key; + + segmentation_key_by_segment_id_.insert( + {segment_id.first, config->segmentation_key}); + } + + non_legacy_segmentation_keys_.insert(config->segmentation_key); + } + } +} ConfigHolder::~ConfigHolder() = default; +absl::optional<std::string> ConfigHolder::GetKeyForSegmentId( + proto::SegmentId segment_id) const { + auto key_for_updated_segment = + segmentation_key_by_segment_id_.find(segment_id); + if (key_for_updated_segment == segmentation_key_by_segment_id_.end()) { + return absl::nullopt; + } + return key_for_updated_segment->second; +} + +bool ConfigHolder::IsLegacySegmentationKey( + const std::string& segmentation_key) const { + return legacy_output_segmentation_keys_.contains(segmentation_key); +} + } // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/database/config_holder.h b/components/segmentation_platform/internal/database/config_holder.h index 30ad8f57..9a20a01b 100644 --- a/components/segmentation_platform/internal/database/config_holder.h +++ b/components/segmentation_platform/internal/database/config_holder.h
@@ -13,6 +13,7 @@ namespace segmentation_platform { +// Holds all Configs active in the service. class ConfigHolder { public: explicit ConfigHolder(std::vector<std::unique_ptr<Config>> configs); @@ -29,9 +30,36 @@ return all_segment_ids_; } + const std::set<std::string> non_legacy_segmentation_keys() const { + return non_legacy_segmentation_keys_; + } + + // Returns segmentation key for the given `segment_id`. Only if the Config + // supports output configs in metadata. + absl::optional<std::string> GetKeyForSegmentId( + proto::SegmentId segment_id) const; + + // Returns true if the Config is legacy, does not support output config and + // uses discrete mapping. + bool IsLegacySegmentationKey(const std::string& segmentation_key) const; + private: + // All the active Config(s) in the service. const std::vector<std::unique_ptr<Config>> configs_; + + // All segment IDs needed for all active Config(s). const base::flat_set<proto::SegmentId> all_segment_ids_; + + // List of segmentation keys with exactly one segment ID and supports output + // config. + std::set<std::string> non_legacy_segmentation_keys_; + + // List of segmentation keys for Config(s) that support output configs in + // metadata. + std::set<std::string> legacy_output_segmentation_keys_; + + // Map from segment ID to the segmentation key that makes use of it. + std::map<proto::SegmentId, std::string> segmentation_key_by_segment_id_; }; } // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc index e602a7ec..171c070 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc
@@ -98,7 +98,7 @@ config_holder.configs(), storage_service_->cached_result_provider()); request_dispatcher_ = std::make_unique<RequestDispatcher>( - config_holder.configs(), storage_service_->cached_result_provider()); + &config_holder, storage_service_->cached_result_provider()); for (const auto& config : config_holder.configs()) { if (!metadata_utils::ConfigUsesLegacyOutput(config.get())) {
diff --git a/components/segmentation_platform/internal/selection/request_dispatcher.cc b/components/segmentation_platform/internal/selection/request_dispatcher.cc index 55dce1c..2325f71 100644 --- a/components/segmentation_platform/internal/selection/request_dispatcher.cc +++ b/components/segmentation_platform/internal/selection/request_dispatcher.cc
@@ -12,6 +12,7 @@ #include "base/memory/scoped_refptr.h" #include "base/task/single_thread_task_runner.h" #include "base/time/time.h" +#include "components/segmentation_platform/internal/database/config_holder.h" #include "components/segmentation_platform/internal/metadata/metadata_utils.h" #include "components/segmentation_platform/internal/selection/request_handler.h" #include "components/segmentation_platform/internal/selection/segment_result_provider.h" @@ -51,38 +52,16 @@ } // namespace RequestDispatcher::RequestDispatcher( - const std::vector<std::unique_ptr<Config>>& configs, + const ConfigHolder* config_holder, CachedResultProvider* cached_result_provider) - : configs_(configs), cached_result_provider_(cached_result_provider) { + : config_holder_(config_holder), + cached_result_provider_(cached_result_provider) { std::set<proto::SegmentId> found_segments; // Individual models must be loaded from disk or fetched from network. Fill a // list to keep track of which ones are still pending. - for (const auto& config : *configs_) { - // Ignore segmentation keys using legacy models. - if (metadata_utils::ConfigUsesLegacyOutput(config.get())) { - legacy_output_segmentation_keys_.insert(config->segmentation_key); - } else { - // Non legacy segment IDs must have a 1:1 relationship with segmentation - // keys. These checks ensure that. - CHECK(config->segments.size() <= 1) - << "segmentation_key: " << config->segmentation_key - << " must not have multiple segments."; - - for (const auto& segment_id : config->segments) { - CHECK(!segmentation_key_by_segment_id_.contains(segment_id.first)) - << "segment_id: " << proto::SegmentId_Name(segment_id.first) - << " was found in two segmentation keys: " - << segmentation_key_by_segment_id_.at(segment_id.first) << " and " - << config->segmentation_key; - - segmentation_key_by_segment_id_.insert( - {segment_id.first, config->segmentation_key}); - } - - uninitialized_segmentation_keys_.insert(config->segmentation_key); - } - } + uninitialized_segmentation_keys_ = + config_holder_->non_legacy_segmentation_keys(); } RequestDispatcher::~RequestDispatcher() = default; @@ -96,7 +75,7 @@ // Only set request handlers if it has not been set for testing already. if (request_handlers_.empty()) { - for (const auto& config : *configs_) { + for (const auto& config : config_holder_->configs()) { request_handlers_[config->segmentation_key] = RequestHandler::Create( *config, std::move(result_providers[config->segmentation_key]), execution_service); @@ -139,12 +118,11 @@ } void RequestDispatcher::OnModelUpdated(proto::SegmentId segment_id) { - auto key_for_updated_segment = - segmentation_key_by_segment_id_.find(segment_id); - if (key_for_updated_segment == segmentation_key_by_segment_id_.end()) { + auto key_for_updated_segment = config_holder_->GetKeyForSegmentId(segment_id); + if (!key_for_updated_segment) { return; } - std::string segmentation_key = key_for_updated_segment->second; + const std::string& segmentation_key = *key_for_updated_segment; uninitialized_segmentation_keys_.erase(segmentation_key); ExecutePendingActionsForKey(segmentation_key); @@ -162,7 +140,7 @@ scoped_refptr<InputContext> input_context, Request request, base::OnceCallback<void(const ResultType&)> callback) { - if (legacy_output_segmentation_keys_.contains(segmentation_key)) { + if (config_holder_->IsLegacySegmentationKey(segmentation_key)) { return; }
diff --git a/components/segmentation_platform/internal/selection/request_dispatcher.h b/components/segmentation_platform/internal/selection/request_dispatcher.h index cf83321..ffe1c37c 100644 --- a/components/segmentation_platform/internal/selection/request_dispatcher.h +++ b/components/segmentation_platform/internal/selection/request_dispatcher.h
@@ -14,6 +14,7 @@ #include "base/memory/raw_ref.h" #include "base/memory/scoped_refptr.h" #include "components/segmentation_platform/internal/database/cached_result_provider.h" +#include "components/segmentation_platform/internal/database/config_holder.h" #include "components/segmentation_platform/internal/selection/request_handler.h" #include "components/segmentation_platform/public/input_context.h" #include "components/segmentation_platform/public/proto/segmentation_platform.pb.h" @@ -21,7 +22,6 @@ #include "third_party/abseil-cpp/absl/types/optional.h" namespace segmentation_platform { -struct Config; struct PredictionOptions; class SegmentResultProvider; @@ -31,9 +31,8 @@ // 2. Dispatching requests to client specific request handlers. class RequestDispatcher { public: - explicit RequestDispatcher( - const std::vector<std::unique_ptr<Config>>& configs, - CachedResultProvider* cached_result_provider); + explicit RequestDispatcher(const ConfigHolder* config_holder, + CachedResultProvider* cached_result_provider); ~RequestDispatcher(); // Disallow copy/assign. @@ -83,7 +82,7 @@ base::OnceCallback<void(const ResultType&)> callback); // Configs for all registered clients. - const raw_ref<const std::vector<std::unique_ptr<Config>>> configs_; + const raw_ptr<const ConfigHolder> config_holder_; // Request handlers associated with the clients. std::map<std::string, std::unique_ptr<RequestHandler>> request_handlers_; @@ -95,21 +94,12 @@ // elements get cleared after a timeout to avoid waiting for too long. std::set<std::string> uninitialized_segmentation_keys_; - // List of segmentation keys with segment IDs that use the legacy output - // config (e.g. don't support multi-output models). Requests from these - // segmentation keys will be ignored. - std::set<std::string> legacy_output_segmentation_keys_; - // Delegate to provide cached results for all clients, shared among clients. const raw_ptr<CachedResultProvider> cached_result_provider_; // Storage initialization status. absl::optional<bool> storage_init_status_; - // Map from segment ID to the segmentation key that makes use of it. Used - // to run all requests that use a segment ID once its model is available. - std::map<proto::SegmentId, std::string> segmentation_key_by_segment_id_; - // For caching any method calls that were received before initialization. // Key is a segmentation key, value is a queue of actions that use that model. std::map<std::string, base::circular_deque<base::OnceClosure>>
diff --git a/components/segmentation_platform/internal/selection/request_dispatcher_unittest.cc b/components/segmentation_platform/internal/selection/request_dispatcher_unittest.cc index 80206403..707e686 100644 --- a/components/segmentation_platform/internal/selection/request_dispatcher_unittest.cc +++ b/components/segmentation_platform/internal/selection/request_dispatcher_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/segmentation_platform/internal/selection/request_dispatcher.h" +#include <memory> #include "base/memory/raw_ptr.h" #include "base/metrics/user_metrics.h" @@ -12,6 +13,7 @@ #include "base/test/gmock_callback_support.h" #include "base/test/task_environment.h" #include "base/time/time.h" +#include "components/segmentation_platform/internal/database/config_holder.h" #include "components/segmentation_platform/internal/post_processor/post_processing_test_utils.h" #include "components/segmentation_platform/internal/selection/request_handler.h" #include "components/segmentation_platform/internal/selection/segment_result_provider.h" @@ -55,15 +57,17 @@ base::SetRecordActionTaskRunner( task_environment_.GetMainThreadTaskRunner()); - configs_.emplace_back(test_utils::CreateTestConfig( + std::vector<std::unique_ptr<Config>> configs; + configs.emplace_back(test_utils::CreateTestConfig( kDeviceSwitcherClient, SegmentId::OPTIMIZATION_TARGET_SEGMENTATION_DEVICE_SWITCHER)); - configs_.emplace_back(test_utils::CreateTestConfig( + configs.emplace_back(test_utils::CreateTestConfig( kAdaptiveToolbarClient, SegmentId::OPTIMIZATION_TARGET_SEGMENTATION_ADAPTIVE_TOOLBAR)); + config_holder_ = std::make_unique<ConfigHolder>(std::move(configs)); request_dispatcher_ = - std::make_unique<RequestDispatcher>(configs_, nullptr); + std::make_unique<RequestDispatcher>(config_holder_.get(), nullptr); auto handler1 = std::make_unique<MockRequestHandler>(); request_handler1_ = handler1.get(); @@ -95,7 +99,7 @@ base::test::TaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; - std::vector<std::unique_ptr<Config>> configs_; + std::unique_ptr<ConfigHolder> config_holder_; raw_ptr<MockRequestHandler> request_handler1_ = nullptr; raw_ptr<MockRequestHandler> request_handler2_ = nullptr; std::unique_ptr<RequestDispatcher> request_dispatcher_;
diff --git a/components/services/heap_profiling/public/cpp/BUILD.gn b/components/services/heap_profiling/public/cpp/BUILD.gn index 9896dc6..8cce2ec 100644 --- a/components/services/heap_profiling/public/cpp/BUILD.gn +++ b/components/services/heap_profiling/public/cpp/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//base/allocator/allocator.gni") +import("//build/config/features.gni") static_library("cpp") { sources = [ @@ -34,7 +35,7 @@ ] } - if (!is_ios) { + if (use_blink) { sources += [ "heap_profiling_trace_source.cc", "heap_profiling_trace_source.h", @@ -58,7 +59,7 @@ sources += [ "merge_samples_unittests.cc" ] } - if (!is_ios) { + if (use_blink) { sources += [ "heap_profiling_trace_source_unittest.cc" ] deps += [ "//services/tracing:test_utils",
diff --git a/components/services/screen_ai/public/cpp/screen_ai_install_state.cc b/components/services/screen_ai/public/cpp/screen_ai_install_state.cc index 2f90dbfbe..06c3009 100644 --- a/components/services/screen_ai/public/cpp/screen_ai_install_state.cc +++ b/components/services/screen_ai/public/cpp/screen_ai_install_state.cc
@@ -130,10 +130,12 @@ void ScreenAIInstallState::SetState(State state) { if (state == state_) { // Failed and ready state can be repeated as they come from different - // profiles. The other state changes are controlled by singluar objects. + // profiles. Downloading can be repeated in ChromeOS tests that call + // LoginManagerTest::AddUser() and reset UserSessionInitializer. // TODO(crbug.com/1278249): While the case is highly unexpected, add more // control logic if state is changed from failed to ready or vice versa. - DCHECK(state == State::kReady || state == State::kFailed); + DCHECK(state == State::kReady || state == State::kFailed || + state == State::kDownloading); return; }
diff --git a/components/spellcheck/browser/BUILD.gn b/components/spellcheck/browser/BUILD.gn index 300e57e..83abfbb 100644 --- a/components/spellcheck/browser/BUILD.gn +++ b/components/spellcheck/browser/BUILD.gn
@@ -54,6 +54,7 @@ if (is_mac) { sources += [ "spellcheck_platform_mac.mm" ] + configs += [ "//build/config/compiler:enable_arc" ] } if (is_android) {
diff --git a/components/spellcheck/browser/spellcheck_platform_mac.mm b/components/spellcheck/browser/spellcheck_platform_mac.mm index ea180d2..b0f19a23 100644 --- a/components/spellcheck/browser/spellcheck_platform_mac.mm +++ b/components/spellcheck/browser/spellcheck_platform_mac.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Integration with OS X built-in spellchecker. +// Integration with macOS built-in spellchecker. #include "components/spellcheck/browser/spellcheck_platform.h" @@ -19,6 +19,10 @@ #include "components/spellcheck/common/spellcheck_result.h" #include "content/public/browser/browser_thread.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + class PlatformSpellChecker; using base::TimeTicks; @@ -36,25 +40,25 @@ // browser. NSSpellChecker* SharedSpellChecker() { @try { - return [NSSpellChecker sharedSpellChecker]; + return NSSpellChecker.sharedSpellChecker; } @catch (id exception) { return nil; } } -// A private utility function to convert hunspell language codes to OS X +// A private utility function to convert hunspell language codes to macOS // language codes. NSString* ConvertLanguageCodeToMac(const std::string& hunspell_lang_code) { NSString* whole_code = base::SysUTF8ToNSString(hunspell_lang_code); - if ([whole_code length] > kShortLanguageCodeSize) { + if (whole_code.length > kShortLanguageCodeSize) { NSString* lang_code = [whole_code substringToIndex:kShortLanguageCodeSize]; // Add 1 here to skip the underscore. NSString* region_code = [whole_code substringFromIndex:(kShortLanguageCodeSize + 1)]; - // Check for the special case of en-US and pt-PT, since OS X lists these + // Check for the special case of en-US and pt-PT, since macOS lists these // as just en and pt respectively. // TODO(pwicks): Find out if there are other special cases for languages // not installed on the system by default. Are there others like pt-PT? @@ -67,16 +71,16 @@ // Otherwise, just build a string that uses an underscore instead of a // dash between the language and the region code, since this is the - // format that OS X uses. - NSString* os_x_language = + // format that macOS uses. + NSString* macos_language = [NSString stringWithFormat:@"%@_%@", lang_code, region_code]; - return os_x_language; + return macos_language; } else { // Special case for Polish. if ([whole_code isEqualToString:@"pl"]) { return @"pl_PL"; } - // This is just a language code with the same format as OS X + // This is just a language code with the same format as macOS // language code. return whole_code; } @@ -85,15 +89,23 @@ std::string ConvertLanguageCodeFromMac(NSString* lang_code) { // TODO(pwicks):figure out what to do about Multilingual // Guards for strange cases. - if ([lang_code isEqualToString:@"en"]) return std::string("en-US"); - if ([lang_code isEqualToString:@"pt"]) return std::string("pt-PT"); - if ([lang_code isEqualToString:@"pl_PL"]) return std::string("pl"); + if ([lang_code isEqualToString:@"en"]) { + return std::string("en-US"); + } + if ([lang_code isEqualToString:@"pt"]) { + return std::string("pt-PT"); + } + if ([lang_code isEqualToString:@"pl_PL"]) { + return std::string("pl"); + } - if ([lang_code length] > kShortLanguageCodeSize && + if (lang_code.length > kShortLanguageCodeSize && [lang_code characterAtIndex:kShortLanguageCodeSize] == '_') { - return base::SysNSStringToUTF8([NSString stringWithFormat:@"%@-%@", - [lang_code substringToIndex:kShortLanguageCodeSize], - [lang_code substringFromIndex:(kShortLanguageCodeSize + 1)]]); + return base::SysNSStringToUTF8([NSString + stringWithFormat:@"%@-%@", + [lang_code substringToIndex:kShortLanguageCodeSize], + [lang_code + substringFromIndex:(kShortLanguageCodeSize + 1)]]); } return base::SysNSStringToUTF8(lang_code); } @@ -103,8 +115,7 @@ namespace spellcheck_platform { void GetAvailableLanguages(std::vector<std::string>* spellcheck_languages) { - NSArray* availableLanguages = [SharedSpellChecker() availableLanguages]; - for (NSString* lang_code in availableLanguages) { + for (NSString* lang_code in SharedSpellChecker().availableLanguages) { spellcheck_languages->push_back( ConvertLanguageCodeFromMac(lang_code)); } @@ -124,7 +135,7 @@ } std::string GetSpellCheckerLanguage() { - return ConvertLanguageCodeFromMac([SharedSpellChecker() language]); + return ConvertLanguageCodeFromMac(SharedSpellChecker().language); } bool SpellCheckerAvailable() { @@ -138,18 +149,18 @@ bool SpellingPanelVisible() { // This should only be called from the main thread. - DCHECK([NSThread currentThread] == [NSThread mainThread]); - return [[SharedSpellChecker() spellingPanel] isVisible]; + DCHECK(NSThread.isMainThread); + return SharedSpellChecker().spellingPanel.visible; } void ShowSpellingPanel(bool show) { if (show) { - [[SharedSpellChecker() spellingPanel] + [SharedSpellChecker().spellingPanel performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:nil waitUntilDone:YES]; } else { - [[SharedSpellChecker() spellingPanel] + [SharedSpellChecker().spellingPanel performSelectorOnMainThread:@selector(close) withObject:nil waitUntilDone:YES]; @@ -168,13 +179,13 @@ void PlatformSupportsLanguage(PlatformSpellChecker* spell_checker_instance, const std::string& current_language, base::OnceCallback<void(bool)> callback) { - // First, convert the language to an OS X language code. + // First, convert the language to an macOS language code. NSString* mac_lang_code = ConvertLanguageCodeToMac(current_language); // Then grab the languages available. - NSArray* availableLanguages = [SharedSpellChecker() availableLanguages]; + NSArray* availableLanguages = SharedSpellChecker().availableLanguages; - // Return true if the given language is supported by OS X. + // Return true if the given language is supported by macOS. std::move(callback).Run([availableLanguages containsObject:mac_lang_code]); } @@ -224,7 +235,7 @@ NSSpellChecker* checker = SharedSpellChecker(); NSString* language = [checker language]; NSArray* guesses = - [checker guessesForWordRange:NSMakeRange(0, [ns_wrong_word length]) + [checker guessesForWordRange:NSMakeRange(0, ns_wrong_word.length) inString:ns_wrong_word language:language inSpellDocumentWithTag:last_seen_tag_]; @@ -268,7 +279,7 @@ const std::u16string& text, TextCheckCompleteCallback passed_callback) { NSString* text_to_check = base::SysUTF16ToNSString(text); - NSRange range_to_check = NSMakeRange(0, [text_to_check length]); + NSRange range_to_check = NSMakeRange(0, text_to_check.length); __block TextCheckCompleteCallback callback(std::move(passed_callback)); [SharedSpellChecker() @@ -283,17 +294,18 @@ NSInteger) { std::vector<SpellCheckResult> check_results; for (NSTextCheckingResult* result in results) { - // Deliberately ignore non-spelling results. OSX at the very least + // Deliberately ignore non-spelling results. macOS at the very least // delivers a result of NSTextCheckingTypeOrthography for the // whole fragment, which underlines the entire checked range. - if ([result resultType] != NSTextCheckingTypeSpelling) + if (result.resultType != NSTextCheckingTypeSpelling) { continue; + } // In this use case, the spell checker should never // return anything but a single range per result. check_results.emplace_back(SpellCheckResult::SPELLING, - [result range].location, - [result range].length); + result.range.location, + result.range.length); } // TODO(groby): Verify we don't need to post from here. std::move(callback).Run(check_results); @@ -311,17 +323,17 @@ }; SpellcheckerStateInternal::SpellcheckerStateInternal() { - language_ = [SharedSpellChecker() language]; + language_ = SharedSpellChecker().language; automaticallyIdentifiesLanguages_ = - [SharedSpellChecker() automaticallyIdentifiesLanguages]; + SharedSpellChecker().automaticallyIdentifiesLanguages; [SharedSpellChecker() setLanguage:@"en"]; - [SharedSpellChecker() setAutomaticallyIdentifiesLanguages:NO]; + SharedSpellChecker().automaticallyIdentifiesLanguages = NO; } SpellcheckerStateInternal::~SpellcheckerStateInternal() { [SharedSpellChecker() setLanguage:language_]; - [SharedSpellChecker() setAutomaticallyIdentifiesLanguages: - automaticallyIdentifiesLanguages_]; + SharedSpellChecker().automaticallyIdentifiesLanguages = + automaticallyIdentifiesLanguages_; } ScopedEnglishLanguageForTest::ScopedEnglishLanguageForTest()
diff --git a/components/sync/engine/loopback_server/loopback_connection_manager.cc b/components/sync/engine/loopback_server/loopback_connection_manager.cc index f3817fc7..6f85b67 100644 --- a/components/sync/engine/loopback_server/loopback_connection_manager.cc +++ b/components/sync/engine/loopback_server/loopback_connection_manager.cc
@@ -18,7 +18,6 @@ HttpResponse LoopbackConnectionManager::PostBuffer( const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) { buffer_out->clear();
diff --git a/components/sync/engine/loopback_server/loopback_connection_manager.h b/components/sync/engine/loopback_server/loopback_connection_manager.h index 4036736..279d1a7f 100644 --- a/components/sync/engine/loopback_server/loopback_connection_manager.h +++ b/components/sync/engine/loopback_server/loopback_connection_manager.h
@@ -30,7 +30,6 @@ // Overridden ServerConnectionManager functions. HttpResponse PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) override; // The loopback server that will handle the requests locally.
diff --git a/components/sync/engine/net/http_bridge.cc b/components/sync/engine/net/http_bridge.cc index 387aa93..7f43ea1e 100644 --- a/components/sync/engine/net/http_bridge.cc +++ b/components/sync/engine/net/http_bridge.cc
@@ -25,7 +25,6 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" -#include "services/network/public/cpp/simple_url_loader_throttle.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/zlib/google/compression_utils.h" @@ -110,11 +109,6 @@ extra_headers_.assign(headers); } -void HttpBridge::SetAllowBatching(bool allow_batching) { - DCHECK(!fetch_state_.url_loader); - allow_batching_ = allow_batching; -} - void HttpBridge::SetURL(const GURL& url) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if DCHECK_IS_ON() @@ -261,11 +255,6 @@ std::move(resource_request), traffic_annotation); network::SimpleURLLoader* url_loader = fetch_state_.url_loader.get(); - if (allow_batching_ && - network::SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)) { - url_loader->SetAllowBatching(); - } - std::string request_to_send; compression::GzipCompress(request_content_, &request_to_send); url_loader->AttachStringForUpload(request_to_send, content_type_);
diff --git a/components/sync/engine/net/http_bridge.h b/components/sync/engine/net/http_bridge.h index e8861288..1584a940 100644 --- a/components/sync/engine/net/http_bridge.h +++ b/components/sync/engine/net/http_bridge.h
@@ -52,7 +52,6 @@ void SetPostPayload(const char* content_type, int content_length, const char* content) override; - void SetAllowBatching(bool allow_batching) override; bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override; void Abort() override; @@ -110,11 +109,6 @@ std::string request_content_; std::string extra_headers_; - // When true `fetch_state_.url_loader` is configured so that it can be - // batched in the network layer. See the comment in - // network::SimpleURLLoader::SetAllowBatching(). - bool allow_batching_ = false; - // A waitable event we use to provide blocking semantics to // MakeSynchronousPost. We block the Sync thread while the IO thread processes // the network request.
diff --git a/components/sync/engine/net/http_post_provider.h b/components/sync/engine/net/http_post_provider.h index 4e7dad0..3dd2ba3 100644 --- a/components/sync/engine/net/http_post_provider.h +++ b/components/sync/engine/net/http_post_provider.h
@@ -36,10 +36,6 @@ int content_length, const char* content) = 0; - // Set whether the POST message can be batched in the network stack of the - // embedding application. - virtual void SetAllowBatching(bool allow_batching) = 0; - // Returns true if the URL request succeeded. If the request failed, // error() may be non-zero and hence contain more information. virtual bool MakeSynchronousPost(int* net_error_code,
diff --git a/components/sync/engine/net/server_connection_manager.cc b/components/sync/engine/net/server_connection_manager.cc index 0658b0a..32d64ee 100644 --- a/components/sync/engine/net/server_connection_manager.cc +++ b/components/sync/engine/net/server_connection_manager.cc
@@ -155,11 +155,9 @@ HttpResponse ServerConnectionManager::PostBufferWithCachedAuth( const std::string& buffer_in, - bool allow_batching, std::string* buffer_out) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - HttpResponse http_response = - PostBuffer(buffer_in, access_token_, allow_batching, buffer_out); + HttpResponse http_response = PostBuffer(buffer_in, access_token_, buffer_out); SetServerResponse(http_response); return http_response; }
diff --git a/components/sync/engine/net/server_connection_manager.h b/components/sync/engine/net/server_connection_manager.h index 5414cac..9c6c10d4 100644 --- a/components/sync/engine/net/server_connection_manager.h +++ b/components/sync/engine/net/server_connection_manager.h
@@ -100,13 +100,8 @@ virtual ~ServerConnectionManager(); // POSTs |buffer_in| and reads the body of the response into |buffer_out|. - // Uses the currently set access token in the headers. When |allow_batching| - // is true, the embedder's network stack may batch the post request depending - // on the network quality to streamline network access. - // TODO(https://crbug.com/1293657): Consider integrating batching logic into - // the sync code rather than relying on the embedder's network stack. + // Uses the currently set access token in the headers. HttpResponse PostBufferWithCachedAuth(const std::string& buffer_in, - bool allow_batching, std::string* buffer_out); void AddListener(ServerConnectionEventListener* listener); @@ -143,7 +138,6 @@ // implement. virtual HttpResponse PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) = 0; void ClearAccessToken();
diff --git a/components/sync/engine/net/sync_server_connection_manager.cc b/components/sync/engine/net/sync_server_connection_manager.cc index 24b40bf..e07b92f0 100644 --- a/components/sync/engine/net/sync_server_connection_manager.cc +++ b/components/sync/engine/net/sync_server_connection_manager.cc
@@ -35,8 +35,7 @@ HttpResponse Init(const GURL& connection_url, const std::string& access_token, - const std::string& payload, - bool allow_batching); + const std::string& payload); bool ReadBufferResponse(std::string* buffer_out, HttpResponse* response); // CancelationSignal::Observer overrides. @@ -70,8 +69,7 @@ HttpResponse Connection::Init(const GURL& sync_request_url, const std::string& access_token, - const std::string& payload, - bool allow_batching) { + const std::string& payload) { post_provider_->SetURL(sync_request_url); if (!access_token.empty()) { @@ -84,8 +82,6 @@ post_provider_->SetPostPayload("application/octet-stream", payload.length(), payload.data()); - post_provider_->SetAllowBatching(allow_batching); - // Issue the POST, blocking until it finishes. if (!cancelation_signal_->TryRegisterHandler(this)) { // Return early because cancelation signal was signaled. @@ -159,7 +155,6 @@ HttpResponse SyncServerConnectionManager::PostBuffer( const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) { if (access_token.empty()) { // Print a log to distinguish this "known failure" from others. @@ -177,8 +172,8 @@ // Note that the post may be aborted by now, which will just cause Init to // fail with CONNECTION_UNAVAILABLE. - HttpResponse http_response = connection->Init(sync_request_url_, access_token, - buffer_in, allow_batching); + HttpResponse http_response = + connection->Init(sync_request_url_, access_token, buffer_in); if (http_response.server_status == HttpResponse::SYNC_AUTH_ERROR) { ClearAccessToken();
diff --git a/components/sync/engine/net/sync_server_connection_manager.h b/components/sync/engine/net/sync_server_connection_manager.h index ef16763..30e7749 100644 --- a/components/sync/engine/net/sync_server_connection_manager.h +++ b/components/sync/engine/net/sync_server_connection_manager.h
@@ -37,7 +37,6 @@ HttpResponse PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) override; private:
diff --git a/components/sync/engine/net/sync_server_connection_manager_unittest.cc b/components/sync/engine/net/sync_server_connection_manager_unittest.cc index 5ae71a3..404d0e8 100644 --- a/components/sync/engine/net/sync_server_connection_manager_unittest.cc +++ b/components/sync/engine/net/sync_server_connection_manager_unittest.cc
@@ -31,7 +31,6 @@ void SetPostPayload(const char* content_type, int content_length, const char* content) override {} - void SetAllowBatching(bool allow_batching) override {} bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override { wait_for_abort_.TimedWait(TestTimeouts::action_max_timeout()); @@ -72,8 +71,7 @@ &signal); std::string buffer_out; - HttpResponse http_response = - server.PostBuffer("", "testauth", /*allow_batching=*/false, &buffer_out); + HttpResponse http_response = server.PostBuffer("", "testauth", &buffer_out); EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, http_response.server_status); } @@ -87,8 +85,7 @@ signal.Signal(); std::string buffer_out; - HttpResponse http_response = - server.PostBuffer("", "testauth", /*allow_batching=*/false, &buffer_out); + HttpResponse http_response = server.PostBuffer("", "testauth", &buffer_out); EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, http_response.server_status); } @@ -108,8 +105,7 @@ TestTimeouts::tiny_timeout()); std::string buffer_out; - HttpResponse http_response = - server.PostBuffer("", "testauth", /*allow_batching=*/false, &buffer_out); + HttpResponse http_response = server.PostBuffer("", "testauth", &buffer_out); EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, http_response.server_status); abort_thread.Stop(); @@ -127,7 +123,6 @@ void SetPostPayload(const char* content_type, int content_length, const char* content) override {} - void SetAllowBatching(bool allow_batching) override {} bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override { *net_error_code = net_error_code_; @@ -173,8 +168,7 @@ std::make_unique<FailingHttpPostFactory>(net::ERR_TIMED_OUT), &signal); std::string buffer_out; - HttpResponse http_response = - server.PostBuffer("", "testauth", /*allow_batching=*/false, &buffer_out); + HttpResponse http_response = server.PostBuffer("", "testauth", &buffer_out); EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, http_response.server_status); }
diff --git a/components/sync/engine/sync_manager_impl_unittest.cc b/components/sync/engine/sync_manager_impl_unittest.cc index 3e6d825e..6170067 100644 --- a/components/sync/engine/sync_manager_impl_unittest.cc +++ b/components/sync/engine/sync_manager_impl_unittest.cc
@@ -61,7 +61,6 @@ void SetPostPayload(const char* content_type, int content_length, const char* content) override {} - void SetAllowBatching(bool allow_batching) override {} bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override { return false;
diff --git a/components/sync/engine/syncer_proto_util.cc b/components/sync/engine/syncer_proto_util.cc index 0e15ed2..2a174e79 100644 --- a/components/sync/engine/syncer_proto_util.cc +++ b/components/sync/engine/syncer_proto_util.cc
@@ -440,19 +440,10 @@ const base::Time start_time = base::Time::Now(); - // User-initiated sync messages should not be batched. GET_UPDATES messages - // are mostly safe to consider non-user-initiated. - // TODO(https://crbug.com/1293657): Confirm that treating GET_UPDATES as - // non-user-initiated is reasonable. GET_UPDATES messages could be latency - // sensitive since these requests most commonly happen because of some - // user-initiated changes on a different device. - bool allow_batching = - msg.message_contents() == ClientToServerMessage::GET_UPDATES; - // Fills in buffer_out. std::string buffer_out; HttpResponse http_response = - scm->PostBufferWithCachedAuth(buffer_in, allow_batching, &buffer_out); + scm->PostBufferWithCachedAuth(buffer_in, &buffer_out); if (http_response.server_status != HttpResponse::SERVER_CONNECTION_OK) { LOG(WARNING) << "Error posting from syncer:" << http_response; return false;
diff --git a/components/sync/engine/syncer_proto_util_unittest.cc b/components/sync/engine/syncer_proto_util_unittest.cc index 5a18c53..543de62 100644 --- a/components/sync/engine/syncer_proto_util_unittest.cc +++ b/components/sync/engine/syncer_proto_util_unittest.cc
@@ -224,7 +224,6 @@ HttpResponse PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) override { if (send_error_) { return HttpResponse::ForIoErrorForTest();
diff --git a/components/sync/test/fake_server_http_post_provider.cc b/components/sync/test/fake_server_http_post_provider.cc index 7628632d..02e2ef4 100644 --- a/components/sync/test/fake_server_http_post_provider.cc +++ b/components/sync/test/fake_server_http_post_provider.cc
@@ -67,8 +67,6 @@ request_content_.assign(content, content_length); } -void FakeServerHttpPostProvider::SetAllowBatching(bool allow_batching) {} - bool FakeServerHttpPostProvider::MakeSynchronousPost(int* net_error_code, int* http_status_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/components/sync/test/fake_server_http_post_provider.h b/components/sync/test/fake_server_http_post_provider.h index d81962d..a84e5d36 100644 --- a/components/sync/test/fake_server_http_post_provider.h +++ b/components/sync/test/fake_server_http_post_provider.h
@@ -36,7 +36,6 @@ void SetPostPayload(const char* content_type, int content_length, const char* content) override; - void SetAllowBatching(bool allow_batching) override; bool MakeSynchronousPost(int* net_error_code, int* http_status_code) override; void Abort() override; int GetResponseContentLength() const override;
diff --git a/components/sync/test/mock_connection_manager.cc b/components/sync/test/mock_connection_manager.cc index b693c87c..77ba1ea 100644 --- a/components/sync/test/mock_connection_manager.cc +++ b/components/sync/test/mock_connection_manager.cc
@@ -68,7 +68,6 @@ HttpResponse MockConnectionManager::PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) { ClientToServerMessage post; if (!post.ParseFromString(buffer_in)) {
diff --git a/components/sync/test/mock_connection_manager.h b/components/sync/test/mock_connection_manager.h index 5eb3e23..6357dc5 100644 --- a/components/sync/test/mock_connection_manager.h +++ b/components/sync/test/mock_connection_manager.h
@@ -58,7 +58,6 @@ // Overridden ServerConnectionManager functions. HttpResponse PostBuffer(const std::string& buffer_in, const std::string& access_token, - bool allow_batching, std::string* buffer_out) override; // Control of commit response.
diff --git a/components/update_client/net/network_impl.cc b/components/update_client/net/network_impl.cc index 3407e4d9..f617cd8 100644 --- a/components/update_client/net/network_impl.cc +++ b/components/update_client/net/network_impl.cc
@@ -17,7 +17,6 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" -#include "services/network/public/cpp/simple_url_loader_throttle.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "url/gurl.h" @@ -120,8 +119,6 @@ resource_request->headers.SetHeader(header.first, header.second); simple_url_loader_ = network::SimpleURLLoader::Create( std::move(resource_request), traffic_annotation); - if (network::SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)) - simple_url_loader_->SetAllowBatching(); simple_url_loader_->SetRetryOptions( kMaxRetriesOnNetworkChange, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE);
diff --git a/components/user_education/views/BUILD.gn b/components/user_education/views/BUILD.gn index bbc3081..9a7711a 100644 --- a/components/user_education/views/BUILD.gn +++ b/components/user_education/views/BUILD.gn
@@ -21,6 +21,7 @@ "help_bubble_factory_mac.h", "help_bubble_factory_mac.mm", ] + configs += [ "//build/config/compiler:enable_arc" ] } public_deps = [ "//components/user_education/common" ]
diff --git a/components/user_education/views/help_bubble_factory_mac.mm b/components/user_education/views/help_bubble_factory_mac.mm index 5684e2b9..10b7446 100644 --- a/components/user_education/views/help_bubble_factory_mac.mm +++ b/components/user_education/views/help_bubble_factory_mac.mm
@@ -14,6 +14,10 @@ #include "ui/views/interaction/element_tracker_views.h" #include "ui/views/widget/widget.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace user_education { DEFINE_FRAMEWORK_SPECIFIC_METADATA(HelpBubbleFactoryMac)
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 67d7619..677be7ae 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -700,6 +700,8 @@ // WebUIMessageHandler implementation. void RegisterMessages() override; + void OnJavascriptAllowed() override; + void OnJavascriptDisallowed() override; // GpuDataManagerObserver implementation. void OnGpuInfoUpdate() override; @@ -708,17 +710,13 @@ void OnGpuSwitched(gl::GpuPreference) override; // Messages - void OnBrowserBridgeInitialized(const base::Value::List& list); - void OnCallAsync(const base::Value::List& list); + void HandleGetGpuInfo(const base::Value::List& list); + void HandleGetClientInfo(const base::Value::List& list); + void HandleGetLogMessages(const base::Value::List& list); - // Submessages dispatched from OnCallAsync - base::Value::Dict OnRequestClientInfo(); - base::Value::List OnRequestLogMessages(); - - private: - // True if observing the GpuDataManager (re-attaching as observer would - // DCHECK). - bool observing_; + base::Value::Dict GetClientInfo(); + base::Value::List GetLogMessages(); + base::Value::Dict GetGpuInfoDict(); }; //////////////////////////////////////////////////////////////////////////////// @@ -727,13 +725,10 @@ // //////////////////////////////////////////////////////////////////////////////// -GpuMessageHandler::GpuMessageHandler() - : observing_(false) { -} +GpuMessageHandler::GpuMessageHandler() = default; GpuMessageHandler::~GpuMessageHandler() { - ui::GpuSwitchingManager::GetInstance()->RemoveObserver(this); - GpuDataManagerImpl::GetInstance()->RemoveObserver(this); + OnJavascriptDisallowed(); } /* BrowserBridge.callAsync prepends a requestID to these messages. */ @@ -741,49 +736,46 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); web_ui()->RegisterMessageCallback( - "browserBridgeInitialized", - base::BindRepeating(&GpuMessageHandler::OnBrowserBridgeInitialized, + "getGpuInfo", base::BindRepeating(&GpuMessageHandler::HandleGetGpuInfo, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "getClientInfo", + base::BindRepeating(&GpuMessageHandler::HandleGetClientInfo, base::Unretained(this))); web_ui()->RegisterMessageCallback( - "callAsync", base::BindRepeating(&GpuMessageHandler::OnCallAsync, - base::Unretained(this))); + "getLogMessages", + base::BindRepeating(&GpuMessageHandler::HandleGetLogMessages, + base::Unretained(this))); } -void GpuMessageHandler::OnCallAsync(const base::Value::List& args_list) { - DCHECK_GE(args_list.size(), 2u); - DCHECK(args_list[1].is_string()) << "submessage isn't string"; - - // unpack args into requestId, submessage and submessageArgs - const base::Value& requestId = args_list[0]; - std::string submessage; - submessage = args_list[1].GetString(); - - // call the submessage handler - if (submessage == "requestClientInfo") { - web_ui()->CallJavascriptFunctionUnsafe("browserBridge.onCallAsyncReply", - requestId, OnRequestClientInfo()); - } else if (submessage == "requestLogMessages") { - web_ui()->CallJavascriptFunctionUnsafe("browserBridge.onCallAsyncReply", - requestId, OnRequestLogMessages()); - } else { // unrecognized submessage - NOTREACHED(); - - web_ui()->CallJavascriptFunctionUnsafe("browserBridge.onCallAsyncReply", - requestId); - return; - } +void GpuMessageHandler::OnJavascriptAllowed() { + GpuDataManagerImpl::GetInstance()->AddObserver(this); + ui::GpuSwitchingManager::GetInstance()->AddObserver(this); } -void GpuMessageHandler::OnBrowserBridgeInitialized( - const base::Value::List& args) { +void GpuMessageHandler::OnJavascriptDisallowed() { + ui::GpuSwitchingManager::GetInstance()->RemoveObserver(this); + GpuDataManagerImpl::GetInstance()->RemoveObserver(this); +} + +void GpuMessageHandler::HandleGetClientInfo(const base::Value::List& args) { + CHECK_EQ(1U, args.size()); + AllowJavascript(); + const base::Value& callback_id = args[0]; + ResolveJavascriptCallback(callback_id, GetClientInfo()); +} + +void GpuMessageHandler::HandleGetLogMessages(const base::Value::List& args) { + CHECK_EQ(1U, args.size()); + AllowJavascript(); + const base::Value& callback_id = args[0]; + ResolveJavascriptCallback(callback_id, GetLogMessages()); +} + +void GpuMessageHandler::HandleGetGpuInfo(const base::Value::List& args) { + CHECK_EQ(1U, args.size()); DCHECK_CURRENTLY_ON(BrowserThread::UI); - - // Watch for changes in GPUInfo - if (!observing_) { - GpuDataManagerImpl::GetInstance()->AddObserver(this); - ui::GpuSwitchingManager::GetInstance()->AddObserver(this); - } - observing_ = true; + AllowJavascript(); // Tell GpuDataManager it should have full GpuInfo. If the // Gpu process has not run yet, this will trigger its launch. @@ -792,12 +784,13 @@ GpuDataManagerImpl::kGpuInfoRequestAll, /*delayed=*/false); - // Run callback immediately in case the info is ready and no update in the - // future. - OnGpuInfoUpdate(); + // Send current snapshot of gpu info. Any future updates will be communicated + // via the OnGpuInfoUpdate() callback. + const base::Value& callback_id = args[0]; + ResolveJavascriptCallback(callback_id, GetGpuInfoDict()); } -base::Value::Dict GpuMessageHandler::OnRequestClientInfo() { +base::Value::Dict GpuMessageHandler::GetClientInfo() { DCHECK_CURRENTLY_ON(BrowserThread::UI); base::Value::Dict dict; @@ -820,13 +813,13 @@ return dict; } -base::Value::List GpuMessageHandler::OnRequestLogMessages() { +base::Value::List GpuMessageHandler::GetLogMessages() { DCHECK_CURRENTLY_ON(BrowserThread::UI); return GpuDataManagerImpl::GetInstance()->GetLogMessages(); } -void GpuMessageHandler::OnGpuInfoUpdate() { +base::Value::Dict GpuMessageHandler::GetGpuInfoDict() { // Get GPU Info. const gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); const gfx::GpuExtraInfo gpu_extra_info = @@ -875,9 +868,11 @@ gpu_info_val.Set("devicePerfInfo", GetDevicePerfInfo()); gpu_info_val.Set("dawnInfo", GetDawnInfo()); - // Send GPU Info to javascript. - web_ui()->CallJavascriptFunctionUnsafe("browserBridge.onGpuInfoUpdate", - std::move(gpu_info_val)); + return gpu_info_val; +} + +void GpuMessageHandler::OnGpuInfoUpdate() { + FireWebUIListener("gpu-info-updated", GetGpuInfoDict()); } void GpuMessageHandler::OnGpuSwitched(gl::GpuPreference active_gpu_heuristic) {
diff --git a/content/browser/media/capture/desktop_streams_registry_impl.cc b/content/browser/media/capture/desktop_streams_registry_impl.cc index 30144b2..038e44d 100644 --- a/content/browser/media/capture/desktop_streams_registry_impl.cc +++ b/content/browser/media/capture/desktop_streams_registry_impl.cc
@@ -50,7 +50,6 @@ int render_frame_id, const url::Origin& origin, const DesktopMediaID& source, - const std::string& extension_name, const DesktopStreamRegistryType type) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -61,7 +60,6 @@ stream.render_frame_id = render_frame_id; stream.origin = origin; stream.source = source; - stream.extension_name = extension_name; stream.type = type; GetUIThreadTaskRunner({})->PostDelayedTask( @@ -78,7 +76,6 @@ int render_process_id, int render_frame_id, const url::Origin& origin, - std::string* extension_name, const DesktopStreamRegistryType type) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -94,9 +91,6 @@ } DesktopMediaID result = it->second.source; - if (extension_name) { - *extension_name = it->second.extension_name; - } approved_streams_.erase(it); return result; }
diff --git a/content/browser/media/capture/desktop_streams_registry_impl.h b/content/browser/media/capture/desktop_streams_registry_impl.h index e6b1ff0..179ea24f 100644 --- a/content/browser/media/capture/desktop_streams_registry_impl.h +++ b/content/browser/media/capture/desktop_streams_registry_impl.h
@@ -31,7 +31,6 @@ int render_frame_id, const url::Origin& origin, const DesktopMediaID& source, - const std::string& extension_name, const DesktopStreamRegistryType type) override; DesktopMediaID RequestMediaForStreamId( @@ -39,7 +38,6 @@ int render_process_id, int render_frame_id, const url::Origin& origin, - std::string* extension_name, const DesktopStreamRegistryType type) override; private: @@ -51,7 +49,6 @@ int render_frame_id; url::Origin origin; DesktopMediaID source; - std::string extension_name; DesktopStreamRegistryType type; }; typedef std::map<std::string, ApprovedDesktopMediaStream> StreamsMap;
diff --git a/content/browser/navigation_browsertest.cc b/content/browser/navigation_browsertest.cc index 3d756dc..9945e85 100644 --- a/content/browser/navigation_browsertest.cc +++ b/content/browser/navigation_browsertest.cc
@@ -5534,6 +5534,30 @@ base::test::ScopedFeatureList feature_list_; }; +// A helper that invokes `functor` on the next `DidStartNavigation()`. +template <typename F> +void OnNextDidStartNavigation(WebContents* web_contents, F&& functor) { + class Observer : public WebContentsObserver { + public: + using Callback = base::OnceCallback<void(NavigationHandle*)>; + + explicit Observer(WebContents* web_contents, Callback callback) + : WebContentsObserver(web_contents), callback_(std::move(callback)) {} + + // WebContentsObserver overrides: + void DidStartNavigation(NavigationHandle* handle) override { + std::move(callback_).Run(handle); + delete this; + } + + private: + Callback callback_; + }; + + new Observer(web_contents, + base::BindLambdaForTesting(std::forward<F>(functor))); +} + IN_PROC_BROWSER_TEST_F(UndoCommitNavigationBrowserTest, PerformanceManagerFrameTreeConsistency) { // PerformanceManager reports when a remote frame is attached to a local @@ -5573,22 +5597,9 @@ EXPECT_EQ(a_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where a new navigation to c.com begins after the browser - // sends `CommitNavigation() to the a.com renderer, but before - // `DidCommitNavigation()` has been received from the a.com renderer. - // - // Note that the actual race is only triggered when the browser process - // receives the `DidCommitProvisionalLoad()` IPC from the renderer, which has - // not occurred yet. However, the interceptor needs to be installed now, - // before the `ExecJs()` call below, since `ExecJs()` runs the message loop, - // and the `DidCommitProvisionalLoad()` message could be received inside that - // message loop. - const GURL final_url = - embedded_test_server()->GetURL("c.com", "/title1.html"); - BeginNavigationInCommitCallbackInterceptor interceptor(first_subframe_node, - final_url); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + // Pause (and ignore) the next `DidCommitProvisionalLoad()` for a.com. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); // Update the id attribute to exercise a PerformanceManager-specific code // path: when the renderer swaps in a `blink::RemoteFrame` to undo the @@ -5600,6 +5611,12 @@ EXPECT_TRUE(ExecJs(web_contents, "document.querySelector('iframe').id = 'new-name';")); + // Now begin a new navigation to c.com while the previous a.com navigation + // above is paused in the pending commit state. + const GURL final_url = + embedded_test_server()->GetURL("c.com", "/title1.html"); + ASSERT_TRUE(BeginNavigateToURLFromRenderer(first_subframe_node, final_url)); + EXPECT_TRUE(WaitForLoadStop(web_contents)); EXPECT_EQ(final_url, first_subframe_node->render_manager() ->current_frame_host() @@ -5607,6 +5624,8 @@ auto results = logger.results(); ASSERT_EQ(2u, results.size()); + // This test always uses UndoCommitNavigation, so navigation corresponding to + // the paused commit should never commit. EXPECT_FALSE(results[0].committed); EXPECT_EQ(absl::nullopt, results[0].origin); EXPECT_EQ(infinitely_loading_url, results[0].url); @@ -5615,51 +5634,6 @@ EXPECT_EQ(final_url, results[1].url); } -// Helper that ignores a request from the renderer to commit a navigation and -// detaches the nth child (0-indexed) of `frame_tree_node` instead. -class DetachChildFrameInCommitCallbackInterceptor - : public RenderFrameHostImpl::CommitCallbackInterceptor { - public: - DetachChildFrameInCommitCallbackInterceptor(FrameTreeNode* frame_tree_node, - int child_to_detach) - : frame_tree_node_(frame_tree_node), child_to_detach_(child_to_detach) {} - - bool WillProcessDidCommitNavigation( - NavigationRequest* request, - mojom::DidCommitProvisionalLoadParamsPtr* params, - mojom::DidCommitProvisionalLoadInterfaceParamsPtr* interface_params) - override { - request->GetRenderFrameHost()->SetCommitCallbackInterceptorForTesting( - nullptr); - // At this point, the renderer has already committed the RenderFrame, but - // on the browser side, the RenderFrameHost is still speculative. - - // Intentionally do not wait for script completion here. This runs an event - // loop that pumps incoming messages, but that would cause us to process - // IPCs from b.com out of order (since process DidCommitNavigation has been - // interrupted by this hook). - ExecuteScriptAsync( - frame_tree_node_.get(), - JsReplace("document.querySelectorAll('iframe')[$1].remove()", - child_to_detach_)); - - // However, since it's not possible to wait for `remove()` to take effect, - // the test must cheat a little and directly call the Mojo IPC that the JS - // above would eventually trigger. - frame_tree_node_->child_at(child_to_detach_) - ->render_manager() - ->current_frame_host() - ->Detach(); - - // Ignore the commit message and pretend it never arrived. - return false; - } - - private: - const raw_ptr<FrameTreeNode> frame_tree_node_; - const int child_to_detach_; -}; - // Regression test for https://crbug.com/1223837. Previously, if a child frame // was in the middle of committing a navigation to a provisional frame in render // process B while render process A simultaneously detaches that child frame, @@ -5695,12 +5669,25 @@ EXPECT_EQ(b_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where the a.com renderer detaches the second child frame - // after the browser sends `CommitNavigation()` to the b.com renderer. - DetachChildFrameInCommitCallbackInterceptor interceptor( - web_contents->GetPrimaryFrameTree().root(), 1); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + // Pause (and ignore) the next `DidCommitProvisionalLoad()` for b.com. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); + + // At this point, the b.com renderer has already committed the RenderFrame, + // but on the browser side, the RenderFrameHost is still speculative. + + // Intentionally do not wait for script completion here. This runs an event + // loop that pumps incoming messages, but IPCs from b.com would be processed + // out of order, since the `DidCommitProvisionalLoad()` attempt was previously + // paused above. + ExecuteScriptAsync( + web_contents, + JsReplace("document.querySelectorAll('iframe')[1].remove()")); + + // However, since it's not possible to wait for `remove()` to take effect, + // the test must cheat a little and directly call the Mojo IPC that the JS + // above would eventually trigger. + second_subframe_node->render_manager()->current_frame_host()->Detach(); EXPECT_TRUE(WaitForLoadStop(web_contents)); // Validate that render process for b.com has handled the detach message for @@ -5743,8 +5730,34 @@ base::test::ScopedFeatureList feature_list_; }; +class ResumeCommitClosureSetWaiter { + public: + explicit ResumeCommitClosureSetWaiter(NavigationHandle* handle) { + // `Helper` "observes" the set via its own destruction, since the navigation + // code setting a resume commit closure will replace the testing one + // installed here. + NavigationRequest::From(handle)->set_resume_commit_closure( + base::DoNothingWithBoundArgs(std::make_unique<Helper>(loop_))); + } + + void Wait() { loop_.Run(); } + + private: + class Helper { + public: + explicit Helper(base::RunLoop& loop) : loop_(loop) {} + + ~Helper() { loop_->Quit(); } + + private: + raw_ref<base::RunLoop> loop_; + }; + + base::RunLoop loop_; +}; + IN_PROC_BROWSER_TEST_P(CommitNavigationRaceBrowserTest, - BeginNewNavigationAfterCommitNavigationInMainFrame) { + BeginNewNavigationDuringCommitNavigationInMainFrame) { ASSERT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", "/title1.html"))); @@ -5782,15 +5795,32 @@ EXPECT_EQ(b_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where a new navigation to c.com begins after the browser - // sends `CommitNavigation() to the b.com renderer, but before - // `DidCommitNavigation()` has been received from the b.com renderer. + // Pause (and potentially ignore, if navigation queueing is disabled) the next + // `DidCommitProvisionalLoad()` for b.com. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); + + absl::optional<ResumeCommitClosureSetWaiter> resume_commit_closure_set_waiter; + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + // If navigation queueing is enabled, the test should verify that a resume + // commit closure is actually set. Install a watcher now, before beginning + // the next navigation, since the resume commit closure may synchronously + // set while handling the `BeginNavigation()` IPC in the browser. + OnNextDidStartNavigation(web_contents, [&](NavigationHandle* handle) { + resume_commit_closure_set_waiter.emplace(handle); + }); + } + + // Now begin a new navigation to c.com while the previous b.com navigation + // above is paused in the pending commit state. const GURL final_url = embedded_test_server()->GetURL("c.com", "/title1.html"); - BeginNavigationInCommitCallbackInterceptor interceptor( - web_contents->GetPrimaryFrameTree().root(), final_url); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + ASSERT_TRUE(BeginNavigateToURLFromRenderer(web_contents, final_url)); + + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + resume_commit_closure_set_waiter->Wait(); + commit_pauser.ResumePausedCommit(); + } EXPECT_TRUE(WaitForLoadStop(web_contents)); EXPECT_EQ(final_url, web_contents->GetLastCommittedURL()); @@ -5815,7 +5845,7 @@ } IN_PROC_BROWSER_TEST_P(CommitNavigationRaceBrowserTest, - BeginNewNavigationAfterCommitNavigationInSubFrame) { + BeginNewNavigationDuringCommitNavigationInSubFrame) { ASSERT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL( "b.com", "/cross_site_iframe_factory.html?b(a)"))); @@ -5847,15 +5877,32 @@ EXPECT_EQ(b_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where a new navigation to c.com begins after the browser - // sends `CommitNavigation() to the b.com renderer, but before - // `DidCommitNavigation()` has been received from the b.com renderer. + // Pause (and potentially ignore, if navigation queueing is disabled) the next + // `DidCommitProvisionalLoad()` for b.com. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); + + absl::optional<ResumeCommitClosureSetWaiter> resume_commit_closure_set_waiter; + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + // If navigation queueing is enabled, the test should verify that a resume + // commit closure is actually set. Install a watcher now, before beginning + // the next navigation, since the resume commit closure may synchronously + // set while handling the `BeginNavigation()` IPC in the browser. + OnNextDidStartNavigation(web_contents, [&](NavigationHandle* handle) { + resume_commit_closure_set_waiter.emplace(handle); + }); + } + + // Now begin a new navigation to c.com while the previous b.com navigation + // above is paused in the pending commit state. const GURL final_url = embedded_test_server()->GetURL("c.com", "/title1.html"); - BeginNavigationInCommitCallbackInterceptor interceptor(first_subframe_node, - final_url); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + ASSERT_TRUE(BeginNavigateToURLFromRenderer(first_subframe_node, final_url)); + + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + resume_commit_closure_set_waiter->Wait(); + commit_pauser.ResumePausedCommit(); + } EXPECT_TRUE(WaitForLoadStop(web_contents)); EXPECT_EQ(final_url, first_subframe_node->render_manager() @@ -5885,7 +5932,7 @@ // different path to commit the navigation in the renderer. IN_PROC_BROWSER_TEST_P( CommitNavigationRaceBrowserTest, - BeginNewNavigationWithNoUrlLoaderAfterCommitNavigationInMainFrame) { + BeginNewNavigationWithNoUrlLoaderDuringCommitNavigationInMainFrame) { ASSERT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", "/title1.html"))); @@ -5923,17 +5970,31 @@ EXPECT_EQ(b_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where a new navigation to about:blank begins after the - // browser sends `CommitNavigation() to the b.com renderer, but before - // `DidCommitNavigation()` has been received from the b.com renderer. The - // navigation should be treated as if it started in the FrameTreeNode's - // current frame host, which has origin a.com, since the aforementioned - // navigation to b.com should not be treated as committed yet. + // Pause (and potentially ignore, if navigation queueing is disabled) the next + // `DidCommitProvisionalLoad()` for b.com. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); + + absl::optional<ResumeCommitClosureSetWaiter> resume_commit_closure_set_waiter; + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + // If navigation queueing is enabled, the test should verify that a resume + // commit closure is actually set. Install a watcher now, before beginning + // the next navigation, since the resume commit closure may synchronously + // set while handling the `BeginNavigation()` IPC in the browser. + OnNextDidStartNavigation(web_contents, [&](NavigationHandle* handle) { + resume_commit_closure_set_waiter.emplace(handle); + }); + } + + // Note that this navigation is initiated by the a.com renderer, as the a.com + // renderer is still the current frame host for the main frame. const GURL final_url("about:blank"); - BeginNavigationInCommitCallbackInterceptor interceptor( - web_contents->GetPrimaryFrameTree().root(), final_url); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + ASSERT_TRUE(BeginNavigateToURLFromRenderer(web_contents, final_url)); + + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + resume_commit_closure_set_waiter->Wait(); + commit_pauser.ResumePausedCommit(); + } EXPECT_TRUE(WaitForLoadStop(web_contents)); EXPECT_EQ(final_url, web_contents->GetLastCommittedURL()); @@ -5959,7 +6020,7 @@ IN_PROC_BROWSER_TEST_P( CommitNavigationRaceBrowserTest, - BeginNewNavigationWithNoUrlLoaderAfterCommitNavigationInSubFrame) { + BeginNewNavigationWithNoUrlLoaderDuringCommitNavigationInSubFrame) { ASSERT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL( "b.com", "/cross_site_iframe_factory.html?b(a)"))); @@ -5991,17 +6052,29 @@ EXPECT_EQ(b_com_render_process_host, speculative_render_frame_host->GetProcess()); - // Simulates a race where a new navigation to about:blank begins after the - // browser sends `CommitNavigation() to the b.com renderer, but before - // `DidCommitNavigation()` has been received from the b.com renderer. The - // navigation should be treated as if it started in the FrameTreeNode's - // current frame host, which has origin a.com, since the aforementioned - // navigation to b.com should not be treated as committed yet. + CommitNavigationPauser commit_pauser(speculative_render_frame_host); + commit_pauser.WaitForCommitAndPause(); + + absl::optional<ResumeCommitClosureSetWaiter> resume_commit_closure_set_waiter; + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + // If navigation queueing is enabled, the test should verify that a resume + // commit closure is actually set. Install a watcher now, before beginning + // the next navigation, since the resume commit closure may synchronously + // set while handling the `BeginNavigation()` IPC in the browser. + OnNextDidStartNavigation(web_contents, [&](NavigationHandle* handle) { + resume_commit_closure_set_waiter.emplace(handle); + }); + } + + // Note that this navigation is initiated by the a.com renderer, as the a.com + // renderer is still the current frame host for the main frame. const GURL final_url("about:blank"); - BeginNavigationInCommitCallbackInterceptor interceptor(first_subframe_node, - final_url); - speculative_render_frame_host->SetCommitCallbackInterceptorForTesting( - &interceptor); + ASSERT_TRUE(BeginNavigateToURLFromRenderer(first_subframe_node, final_url)); + + if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { + resume_commit_closure_set_waiter->Wait(); + commit_pauser.ResumePausedCommit(); + } EXPECT_TRUE(WaitForLoadStop(web_contents)); EXPECT_EQ(final_url, first_subframe_node->render_manager()
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 4aaed1f6..f45a84e 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -2803,7 +2803,7 @@ // Resolve DesktopMediaID for the specified device id. return DesktopStreamsRegistry::GetInstance()->RequestMediaForStreamId( capture_device_id, requesting_process_id, requesting_frame_id, - url::Origin::Create(origin), nullptr, kRegistryStreamTypeTab); + url::Origin::Create(origin), kRegistryStreamTypeTab); } void MediaStreamManager::FinishTabCaptureRequestSetupWithDeviceId(
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc index bc7ac50..966c30c 100644 --- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -90,6 +90,7 @@ namespace { using testing::ElementsAre; +using testing::HasSubstr; using testing::IsEmpty; using InitialNavigationEntryState = NavigationEntryImpl::InitialNavigationEntryState; @@ -14409,7 +14410,11 @@ // Trying to navigate to an empty URL through setting the location would fail // because it's not a valid URL and it's stopped in the renderer. - EXPECT_FALSE(NavigateToURLFromRenderer(shell(), GURL())); + // + // Note: this is only true for things like about:blank and data URLs. + EXPECT_THAT(EvalJs(shell(), "try { location = ''; } catch (e) { e.message; }") + .ExtractString(), + HasSubstr("'' is not a valid URL.")); EXPECT_EQ(entry, controller.GetLastCommittedEntry()); EXPECT_EQ(2, controller.GetEntryCount());
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index 60b89be..14f26ee 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -3024,7 +3024,7 @@ bool for_legacy); private: - friend class ResumeCommitClosureSetObserver; + friend class CommitNavigationPauser; friend class RenderFrameHostPermissionsPolicyTest; friend class TestRenderFrameHost; friend class TestRenderViewHost;
diff --git a/content/browser/resources/gpu/browser_bridge.js b/content/browser/resources/gpu/browser_bridge.js index 1dc3306..bce908f 100644 --- a/content/browser/resources/gpu/browser_bridge.js +++ b/content/browser/resources/gpu/browser_bridge.js
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import {addWebUiListener, sendWithPromise} from 'chrome://resources/js/cr.js'; + /** * This class provides a 'bridge' for communicating between javascript and the * browser. When run outside of WebUI, e.g. as a regular webpage, it provides @@ -10,14 +12,18 @@ export class BrowserBridge extends EventTarget { constructor() { super(); - this.nextRequestId_ = 0; - this.pendingCallbacks_ = []; + this.clientInfo_ = null; + this.gpuInfo_ = null; this.logMessages_ = []; - // Tell c++ code that we are ready to receive GPU Info. - chrome.send('browserBridgeInitialized'); - this.beginRequestClientInfo_(); - this.beginRequestLogMessages_(); + // Request initial gpu info from the C++ backend. + sendWithPromise('getGpuInfo').then(this.onGpuInfoUpdate_.bind(this)); + + // Register a listener to receive future gpu info updates. + addWebUiListener('gpu-info-updated', this.onGpuInfoUpdate_.bind(this)); + + this.updateClientInfo_(); + this.updateLogMessages_(); } dispatchEvent_(eventName) { @@ -36,34 +42,6 @@ } /** - * Sends a message to the browser with specified args. The - * browser will reply asynchronously via the provided callback. - */ - callAsync(submessage, args, callback) { - const requestId = this.nextRequestId_; - this.nextRequestId_ += 1; - this.pendingCallbacks_[requestId] = callback; - if (!args) { - chrome.send('callAsync', [requestId.toString(), submessage]); - } else { - const allArgs = [requestId.toString(), submessage].concat(args); - chrome.send('callAsync', allArgs); - } - } - - /** - * Called by gpu c++ code when client info is ready. - */ - onCallAsyncReply(requestId, args) { - if (this.pendingCallbacks_[requestId] === undefined) { - throw new Error('requestId ' + requestId + ' is not pending'); - } - const callback = this.pendingCallbacks_[requestId]; - callback(args); - delete this.pendingCallbacks_[requestId]; - } - - /** * Get gpuInfo data. */ get gpuInfo() { @@ -71,9 +49,9 @@ } /** - * Called from gpu c++ code when GPU Info is updated. + * Called when GPU Info is updated. */ - onGpuInfoUpdate(gpuInfo) { + onGpuInfoUpdate_(gpuInfo) { this.gpuInfo_ = gpuInfo; this.dispatchEvent_('gpuInfoUpdate'); } @@ -82,17 +60,15 @@ * This function begins a request for the ClientInfo. If it comes back * as undefined, then we will issue the request again in 250ms. */ - beginRequestClientInfo_() { - this.callAsync( - 'requestClientInfo', undefined, - (function(data) { - if (data === undefined) { // try again in 250 ms - window.setTimeout(this.beginRequestClientInfo_.bind(this), 250); - } else { - this.clientInfo_ = data; - this.dispatchEvent_('clientInfoChange'); - } - }).bind(this)); + async updateClientInfo_() { + const data = await sendWithPromise('getClientInfo'); + + if (data === undefined) { // try again in 250 ms + window.setTimeout(this.updateClientInfo_.bind(this), 250); + } else { + this.clientInfo_ = data; + this.dispatchEvent_('clientInfoChange'); + } } /** @@ -106,17 +82,15 @@ * This function checks for new GPU_LOG messages. * If any are found, a refresh is triggered. */ - beginRequestLogMessages_() { - this.callAsync( - 'requestLogMessages', undefined, - (function(messages) { - if (messages.length !== this.logMessages_.length) { - this.logMessages_ = messages; - this.dispatchEvent_('logMessagesChange'); - } - // check again in 250 ms - window.setTimeout(this.beginRequestLogMessages_.bind(this), 250); - }).bind(this)); + async updateLogMessages_() { + const messages = await sendWithPromise('getLogMessages'); + + if (messages.length !== this.logMessages_.length) { + this.logMessages_ = messages; + this.dispatchEvent_('logMessagesChange'); + } + // check again in 250 ms + window.setTimeout(this.updateLogMessages_.bind(this), 250); } /**
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 7627143..5ef599c 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -1765,17 +1765,16 @@ ASSERT_FALSE(parent->IsFeatureEnabled( blink::mojom::PermissionsPolicyFeature::kTrustTokenRedemption)); + replacer.Activate(); + RenderFrameHost* child = static_cast<WebContentsImpl*>(web_contents) ->GetPrimaryFrameTree() .root() ->child_at(0) ->current_frame_host(); + ExecuteScriptAsync(child, JsReplace("location = $1", "/title2.html")); + RenderProcessHostBadMojoMessageWaiter kill_waiter(child->GetProcess()); - - replacer.Activate(); - - EXPECT_TRUE(BeginNavigateToURLFromRenderer(child, GURL("/title2.html"))); - EXPECT_THAT(kill_waiter.Wait(), Optional(HasSubstr("Permissions Policy feature is absent"))); } @@ -1806,17 +1805,16 @@ ASSERT_FALSE(parent->IsFeatureEnabled( blink::mojom::PermissionsPolicyFeature::kTrustTokenRedemption)); + replacer.Activate(); + RenderFrameHost* child = static_cast<WebContentsImpl*>(web_contents) ->GetPrimaryFrameTree() .root() ->child_at(0) ->current_frame_host(); + ExecuteScriptAsync(child, JsReplace("location = $1", "/title2.html")); + RenderProcessHostBadMojoMessageWaiter kill_waiter(child->GetProcess()); - - replacer.Activate(); - - EXPECT_TRUE(BeginNavigateToURLFromRenderer(child, GURL("/title2.html"))); - EXPECT_THAT(kill_waiter.Wait(), Optional(HasSubstr("Permissions Policy feature is absent"))); } @@ -1847,17 +1845,16 @@ ASSERT_FALSE(parent->IsFeatureEnabled( blink::mojom::PermissionsPolicyFeature::kPrivateStateTokenIssuance)); + replacer.Activate(); + RenderFrameHost* child = static_cast<WebContentsImpl*>(web_contents) ->GetPrimaryFrameTree() .root() ->child_at(0) ->current_frame_host(); + ExecuteScriptAsync(child, JsReplace("location = $1", "/title2.html")); + RenderProcessHostBadMojoMessageWaiter kill_waiter(child->GetProcess()); - - replacer.Activate(); - - EXPECT_TRUE(BeginNavigateToURLFromRenderer(child, GURL("/title2.html"))); - EXPECT_THAT(kill_waiter.Wait(), Optional(HasSubstr("Permissions Policy feature is absent"))); } @@ -1874,18 +1871,14 @@ GURL start_url(embedded_test_server()->GetURL("/title1.html")); EXPECT_TRUE(NavigateToURL(shell(), start_url)); - RenderFrameHost* compromised_renderer = web_contents->GetPrimaryMainFrame(); - RenderProcessHostBadMojoMessageWaiter kill_waiter( - compromised_renderer->GetProcess()); - replacer.Activate(); - // Can't use NavigateToURL here because it would hang. Additionally, we can't - // EXPECT_TRUE or EXPECT_FALSE: sometimes the ExecJs call will finish - // before the renderer gets killed, and sometimes it won't. - std::ignore = ExecJs(compromised_renderer, - JsReplace("location.href=$1", GURL("/title2.html"))); + RenderFrameHost* compromised_renderer = web_contents->GetPrimaryMainFrame(); + ExecuteScriptAsync(compromised_renderer, + JsReplace("location = $1", "/title2.html")); + RenderProcessHostBadMojoMessageWaiter kill_waiter( + compromised_renderer->GetProcess()); EXPECT_THAT( kill_waiter.Wait(), Optional(HasSubstr("Private State Token params in main frame nav")));
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 60af795c..589b081 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -4402,7 +4402,7 @@ shell()->LoadURL(in_scope_url); break; case SpeculativeStartupNavigationType::kRendererInitiatedNavigation: - EXPECT_TRUE(BeginNavigateToURLFromRenderer(shell(), in_scope_url)); + EXPECT_TRUE(ExecJs(shell(), JsReplace("location = $1", in_scope_url))); break; } dialog_waiter.Wait();
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index fdedbe2a..f5bb3e2 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc
@@ -28,6 +28,7 @@ #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/site_info.h" #include "content/browser/web_contents/web_contents_impl.h" +#include "content/browser/webui/url_data_manager_backend.h" #include "content/browser/webui/web_ui_controller_factory_registry.h" #include "content/public/browser/browser_or_resource_context.h" #include "content/public/browser/site_isolation_policy.h" @@ -138,6 +139,12 @@ RenderProcessHostImpl::set_render_process_host_factory_for_testing( &rph_factory_); SiteIsolationPolicy::DisableFlagCachingForTesting(); + + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + EXPECT_EQ(0U, policy->GetIsolatedOrigins().size()) + << "There should be no isolated origins registered on test startup. " + << "Some other test probably forgot to clean up the isolated origins " + << "it added."; } void TearDown() override { @@ -146,6 +153,12 @@ SetBrowserClientForTesting(old_browser_client_); RenderProcessHostImpl::set_render_process_host_factory_for_testing(nullptr); + + // Many tests in this file register custom isolated origins. This is + // stored in global state and could affect behavior in subsequent tests, so + // ensure that these origins are cleared between test runs. + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + policy->ClearIsolatedOriginsForTesting(); } void set_privileged_process_id(int process_id) { @@ -1340,10 +1353,6 @@ DoesURLRequireDedicatedProcess(isolation_context, isolated_blob_foo_url)); EXPECT_TRUE(DoesURLRequireDedicatedProcess(isolation_context, isolated_filesystem_foo_url)); - - // Cleanup. - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_foo_url)); - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_bar_url)); } TEST_F(SiteInstanceTest, IsolatedOriginsWithPort) { @@ -1375,11 +1384,6 @@ GetSiteForURL(isolation_context, isolated_foo_url)); EXPECT_EQ(isolated_foo_url, GetSiteForURL(isolation_context, isolated_foo_with_port)); - - // Cleanup. - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_foo_url)); - policy->RemoveIsolatedOriginForTesting( - url::Origin::Create(isolated_foo_with_port)); } // Check that only valid isolated origins are allowed to be registered. @@ -1459,10 +1463,6 @@ IsolatedOriginSource::TEST); EXPECT_TRUE(IsIsolatedOrigin(isolated_ip)); EXPECT_FALSE(IsIsolatedOrigin(GURL("http://42.127.0.0.1"))); - - // Cleanup. - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_url)); - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_ip)); } TEST_F(SiteInstanceTest, SubdomainOnIsolatedOrigin) { @@ -1509,9 +1509,6 @@ IsSameSite(context(), bar_isolated_foo_url, baz_isolated_foo_url)); EXPECT_TRUE( IsSameSite(context(), baz_isolated_foo_url, bar_isolated_foo_url)); - - // Cleanup. - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(isolated_foo_url)); } TEST_F(SiteInstanceTest, MultipleIsolatedOriginsWithCommonSite) { @@ -1552,10 +1549,6 @@ EXPECT_FALSE(IsSameSite(context(), bar_foo_url, qux_baz_bar_foo_url)); EXPECT_TRUE(IsSameSite(context(), baz_bar_foo_url, qux_baz_bar_foo_url)); - - // Cleanup. - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(foo_url)); - policy->RemoveIsolatedOriginForTesting(url::Origin::Create(baz_bar_foo_url)); } // Check that new SiteInstances correctly preserve the full URL that was used @@ -1799,14 +1792,13 @@ EXPECT_EQ(instance2->GetStoragePartitionConfig(), kGuestConfig); } -// TODO(https://crbug.com/1377466): Test is flaky for android builders. -#if BUILDFLAG(IS_ANDROID) -#define MAYBE_DoesSiteRequireDedicatedProcess \ - DISABLED_DoesSiteRequireDedicatedProcess -#else -#define MAYBE_DoesSiteRequireDedicatedProcess DoesSiteRequireDedicatedProcess -#endif -TEST_F(SiteInstanceTest, MAYBE_DoesSiteRequireDedicatedProcess) { +TEST_F(SiteInstanceTest, DoesSiteRequireDedicatedProcess) { + // Since this test injects a custom WebUI scheme below, ensure that the + // list of WebUI schemes isn't cached. Otherwise, a random unit test running + // before this test may triggers caching, causing the custom WebUI scheme to + // never be seen. + URLDataManagerBackend::SetDisallowWebUISchemeCachingForTesting(true); + class CustomBrowserClient : public EffectiveURLContentBrowserClient { public: CustomBrowserClient(const GURL& url_to_modify, @@ -1863,14 +1855,17 @@ IsolatedOriginSource::TEST); for (const auto& url : kUrlsThatAlwaysRequireADedicatedProcess) { - EXPECT_TRUE(DoesURLRequireDedicatedProcess(isolation_context, GURL(url))); + EXPECT_TRUE(DoesURLRequireDedicatedProcess(isolation_context, GURL(url))) + << " failing url: " << url; } for (const auto& url : kUrlsThatDoNotRequireADedicatedProcess) { EXPECT_EQ(AreAllSitesIsolatedForTesting(), - DoesURLRequireDedicatedProcess(isolation_context, GURL(url))); + DoesURLRequireDedicatedProcess(isolation_context, GURL(url))) + << " failing url: " << url; } SetBrowserClientForTesting(regular_client); + URLDataManagerBackend::SetDisallowWebUISchemeCachingForTesting(false); } TEST_F(SiteInstanceTest, DoWebUIURLsWithSubdomainsUseTLDForProcessLock) {
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc index 538bff08..612cf234 100644 --- a/content/browser/webui/url_data_manager_backend.cc +++ b/content/browser/webui/url_data_manager_backend.cc
@@ -65,6 +65,31 @@ return base::Contains(schemes, scheme); } +bool g_disallow_webui_scheme_caching_for_testing = false; + +std::vector<std::string> GetWebUISchemesSlow() { + std::vector<std::string> schemes; + schemes.emplace_back(kChromeUIScheme); + schemes.emplace_back(kChromeUIUntrustedScheme); + GetContentClient()->browser()->GetAdditionalWebUISchemes(&schemes); + return schemes; +} + +std::vector<std::string> GetWebUISchemesCached() { + // It's OK to cache this in a static because the class implementing + // GetAdditionalWebUISchemes() won't change while the application is + // running, and because those methods always add the same items. + // + // However, be careful using this with unit tests which use + // GetAdditionalWebUISchemes() to change the list of WebUI schemes, since + // this caching may persist across tests. For those, this caching should be + // disabled via SetDisallowWebUISchemeCachingForTesting(). + static base::NoDestructor<std::vector<std::string>> webui_schemes( + GetWebUISchemesSlow()); + + return *webui_schemes; +} + } // namespace URLDataManagerBackend::URLDataManagerBackend() : next_request_id_(0) { @@ -268,18 +293,16 @@ } std::vector<std::string> URLDataManagerBackend::GetWebUISchemes() { - // It's OK to cache this in a static because the class implementing - // GetAdditionalWebUISchemes() won't change while the application is - // running, and because those methods always add the same items. - static base::NoDestructor<std::vector<std::string>> webui_schemes([]() { - std::vector<std::string> schemes; - schemes.emplace_back(kChromeUIScheme); - schemes.emplace_back(kChromeUIUntrustedScheme); - GetContentClient()->browser()->GetAdditionalWebUISchemes(&schemes); - return schemes; - }()); + if (g_disallow_webui_scheme_caching_for_testing) { + return GetWebUISchemesSlow(); + } - return *webui_schemes; + return GetWebUISchemesCached(); +} + +void URLDataManagerBackend::SetDisallowWebUISchemeCachingForTesting( + bool disallow_caching) { + g_disallow_webui_scheme_caching_for_testing = disallow_caching; } } // namespace content
diff --git a/content/browser/webui/url_data_manager_backend.h b/content/browser/webui/url_data_manager_backend.h index 7105941..a4034bfc 100644 --- a/content/browser/webui/url_data_manager_backend.h +++ b/content/browser/webui/url_data_manager_backend.h
@@ -75,6 +75,12 @@ // its embedder). static std::vector<std::string> GetWebUISchemes(); + // When this is true, GetWebUISchemes() bypasses the caching of its result + // and always recomputes the list of WebUI schemes. This should be used in + // tests that inject custom WebUI schemes, which may otherwise not be seen. + CONTENT_EXPORT static void SetDisallowWebUISchemeCachingForTesting( + bool disallow_caching); + private: typedef std::map<std::string, scoped_refptr<URLDataSourceImpl>> DataSourceMap;
diff --git a/content/gpu/gpu_sandbox_hook_linux.cc b/content/gpu/gpu_sandbox_hook_linux.cc index 6be2dd1..37a4748 100644 --- a/content/gpu/gpu_sandbox_hook_linux.cc +++ b/content/gpu/gpu_sandbox_hook_linux.cc
@@ -179,6 +179,22 @@ static const char kDevJpegEncPath[] = "/dev/jpeg-enc"; permissions->push_back(BrokerFilePermission::ReadWrite(kDevJpegEncPath)); + // Additional device nodes for V4L2 JPEG decode encode accelerator drivers, + // as ChromeOS can have both /dev/jpeg-dec and /dev/jpeg-decN naming styles. + // See comments above for why we don't use a FileEnumerator. + static constexpr size_t MAX_V4L2_JPEG_NODES = 5; + for (size_t i = 0; i < MAX_V4L2_JPEG_NODES; i++) { + std::ostringstream jpegDecPath; + jpegDecPath << kDevJpegDecPath << i; + permissions->push_back( + BrokerFilePermission::ReadWrite(jpegDecPath.str())); + + std::ostringstream jpegEncPath; + jpegEncPath << kDevJpegEncPath << i; + permissions->push_back( + BrokerFilePermission::ReadWrite(jpegEncPath.str())); + } + if (UseChromecastSandboxAllowlist()) { static const char kAmlogicAvcEncoderPath[] = "/dev/amvenc_avc"; permissions->push_back(
diff --git a/content/public/browser/desktop_streams_registry.h b/content/public/browser/desktop_streams_registry.h index 99d5ecbe..b209d622 100644 --- a/content/public/browser/desktop_streams_registry.h +++ b/content/public/browser/desktop_streams_registry.h
@@ -38,7 +38,6 @@ int render_frame_id, const url::Origin& origin, const DesktopMediaID& source, - const std::string& extension_name, const DesktopStreamRegistryType type) = 0; // Validates stream identifier specified in getUserMedia(). Returns null @@ -51,7 +50,6 @@ int render_process_id, int render_frame_id, const url::Origin& origin, - std::string* extension_name, const DesktopStreamRegistryType type) = 0; };
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 1b7ab2c2..4322c1e 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -717,7 +717,11 @@ bool BeginNavigateToURLFromRenderer(const ToRenderFrameHost& adapter, const GURL& url) { - return ExecJs(adapter, JsReplace("location = $1", url)); + ExecuteScriptAsync(adapter, JsReplace("location = $1", url)); + DidStartNavigationObserver observer( + WebContents::FromRenderFrameHost(adapter.render_frame_host())); + observer.Wait(); + return observer.observed(); } bool NavigateIframeToURL(WebContents* web_contents,
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h index 6ccb29b..d20f18b 100644 --- a/content/public/test/browser_test_utils.h +++ b/content/public/test/browser_test_utils.h
@@ -187,6 +187,24 @@ int number_of_navigations, bool ignore_uncommitted_navigations = true); +// Helpers for performing renderer-initiated navigations. Note these helpers are +// only suitable when the navigation is expected to at least start successfully, +// i.e. result in a `DidStartNavigation()` notification. +// +// To write a test where the renderer itself blocks or cancels the navigation, +// use `ExecJs()` or `EvalJs()`, e.g.: +// +// EXPECT_THAT(ExecJs("try { location = ''; } catch (e) { e.message; }") +// .ExtractString(), +// HasSubStr("...")); +// +// To write a test where the navigation results in a bad message kill, use +// `ExecuteScriptAsync()` + `RenderProcessHostBadMojoMessageWaiter`, e.g.: +// +// ExecuteScriptAsync(rfh, JsReplace("location = $1", "/title2.html")); +// RenderProcessHostBadMojoMessageWaiter kill_waiter(rfh->GetProcess()); +// EXPECT_THAT(kill_waiter.Wait(), Optional(HasSubstr("..."))); + // Perform a renderer-initiated navigation of |window| to |url|, blocking // until the navigation finishes. The navigation is done by assigning // location.href in the frame |adapter|. Returns true if the page was loaded @@ -199,21 +217,20 @@ [[nodiscard]] bool NavigateToURLFromRenderer(const ToRenderFrameHost& adapter, const GURL& url, const GURL& expected_commit_url); + +// Similar to the two helpers above, but perform the renderer-initiated +// navigation without a user gesture. [[nodiscard]] bool NavigateToURLFromRendererWithoutUserGesture( const ToRenderFrameHost& adapter, const GURL& url); -// Similar to above but takes in an additional URL, |expected_commit_url|, to -// which the navigation should eventually commit. (See the browser-initiated -// counterpart for more details). + [[nodiscard]] bool NavigateToURLFromRendererWithoutUserGesture( const ToRenderFrameHost& adapter, const GURL& url, const GURL& expected_commit_url); -// Perform a renderer-initiated navigation of |window| to |url|. Unlike the -// previous set of helpers, does not block. The navigation is done by assigning -// location.href in the frame |adapter|. Returns the result of executing the IPC -// to evaluate the JS that assigns location.href. +// Perform a renderer-initiated navigation of `window` to `url`. Returns true if +// the navigation started successfully and false otherwise. [[nodiscard]] bool BeginNavigateToURLFromRenderer( const ToRenderFrameHost& adapter, const GURL& url);
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc index e88d8585..b36858b 100644 --- a/content/test/content_browser_test_utils_internal.cc +++ b/content/test/content_browser_test_utils_internal.cc
@@ -30,7 +30,6 @@ #include "content/browser/renderer_host/render_frame_proxy_host.h" #include "content/browser/site_instance_impl.h" #include "content/browser/web_contents/web_contents_impl.h" -#include "content/common/features.h" #include "content/common/frame_messages.mojom.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -954,95 +953,37 @@ return StoragePartitionConfig::CreateDefault(browser_context); } -ResumeCommitClosureSetObserver::ResumeCommitClosureSetObserver( - base::SafeRef<NavigationHandle> original_navigation, - mojom::DidCommitProvisionalLoadParamsPtr original_params, - mojom::DidCommitProvisionalLoadInterfaceParamsPtr original_interface_params) - : original_navigation_(std::move(original_navigation)), - original_params_(std::move(original_params)), - original_interface_params_(std::move(original_interface_params)) {} - -ResumeCommitClosureSetObserver::~ResumeCommitClosureSetObserver() { - NavigationRequest* original_request = - NavigationRequest::From(&*original_navigation_); - // Post a task just to avoid any potential weirdness with reentrancy. - base::SequencedTaskRunner::GetCurrentDefault()->PostNonNestableTask( - FROM_HERE, - base::BindOnce(&RenderFrameHostImpl::DidCommitNavigation, - base::Unretained(original_request->GetRenderFrameHost()), - original_request, std::move(original_params_), - std::move(original_interface_params_))); +CommitNavigationPauser::CommitNavigationPauser(RenderFrameHostImpl* rfh) { + rfh->SetCommitCallbackInterceptorForTesting(this); } -// Installs an observer that waits for `resume_commit_closure_` to be set on -// the next `NavigationRequest` seen by `DidStartNavigation()`. -class BeginNavigationInCommitCallbackInterceptor::ObserverInstaller - : public WebContentsObserver { - public: - explicit ObserverInstaller( - WebContents* web_contents, - base::SafeRef<NavigationHandle> original_navigation, - mojom::DidCommitProvisionalLoadParamsPtr original_params, - mojom::DidCommitProvisionalLoadInterfaceParamsPtr - original_interface_params) - : WebContentsObserver(web_contents), - original_navigation_(std::move(original_navigation)), - original_params_(std::move(original_params)), - original_interface_params_(std::move(original_interface_params)) {} +CommitNavigationPauser::~CommitNavigationPauser() = default; - // WebContentsObserver overrides: - void DidStartNavigation(NavigationHandle* handle) override { - NavigationRequest::From(handle)->set_resume_commit_closure( - base::BindLambdaForTesting( - [observer = std::make_unique<ResumeCommitClosureSetObserver>( - std::move(original_navigation_), std::move(original_params_), - std::move(original_interface_params_))] {})); - } +void CommitNavigationPauser::WaitForCommitAndPause() { + loop_.Run(); +} - base::SafeRef<NavigationHandle> original_navigation_; - mojom::DidCommitProvisionalLoadParamsPtr original_params_; - mojom::DidCommitProvisionalLoadInterfaceParamsPtr original_interface_params_; -}; +void CommitNavigationPauser::ResumePausedCommit() { + // The caller is responsible for ensuring the paused request is still alive + // and not discarded. + DCHECK(paused_request_); + paused_request_->GetRenderFrameHost()->DidCommitNavigation( + paused_request_.get(), std::move(paused_params_), + std::move(paused_interface_params_)); +} -BeginNavigationInCommitCallbackInterceptor:: - BeginNavigationInCommitCallbackInterceptor(FrameTreeNode* frame_tree_node, - const GURL& url) - : frame_tree_node_(frame_tree_node), url_(url) {} - -bool BeginNavigationInCommitCallbackInterceptor::WillProcessDidCommitNavigation( +bool CommitNavigationPauser::WillProcessDidCommitNavigation( NavigationRequest* request, mojom::DidCommitProvisionalLoadParamsPtr* params, mojom::DidCommitProvisionalLoadInterfaceParamsPtr* interface_params) { request->GetRenderFrameHost()->SetCommitCallbackInterceptorForTesting( nullptr); - absl::optional<ObserverInstaller> observer_installer; - if (ShouldQueueNavigationsWhenPendingCommitRFHExists()) { - // If navigation queueing is enabled, the navigation to `url_` will not - // commit until the commit suspended by this interceptor completes: - // instead, it will be queued/suspended and the navigation code will - // internally set a closure to resume committing the navigation when - // the suspended `request` completes. - // - // `BeginNavigateToURLFromRenderer()` waits for the new navigation from - // the renderer to start, so arm a hook to install an (indirect) observer - // that: - // - waits for the navigation code to install a resume commit closure - // - resumes the suspended `request` to test that the queued navigation - // eventually completes. - observer_installer.emplace( - WebContents::FromRenderFrameHost(request->GetRenderFrameHost()), - request->GetSafeRef(), std::move(*params), - std::move(*interface_params)); - } + paused_request_ = request->GetWeakPtr(); + paused_params_ = std::move(*params); + paused_interface_params_ = std::move(*interface_params); - // At this point, the renderer has already committed the RenderFrame, but - // on the browser side, the RenderFrameHost is still speculative. Begin - // another navigation. - // - // If navigation queueing is disabled, this should result in the speculative - // RFH being discarded with a pending commit in flight. - EXPECT_TRUE(BeginNavigateToURLFromRenderer(frame_tree_node_.get(), url_)); + loop_.Quit(); // Ignore the commit message. return false;
diff --git a/content/test/content_browser_test_utils_internal.h b/content/test/content_browser_test_utils_internal.h index 98f8b63d..9889b595 100644 --- a/content/test/content_browser_test_utils_internal.h +++ b/content/test/content_browser_test_utils_internal.h
@@ -726,56 +726,35 @@ GURL site_to_isolate_; }; -// Helper for BeginNavigationInCommitCallbackInterceptor. Declared separately -// to make it easier to friend. -// -// Defers an attempt to commit a navigation A in a speculative RenderFrameHost. -// This observer should be owned by a base::Closure that is used for a -// subsequent navigation B's `resume_commit_closure_` field. -// -// Navigation B will eventually be queued when it reaches ready to commit; since -// navigation A is still stuck in the pending commit state, navigation B will -// not be able to successfully select a RenderFrameHost. -// -// Navigation B will then assign an actual navigation continuation closure to -// its `resume_commit_closure_` field, which will destroy `this`. The destructor -// then resumes committing navigation A. -class ResumeCommitClosureSetObserver { - public: - explicit ResumeCommitClosureSetObserver( - base::SafeRef<NavigationHandle> original_navigation, - mojom::DidCommitProvisionalLoadParamsPtr original_params, - mojom::DidCommitProvisionalLoadInterfaceParamsPtr - original_interface_params); - - ~ResumeCommitClosureSetObserver(); - - private: - base::SafeRef<NavigationHandle> original_navigation_; - mojom::DidCommitProvisionalLoadParamsPtr original_params_; - mojom::DidCommitProvisionalLoadInterfaceParamsPtr original_interface_params_; -}; - -// Helper that ignores a request from the renderer to commit a navigation and -// instead, begins another navigation to the specified `url` in -// `frame_tree_node`. -class BeginNavigationInCommitCallbackInterceptor +// Helper that waits for a request from the specified `RenderFrameHost` to send +// `CommitNavigation()` to the browser. +class CommitNavigationPauser : public RenderFrameHostImpl::CommitCallbackInterceptor { public: - BeginNavigationInCommitCallbackInterceptor(FrameTreeNode* frame_tree_node, - const GURL& url); + explicit CommitNavigationPauser(RenderFrameHostImpl* rfh); + ~CommitNavigationPauser() override; + void WaitForCommitAndPause(); + + // Once a `CommitNavigation()` call has been paused, these two methods may be + // used to resume or discard the commit as appropriate. + void ResumePausedCommit(); + void DiscardPausedCommit(); + + private: + // CommitCallbackInterceptor overrides: bool WillProcessDidCommitNavigation( NavigationRequest* request, mojom::DidCommitProvisionalLoadParamsPtr* params, mojom::DidCommitProvisionalLoadInterfaceParamsPtr* interface_params) override; - private: - class ObserverInstaller; + base::RunLoop loop_; - const raw_ptr<FrameTreeNode> frame_tree_node_; - const GURL url_; + // The parameters to resume a previously paused `CommitNavigation()`. + base::WeakPtr<NavigationRequest> paused_request_; + mojom::DidCommitProvisionalLoadParamsPtr paused_params_; + mojom::DidCommitProvisionalLoadInterfaceParamsPtr paused_interface_params_; }; } // namespace content
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index cea057922..0e087b6e 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -209,7 +209,6 @@ # Test is too slow for old phones and laptops, and in Debug mode. crbug.com/1356246 [ android android-nexus-5x ] Pixel_SVGHuge [ Skip ] -crbug.com/1440215 [ android android-pixel-4 ] Pixel_SVGHuge [ RetryOnFailure ] crbug.com/1440215 [ android android-pixel-4 ] Pixel_VideoStreamFrom2DCanvas [ RetryOnFailure ] crbug.com/1356246 [ mac amd debug ] Pixel_SVGHuge [ Skip ] crbug.com/1356246 [ mac intel debug ] Pixel_SVGHuge [ Failure ]
diff --git a/content/test/gpu/gpu_tests/webgpu_cts_integration_test.py b/content/test/gpu/gpu_tests/webgpu_cts_integration_test.py index 5434d6d..595da5c 100644 --- a/content/test/gpu/gpu_tests/webgpu_cts_integration_test.py +++ b/content/test/gpu/gpu_tests/webgpu_cts_integration_test.py
@@ -208,7 +208,7 @@ cls.websocket_server = websocket_server.WebsocketServer() cls.websocket_server.StartServer() browser_args = [ - '--disable-dawn-features=disallow_unsafe_apis', + '--enable-dawn-features=allow_unsafe_apis', # When running tests in parallel, windows can be treated as occluded if # a newly opened window fully covers a previous one, which can cause # issues in a few tests. This is practically only an issue on Windows
diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn index be9efeb..9d47887 100644 --- a/content/web_test/BUILD.gn +++ b/content/web_test/BUILD.gn
@@ -23,6 +23,7 @@ sources = [ "common/fake_bluetooth_chooser.mojom", "common/mojo_echo.mojom", + "common/mojo_optional_numerics_unittest.mojom", "common/web_test.mojom", "common/web_test_bluetooth_fake_adapter_setter.mojom", ] @@ -93,6 +94,8 @@ "browser/leak_detector.h", "browser/mojo_echo.cc", "browser/mojo_echo.h", + "browser/mojo_optional_numerics_unittest.cc", + "browser/mojo_optional_numerics_unittest.h", "browser/mojo_web_test_helper.cc", "browser/mojo_web_test_helper.h", "browser/test_info_extractor.cc",
diff --git a/content/web_test/browser/mojo_optional_numerics_unittest.cc b/content/web_test/browser/mojo_optional_numerics_unittest.cc new file mode 100644 index 0000000..2539090 --- /dev/null +++ b/content/web_test/browser/mojo_optional_numerics_unittest.cc
@@ -0,0 +1,330 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/web_test/browser/mojo_optional_numerics_unittest.h" + +#include "mojo/public/cpp/bindings/self_owned_receiver.h" + +namespace content::optional_numerics_unittest { + +// static +void Params::Bind(mojo::PendingReceiver<mojom::Params> receiver) { + mojo::MakeSelfOwnedReceiver(std::make_unique<Params>(), std::move(receiver)); +} + +void Params::SendNullBool(absl::optional<bool> optional_bool, + SendNullBoolCallback callback) { + CHECK(!optional_bool.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullUint8(absl::optional<uint8_t> optional_uint8, + SendNullUint8Callback callback) { + CHECK(!optional_uint8.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullInt8(absl::optional<int8_t> optional_int8, + SendNullInt8Callback callback) { + CHECK(!optional_int8.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullUint16(absl::optional<uint16_t> optional_uint16, + SendNullUint16Callback callback) { + CHECK(!optional_uint16.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullInt16(absl::optional<int16_t> optional_int16, + SendNullInt16Callback callback) { + CHECK(!optional_int16.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullUint32(absl::optional<uint32_t> optional_uint32, + SendNullUint32Callback callback) { + CHECK(!optional_uint32.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullInt32(absl::optional<int32_t> optional_int32, + SendNullInt32Callback callback) { + CHECK(!optional_int32.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullUint64(absl::optional<uint64_t> optional_uint64, + SendNullUint64Callback callback) { + CHECK(!optional_uint64.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullInt64(absl::optional<int64_t> optional_int64, + SendNullInt64Callback callback) { + CHECK(!optional_int64.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullFloat(absl::optional<float> optional_float, + SendNullFloatCallback callback) { + CHECK(!optional_float.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullDouble(absl::optional<double> optional_double, + SendNullDoubleCallback callback) { + CHECK(!optional_double.has_value()); + std::move(callback).Run(); +} + +void Params::SendNullEnum(absl::optional<mojom::RegularEnum> optional_enum, + SendNullEnumCallback callback) { + CHECK(!optional_enum.has_value()); + std::move(callback).Run(); +} + +void Params::SendOptionalBool(absl::optional<bool> optional_bool, + SendOptionalBoolCallback callback) { + std::move(callback).Run(optional_bool.value()); +} + +void Params::SendOptionalUint8(absl::optional<uint8_t> optional_uint8, + SendOptionalUint8Callback callback) { + std::move(callback).Run(optional_uint8.value()); +} + +void Params::SendOptionalInt8(absl::optional<int8_t> optional_int8, + SendOptionalInt8Callback callback) { + std::move(callback).Run(optional_int8.value()); +} + +void Params::SendOptionalUint16(absl::optional<uint16_t> optional_uint16, + SendOptionalUint16Callback callback) { + std::move(callback).Run(optional_uint16.value()); +} + +void Params::SendOptionalInt16(absl::optional<int16_t> optional_int16, + SendOptionalInt16Callback callback) { + std::move(callback).Run(optional_int16.value()); +} + +void Params::SendOptionalUint32(absl::optional<uint32_t> optional_uint32, + SendOptionalUint32Callback callback) { + std::move(callback).Run(optional_uint32.value()); +} + +void Params::SendOptionalInt32(absl::optional<int32_t> optional_int32, + SendOptionalInt32Callback callback) { + std::move(callback).Run(optional_int32.value()); +} + +void Params::SendOptionalUint64(absl::optional<uint64_t> optional_uint64, + SendOptionalUint64Callback callback) { + std::move(callback).Run(optional_uint64.value()); +} + +void Params::SendOptionalInt64(absl::optional<int64_t> optional_int64, + SendOptionalInt64Callback callback) { + std::move(callback).Run(optional_int64.value()); +} + +void Params::SendOptionalFloat(absl::optional<float> optional_float, + SendOptionalFloatCallback callback) { + std::move(callback).Run(optional_float.value()); +} + +void Params::SendOptionalDouble(absl::optional<double> optional_double, + SendOptionalDoubleCallback callback) { + std::move(callback).Run(optional_double.value()); +} + +void Params::SendOptionalEnum(absl::optional<mojom::RegularEnum> optional_enum, + SendOptionalEnumCallback callback) { + std::move(callback).Run(optional_enum.value()); +} + +void Params::SendNullStructWithOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendNullStructWithOptionalNumericsCallback callback) { + CHECK(s.is_null()); + std::move(callback).Run(); +} + +void Params::SendStructWithNullOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendStructWithNullOptionalNumericsCallback callback) { + CHECK(!s->optional_bool.has_value()); + CHECK(!s->optional_uint8.has_value()); + CHECK(!s->optional_int8.has_value()); + CHECK(!s->optional_uint16.has_value()); + CHECK(!s->optional_int16.has_value()); + CHECK(!s->optional_uint32.has_value()); + CHECK(!s->optional_int32.has_value()); + CHECK(!s->optional_uint64.has_value()); + CHECK(!s->optional_int64.has_value()); + CHECK(!s->optional_float.has_value()); + CHECK(!s->optional_double.has_value()); + CHECK(!s->optional_enum.has_value()); + std::move(callback).Run(); +} + +void Params::SendStructWithOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendStructWithOptionalNumericsCallback callback) { + std::move(callback).Run(s->optional_bool.value(), s->optional_uint8.value(), + s->optional_int8.value(), s->optional_uint16.value(), + s->optional_int16.value(), s->optional_uint32.value(), + s->optional_int32.value(), s->optional_uint64.value(), + s->optional_int64.value(), s->optional_float.value(), + s->optional_double.value(), s->optional_enum.value()); +} + +// static +void ResponseParams::Bind( + mojo::PendingReceiver<mojom::ResponseParams> receiver) { + mojo::MakeSelfOwnedReceiver(std::make_unique<ResponseParams>(), + std::move(receiver)); +} + +void ResponseParams::GetNullBool(GetNullBoolCallback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullUint8(GetNullUint8Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullInt8(GetNullInt8Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullUint16(GetNullUint16Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullInt16(GetNullInt16Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullUint32(GetNullUint32Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullInt32(GetNullInt32Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullUint64(GetNullUint64Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullInt64(GetNullInt64Callback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullFloat(GetNullFloatCallback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullDouble(GetNullDoubleCallback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetNullEnum(GetNullEnumCallback callback) { + std::move(callback).Run(absl::nullopt); +} + +void ResponseParams::GetOptionalBool(bool value, + GetOptionalBoolCallback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalUint8(uint8_t value, + GetOptionalUint8Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalInt8(int8_t value, + GetOptionalInt8Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalUint16(uint16_t value, + GetOptionalUint16Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalInt16(int16_t value, + GetOptionalInt16Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalUint32(uint32_t value, + GetOptionalUint32Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalInt32(int32_t value, + GetOptionalInt32Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalUint64(uint64_t value, + GetOptionalUint64Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalInt64(int64_t value, + GetOptionalInt64Callback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalFloat(float value, + GetOptionalFloatCallback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalDouble(double value, + GetOptionalDoubleCallback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetOptionalEnum(mojom::RegularEnum value, + GetOptionalEnumCallback callback) { + std::move(callback).Run(value); +} + +void ResponseParams::GetNullStructWithOptionalNumerics( + GetNullStructWithOptionalNumericsCallback callback) { + std::move(callback).Run(nullptr); +} + +void ResponseParams::GetStructWithNullOptionalNumerics( + GetStructWithNullOptionalNumericsCallback callback) { + std::move(callback).Run(mojom::OptionalNumericsStruct::New()); +} + +void ResponseParams::GetStructWithOptionalNumerics( + bool bool_value, + uint8_t uint8_value, + int8_t int8_value, + uint16_t uint16_value, + int16_t int16_value, + uint32_t uint32_value, + int32_t int32_value, + uint64_t uint64_value, + int64_t int64_value, + float float_value, + double double_value, + mojom::RegularEnum enum_value, + GetStructWithOptionalNumericsCallback callback) { + auto s = mojom::OptionalNumericsStruct::New( + bool_value, uint8_value, int8_value, uint16_value, int16_value, + uint32_value, int32_value, uint64_value, int64_value, float_value, + double_value, enum_value); + std::move(callback).Run(std::move(s)); +} + +} // namespace content::optional_numerics_unittest
diff --git a/content/web_test/browser/mojo_optional_numerics_unittest.h b/content/web_test/browser/mojo_optional_numerics_unittest.h new file mode 100644 index 0000000..f4c62d6 --- /dev/null +++ b/content/web_test/browser/mojo_optional_numerics_unittest.h
@@ -0,0 +1,140 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_WEB_TEST_BROWSER_MOJO_OPTIONAL_NUMERICS_UNITTEST_H_ +#define CONTENT_WEB_TEST_BROWSER_MOJO_OPTIONAL_NUMERICS_UNITTEST_H_ + +#include "content/web_test/common/mojo_optional_numerics_unittest.mojom.h" + +namespace content::optional_numerics_unittest { + +class Params : public mojom::Params { + public: + static void Bind(mojo::PendingReceiver<mojom::Params> receiver); + + void SendNullBool(absl::optional<bool> optional_bool, + SendNullBoolCallback callback) override; + void SendNullUint8(absl::optional<uint8_t> optional_uint8, + SendNullUint8Callback callback) override; + void SendNullInt8(absl::optional<int8_t> optional_int8, + SendNullInt8Callback callback) override; + void SendNullUint16(absl::optional<uint16_t> optional_uint16, + SendNullUint16Callback callback) override; + void SendNullInt16(absl::optional<int16_t> optional_int16, + SendNullInt16Callback callback) override; + void SendNullUint32(absl::optional<uint32_t> optional_uint32, + SendNullUint32Callback callback) override; + void SendNullInt32(absl::optional<int32_t> optional_int32, + SendNullInt32Callback callback) override; + void SendNullUint64(absl::optional<uint64_t> optional_uint64, + SendNullUint64Callback callback) override; + void SendNullInt64(absl::optional<int64_t> optional_int64, + SendNullInt64Callback callback) override; + void SendNullFloat(absl::optional<float> optional_float, + SendNullFloatCallback callback) override; + void SendNullDouble(absl::optional<double> optional_double, + SendNullDoubleCallback callback) override; + void SendNullEnum(absl::optional<mojom::RegularEnum> optional_enum, + SendNullEnumCallback callback) override; + + void SendOptionalBool(absl::optional<bool> optional_bool, + SendOptionalBoolCallback callback) override; + void SendOptionalUint8(absl::optional<uint8_t> optional_uint8, + SendOptionalUint8Callback callback) override; + void SendOptionalInt8(absl::optional<int8_t> optional_int8, + SendOptionalInt8Callback callback) override; + void SendOptionalUint16(absl::optional<uint16_t> optional_uint16, + SendOptionalUint16Callback callback) override; + void SendOptionalInt16(absl::optional<int16_t> optional_int16, + SendOptionalInt16Callback callback) override; + void SendOptionalUint32(absl::optional<uint32_t> optional_uint32, + SendOptionalUint32Callback callback) override; + void SendOptionalInt32(absl::optional<int32_t> optional_int32, + SendOptionalInt32Callback callback) override; + void SendOptionalUint64(absl::optional<uint64_t> optional_uint64, + SendOptionalUint64Callback callback) override; + void SendOptionalInt64(absl::optional<int64_t> optional_int64, + SendOptionalInt64Callback callback) override; + void SendOptionalFloat(absl::optional<float> optional_float, + SendOptionalFloatCallback callback) override; + void SendOptionalDouble(absl::optional<double> optional_double, + SendOptionalDoubleCallback callback) override; + void SendOptionalEnum(absl::optional<mojom::RegularEnum> optional_enum, + SendOptionalEnumCallback callback) override; + + void SendNullStructWithOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendNullStructWithOptionalNumericsCallback callback) override; + void SendStructWithNullOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendStructWithNullOptionalNumericsCallback callback) override; + void SendStructWithOptionalNumerics( + mojom::OptionalNumericsStructPtr s, + SendStructWithOptionalNumericsCallback callback) override; +}; + +class ResponseParams : public mojom::ResponseParams { + public: + static void Bind(mojo::PendingReceiver<mojom::ResponseParams> receiver); + + void GetNullBool(GetNullBoolCallback callback) override; + + void GetNullUint8(GetNullUint8Callback callback) override; + void GetNullInt8(GetNullInt8Callback callback) override; + void GetNullUint16(GetNullUint16Callback callback) override; + void GetNullInt16(GetNullInt16Callback callback) override; + void GetNullUint32(GetNullUint32Callback callback) override; + void GetNullInt32(GetNullInt32Callback callback) override; + void GetNullUint64(GetNullUint64Callback callback) override; + void GetNullInt64(GetNullInt64Callback callback) override; + void GetNullFloat(GetNullFloatCallback callback) override; + void GetNullDouble(GetNullDoubleCallback callback) override; + void GetNullEnum(GetNullEnumCallback callback) override; + + void GetOptionalBool(bool value, GetOptionalBoolCallback callback) override; + void GetOptionalUint8(uint8_t value, + GetOptionalUint8Callback callback) override; + void GetOptionalInt8(int8_t value, GetOptionalInt8Callback callback) override; + void GetOptionalUint16(uint16_t value, + GetOptionalUint16Callback callback) override; + void GetOptionalInt16(int16_t value, + GetOptionalInt16Callback callback) override; + void GetOptionalUint32(uint32_t value, + GetOptionalUint32Callback callback) override; + void GetOptionalInt32(int32_t value, + GetOptionalInt32Callback callback) override; + void GetOptionalUint64(uint64_t value, + GetOptionalUint64Callback callback) override; + void GetOptionalInt64(int64_t value, + GetOptionalInt64Callback callback) override; + void GetOptionalFloat(float value, + GetOptionalFloatCallback callback) override; + void GetOptionalDouble(double value, + GetOptionalDoubleCallback callback) override; + void GetOptionalEnum(mojom::RegularEnum value, + GetOptionalEnumCallback callback) override; + + void GetNullStructWithOptionalNumerics( + GetNullStructWithOptionalNumericsCallback callback) override; + void GetStructWithNullOptionalNumerics( + GetStructWithNullOptionalNumericsCallback callback) override; + void GetStructWithOptionalNumerics( + bool bool_value, + uint8_t uint8_value, + int8_t int8_value, + uint16_t uint16_value, + int16_t int16_value, + uint32_t uint32_value, + int32_t int32_value, + uint64_t uint64_value, + int64_t int64_value, + float float_value, + double double_value, + mojom::RegularEnum enum_value, + GetStructWithOptionalNumericsCallback callback) override; +}; + +} // namespace content::optional_numerics_unittest + +#endif // CONTENT_WEB_TEST_BROWSER_MOJO_OPTIONAL_NUMERICS_UNITTEST_H_
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc index 0fe3146..bdf18ff 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -45,6 +45,7 @@ #include "content/web_test/browser/fake_bluetooth_chooser_factory.h" #include "content/web_test/browser/fake_bluetooth_delegate.h" #include "content/web_test/browser/mojo_echo.h" +#include "content/web_test/browser/mojo_optional_numerics_unittest.h" #include "content/web_test/browser/mojo_web_test_helper.h" #include "content/web_test/browser/web_test_bluetooth_fake_adapter_setter_impl.h" #include "content/web_test/browser/web_test_browser_context.h" @@ -327,6 +328,12 @@ ui_task_runner); registry->AddInterface(base::BindRepeating(&MojoEcho::Bind), ui_task_runner); registry->AddInterface( + base::BindRepeating(&optional_numerics_unittest::Params::Bind), + ui_task_runner); + registry->AddInterface( + base::BindRepeating(&optional_numerics_unittest::ResponseParams::Bind), + ui_task_runner); + registry->AddInterface( base::BindRepeating(&WebTestBluetoothFakeAdapterSetterImpl::Create), ui_task_runner); registry->AddInterface(base::BindRepeating(&bluetooth::FakeBluetooth::Create),
diff --git a/content/web_test/common/mojo_optional_numerics_unittest.mojom b/content/web_test/common/mojo_optional_numerics_unittest.mojom new file mode 100644 index 0000000..2fc679e --- /dev/null +++ b/content/web_test/common/mojo_optional_numerics_unittest.mojom
@@ -0,0 +1,232 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module content.optional_numerics_unittest.mojom; + +enum RegularEnum { + kFoo = 1, + kBar = 2, +}; + +// Struct made out of optional numerics. +struct OptionalNumericsStruct { + bool? optional_bool; + uint8? optional_uint8; + int8? optional_int8; + uint16? optional_uint16; + int16? optional_int16; + uint32? optional_uint32; + int32? optional_int32; + uint64? optional_uint64; + int64? optional_int64; + float? optional_float; + double? optional_double; + RegularEnum? optional_enum; +}; + +// There are two implementations of this interface: a C++ one to test +// JS correctly encodes optional numerics in function params and a JS one to +// test JS correctly decodes optional numerics in function params. +interface Params { + // The following methods help test that JS correctly handles null optional + // numerics. + // + // Runs the empty callback. CHECKs if `optional_bool` is not null. + SendNullBool(bool? optional_bool) => (); + // Runs the empty callback. CHECKs if `optional_uint8` is not null. + SendNullUint8(uint8? optional_uint8) => (); + // Runs the empty callback. CHECKs if `optional_int8` is not null. + SendNullInt8(int8? optional_int8) => (); + // Runs the empty callback. CHECKs if `optional_uint16` is not null. + SendNullUint16(uint16? optional_uint16) => (); + // Runs the empty callback. CHECKs if `optional_int16` is not null. + SendNullInt16(int16? optional_int16) => (); + // Runs the empty callback. CHECKs if `optional_uint32` is not null. + SendNullUint32(uint32? optional_uint32) => (); + // Runs the empty callback. CHECKs if `optional_int32` is not null. + SendNullInt32(int32? optional_int32) => (); + // Runs the empty callback. CHECKs if `optional_uint64` is not null. + SendNullUint64(uint64? optional_uint64) => (); + // Runs the empty callback. CHECKs if `optional_int64` is not null. + SendNullInt64(int64? optional_int64) => (); + // Runs the empty callback. CHECKs if `optional_float` is not null. + SendNullFloat(float? optional_float) => (); + // Runs the empty callback. CHECKs if `optional_double` is not null. + SendNullDouble(double? optional_double) => (); + // Runs the empty callback. CHECKs if `optional_enum` is not null. + SendNullEnum(RegularEnum? optional_enum) => (); + + // The following methods help test that JS correctly handles optional + // numerics with a value. + // + // Runs callback with `optional_bool`. + SendOptionalBool(bool? optional_bool) => (bool value); + // Runs callback with `optional_uint8`. + SendOptionalUint8(uint8? optional_uint8) => (uint8 value); + // Runs callback with `optional_int8`. + SendOptionalInt8(int8? optional_int8) => (int8 value); + // Runs callback with `optional_uint16`. + SendOptionalUint16(uint16? optional_uint16) => (uint16 value); + // Runs callback with `optional_int16`. + SendOptionalInt16(int16? optional_int16) => (int16 value); + // Runs callback with `optional_uint32`. + SendOptionalUint32(uint32? optional_uint32) => (uint32 value); + // Runs callback with `optional_int32`. + SendOptionalInt32(int32? optional_int32) => (int32 value); + // Runs callback with `optional_uint64`. + SendOptionalUint64(uint64? optional_uint64) => (uint64 value); + // Runs callback with `optional_int64`. + SendOptionalInt64(int64? optional_int64) => (int64 value); + // Runs callback with `optional_float`. + SendOptionalFloat(float? optional_float) => (float value); + // Runs callback with `optional_double`. + SendOptionalDouble(double? optional_double) => (double value); + // Runs callback with `optional_enum`. + SendOptionalEnum(RegularEnum? optional_enum) => (RegularEnum value); + + // Runs a callback with null. Helps test that JS can correctly handle null + // structs with optional numerics. + SendNullStructWithOptionalNumerics(OptionalNumericsStruct? s) => (); + + // Helps test that JS can correctly handle a struct with null optional + // numerics. + // Runs the empty callback. CHECKs if the values in the struct are not null. + SendStructWithNullOptionalNumerics(OptionalNumericsStruct s) => (); + + // Runs callback the values in the struct. Helps test that JS can correctly + // handle a struct with optional numerics. + SendStructWithOptionalNumerics(OptionalNumericsStruct s) => ( + bool bool_value, + uint8 uint8_value, + int8 int8_value, + uint16 uint16_value, + int16 int16_value, + uint32 uint32_value, + int32 int32_value, + uint64 uint64_value, + int64 int64_value, + float float_value, + double double_value, + RegularEnum enum_value); +}; + +// There are two implementations of this interface: a C++ one to test +// JS correctly decodes optional numerics in response params and a JS one to +// test JS correctly encodes optional numerics in response params. +interface ResponseParams { + // The following methods help test that JS can correctly handle null optional + // numerics in response params. + // + // Returns a null optional bool. + GetNullBool() => (bool? optional_value); + // Returns a null optional uint8. + GetNullUint8() => (uint8? optional_value); + // Returns a null optional int8. + GetNullInt8() => (int8? optional_value); + // // Returns a null optional uint16. + GetNullUint16() => (uint16? optional_value); + // // Returns a null optional int16. + GetNullInt16() => (int16? optional_value); + // // Returns a null optional uint32. + GetNullUint32() => (uint32? optional_value); + // // Returns a null optional int32. + GetNullInt32() => (int32? optional_value); + // Returns a null optional uint64. + GetNullUint64() => (uint64? optional_value); + // Returns a null optional int64. + GetNullInt64() => (int64? optional_value); + // Returns a null optional float. + GetNullFloat() => (float? optional_value); + // Returns a null optional double. + GetNullDouble() => (double? optional_value); + // Returns a null optional enum. + GetNullEnum() => (RegularEnum? optional_value); + + // The following methods help test that JS can correctly handle optional + // numerics in response params. + // + // Returns |value| in an optional bool. + GetOptionalBool(bool value) => (bool? optional_value); + // Returns |value| in an optional unit8. + GetOptionalUint8(uint8 value) => (uint8? optional_value); + // Returns |value| in an optional int8. + GetOptionalInt8(int8 value) => (int8? optional_value); + // Returns |value| in an optional uint16. + GetOptionalUint16(uint16 value) => (uint16? optional_value); + // Returns |value| in an optional int16. + GetOptionalInt16(int16 value) => (int16? optional_value); + // Returns |value| in an optional uint32. + GetOptionalUint32(uint32 value) => (uint32? optional_value); + // Returns |value| in an optional int32. + GetOptionalInt32(int32 value) => (int32? optional_value); + // Returns |value| in an optional uint64. + GetOptionalUint64(uint64 value) => (uint64? optional_value); + // Returns |value| in an optional int64. + GetOptionalInt64(int64 value) => (int64? optional_value); + // Returns |value| in an optional float. + GetOptionalFloat(float value) => (float? optional_value); + // Returns |value| in an optional double. + GetOptionalDouble(double value) => (double? optional_value); + // Returns |value| in an optional enum. + GetOptionalEnum(RegularEnum value) => (RegularEnum? optional_value); + + // Runs a callback with null. Helps test that JS can correctly handle null + // structs with optional numerics. + GetNullStructWithOptionalNumerics() => (OptionalNumericsStruct? s); + + // Returns a struct with null optional numerics. Helps test that JS can + // correctly handle structs with null optional numerics. + GetStructWithNullOptionalNumerics() => (OptionalNumericsStruct s); + + // Returns a struct with values as optional numerics. Helps test that JS can + // correctly handle struct with optional numerics. + GetStructWithOptionalNumerics( + bool bool_value, + uint8 uint8_value, + int8 int8_value, + uint16 uint16_value, + int16 int16_value, + uint32 uint32_value, + int32 int32_value, + uint64 uint64_value, + int64 int64_value, + float float_value, + double double_value, + RegularEnum enum_value) => (OptionalNumericsStruct s); +}; + +// Implemented in JS to test that optional numerics in versioned interfaces +// work. +interface InterfaceV2 { + // Returns the optional numerics it was sent but with some transformations + // i.e. !bool_value, integers get multiplied by 2, float and double get + // multiplied by 3. + MethodWithVersionedParams@1( + [MinVersion=2] bool? bool_value, + [MinVersion=2] uint8? uint8_value, + [MinVersion=2] int8? int8_value, + [MinVersion=2] uint16? uint16_value, + [MinVersion=2] int16? int16_value, + [MinVersion=2] uint32? uint32_value, + [MinVersion=2] int32? int32_value, + [MinVersion=2] uint64? uint64_value, + [MinVersion=2] int64? int64_value, + [MinVersion=2] float? float_value, + [MinVersion=2] double? double_value, + [MinVersion=2] RegularEnum? enum_value + ) => ( + [MinVersion=2] bool? bool_value, + [MinVersion=2] uint8? uint8_value, + [MinVersion=2] int8? int8_value, + [MinVersion=2] uint16? uint16_value, + [MinVersion=2] int16? int16_value, + [MinVersion=2] uint32? uint32_value, + [MinVersion=2] int32? int32_value, + [MinVersion=2] uint64? uint64_value, + [MinVersion=2] int64? int64_value, + [MinVersion=2] float? float_value, + [MinVersion=2] double? double_value, + [MinVersion=2] RegularEnum? enum_value + ); +};
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index 3900539e..e3693ce 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1846,6 +1846,7 @@ FILEMANAGERPRIVATE_GETBULKPINPROGRESS = 1783, ENTERPRISE_REMOTEAPPS_SETPINNEDAPPS = 1784, SMARTCARDPROVIDERPRIVATE_REPORTDATARESULT = 1785, + FILEMANAGERPRIVATE_CALCULATEBULKPINREQUIREDSPACE = 1786, // Last entry: Add new entries above, then run: // tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc index 69a2b98..a60e42b 100644 --- a/gpu/command_buffer/service/raster_decoder.cc +++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -558,6 +558,9 @@ GrDirectContext* gr_context() const { return shared_context_state_->gr_context(); } + skgpu::graphite::Recorder* graphite_recorder() const { + return shared_context_state_->gpu_main_graphite_recorder(); + } ServiceTransferCache* transfer_cache() { return shared_context_state_->transfer_cache(); } @@ -2968,13 +2971,13 @@ // If the entry is going to use skia during deserialization, make sure we // mark the context state dirty. - GrDirectContext* context_for_entry = - cc::ServiceTransferCacheEntry::UsesGrContext(entry_type) ? gr_context() - : nullptr; + bool use_gpu = cc::ServiceTransferCacheEntry::UsesGpuContext(entry_type); if (!transfer_cache()->CreateLockedEntry( ServiceTransferCache::EntryKey(raster_decoder_id_, entry_type, entry_id), - handle, context_for_entry, base::make_span(data_memory, data_size))) { + handle, use_gpu ? gr_context() : nullptr, + use_gpu ? graphite_recorder() : nullptr, + base::make_span(data_memory, data_size))) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCreateTransferCacheEntryINTERNAL", "Failure to deserialize transfer cache entry."); return; @@ -2983,8 +2986,9 @@ // The only entry using the GrContext are image transfer cache entries for // image uploads. Since this tends to a slow operation, yield to allow the // decoder to be pre-empted. - if (context_for_entry) + if (use_gpu) { ExitCommandProcessingEarly(); + } } void RasterDecoderImpl::DoUnlockTransferCacheEntryINTERNAL(
diff --git a/gpu/command_buffer/service/service_transfer_cache.cc b/gpu/command_buffer/service/service_transfer_cache.cc index 2949a72..c9c245a9 100644 --- a/gpu/command_buffer/service/service_transfer_cache.cc +++ b/gpu/command_buffer/service/service_transfer_cache.cc
@@ -157,21 +157,26 @@ this); } -bool ServiceTransferCache::CreateLockedEntry(const EntryKey& key, - ServiceDiscardableHandle handle, - GrDirectContext* context, - base::span<uint8_t> data) { +bool ServiceTransferCache::CreateLockedEntry( + const EntryKey& key, + ServiceDiscardableHandle handle, + GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, + base::span<uint8_t> data) { auto found = entries_.Peek(key); - if (found != entries_.end()) + if (found != entries_.end()) { return false; + } std::unique_ptr<cc::ServiceTransferCacheEntry> entry = cc::ServiceTransferCacheEntry::Create(key.entry_type); - if (!entry) + if (!entry) { return false; + } - if (!entry->Deserialize(context, data)) + if (!entry->Deserialize(context, graphite_recorder, data)) { return false; + } total_size_ += entry->CachedSize(); if (key.entry_type == cc::TransferCacheEntryType::kImage) {
diff --git a/gpu/command_buffer/service/service_transfer_cache.h b/gpu/command_buffer/service/service_transfer_cache.h index a38c81a..5987e27 100644 --- a/gpu/command_buffer/service/service_transfer_cache.h +++ b/gpu/command_buffer/service/service_transfer_cache.h
@@ -59,6 +59,7 @@ bool CreateLockedEntry(const EntryKey& key, ServiceDiscardableHandle handle, GrDirectContext* context, + skgpu::graphite::Recorder* graphite_recorder, base::span<uint8_t> data); void CreateLocalEntry(const EntryKey& key, std::unique_ptr<cc::ServiceTransferCacheEntry> entry);
diff --git a/gpu/command_buffer/service/service_transfer_cache_unittest.cc b/gpu/command_buffer/service/service_transfer_cache_unittest.cc index dae8576..129e2d6 100644 --- a/gpu/command_buffer/service/service_transfer_cache_unittest.cc +++ b/gpu/command_buffer/service/service_transfer_cache_unittest.cc
@@ -17,7 +17,8 @@ std::unique_ptr<cc::ServiceTransferCacheEntry> CreateEntry(size_t size) { auto entry = std::make_unique<cc::ServiceRawMemoryTransferCacheEntry>(); std::vector<uint8_t> data(size, 0u); - entry->Deserialize(nullptr, data); + entry->Deserialize(/*gr_context=*/nullptr, /*graphite_recorder=*/nullptr, + data); return entry; }
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index 0e84341..2764adf 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -1104,10 +1104,10 @@ require_enabled_toggles_ = gpu_preferences.enabled_dawn_features_list; require_disabled_toggles_ = gpu_preferences.disabled_dawn_features_list; - // Only allow unsafe APIs if the disallow_unsafe_apis toggle is explicitly - // disabled. + // Only allow unsafe APIs if the allow_unsafe_apis toggle is explicitly + // enabled. allow_unsafe_apis_ = - base::Contains(require_disabled_toggles_, "disallow_unsafe_apis"); + base::Contains(require_enabled_toggles_, "allow_unsafe_apis"); // Force adapters to report their limits in predetermined tiers unless the // adapter_limit_tiers toggle is explicitly disabled.
diff --git a/ios/web/js_messaging/web_view_js_utils.h b/ios/web/js_messaging/web_view_js_utils.h index f8279f5..ffe1022 100644 --- a/ios/web/js_messaging/web_view_js_utils.h +++ b/ios/web/js_messaging/web_view_js_utils.h
@@ -35,6 +35,9 @@ // Converts result of WKWebView script evaluation to base::Value. std::unique_ptr<base::Value> ValueResultFromWKResult(id result); +// Converts base::Value to an equivalent Foundation object. +id NSObjectFromValueResult(const base::Value& value_result); + // Executes JavaScript on WKWebView. If the web view cannot execute JS at the // moment, `completion_handler` is called with an NSError. void ExecuteJavaScript(WKWebView* web_view,
diff --git a/ios/web/js_messaging/web_view_js_utils.mm b/ios/web/js_messaging/web_view_js_utils.mm index d86d0c6..afb3514 100644 --- a/ios/web/js_messaging/web_view_js_utils.mm +++ b/ios/web/js_messaging/web_view_js_utils.mm
@@ -75,6 +75,56 @@ return result; } +// Converts base::Value to an equivalent Foundation object, parsing, +// `value_result` up to a depth of `max_depth`. +id NSObjectFromValueResult(const base::Value& value_result, int max_depth) { + id result; + + if (max_depth < 0) { + DLOG(WARNING) << "JS maximum recursion depth exceeded."; + return result; + } + + if (value_result.is_string()) { + result = base::SysUTF8ToNSString(value_result.GetString()); + DCHECK([result isKindOfClass:[NSString class]]); + } else if (value_result.is_int()) { + result = [NSNumber numberWithInt:value_result.GetInt()]; + DCHECK([result isKindOfClass:[NSNumber class]]); + } else if (value_result.is_double()) { + result = [NSNumber numberWithDouble:value_result.GetDouble()]; + DCHECK([result isKindOfClass:[NSNumber class]]); + } else if (value_result.is_bool()) { + result = [NSNumber numberWithBool:value_result.GetBool()]; + DCHECK([result isKindOfClass:[NSNumber class]]); + } else if (value_result.is_none()) { + result = [NSNull null]; + DCHECK([result isKindOfClass:[NSNull class]]); + } else if (value_result.is_dict()) { + NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init]; + for (const auto pair : value_result.GetDict()) { + NSString* key = base::SysUTF8ToNSString(pair.first); + id wk_result = NSObjectFromValueResult(pair.second, max_depth - 1); + if (wk_result) { + [dictionary setValue:wk_result forKey:key]; + } + } + result = [dictionary copy]; + } else if (value_result.is_list()) { + NSMutableArray* array = [[NSMutableArray alloc] init]; + for (const base::Value& value : value_result.GetList()) { + id wk_result = NSObjectFromValueResult(value, max_depth - 1); + if (wk_result) { + [array addObject:wk_result]; + } + } + result = [array copy]; + } else { + NOTREACHED(); // Convert other types as needed. + } + return result; +} + // Runs completion_handler with an error representing that no web view currently // exists so Javascript could not be executed. void NotifyCompletionHandlerNullWebView(void (^completion_handler)(id, @@ -101,6 +151,10 @@ return ::ValueResultFromWKResult(wk_result, kMaximumParsingRecursionDepth); } +id NSObjectFromValueResult(const base::Value& value_result) { + return ::NSObjectFromValueResult(value_result, kMaximumParsingRecursionDepth); +} + void ExecuteJavaScript(WKWebView* web_view, NSString* script, void (^completion_handler)(id, NSError*)) {
diff --git a/ios/web/js_messaging/web_view_js_utils_unittest.mm b/ios/web/js_messaging/web_view_js_utils_unittest.mm index 508bd39..829e404 100644 --- a/ios/web/js_messaging/web_view_js_utils_unittest.mm +++ b/ios/web/js_messaging/web_view_js_utils_unittest.mm
@@ -8,6 +8,7 @@ #import "base/functional/bind.h" #import "base/functional/callback_helpers.h" +#import "base/mac/foundation_util.h" #import "base/test/ios/wait_util.h" #import "base/values.h" #import "ios/web/test/fakes/crw_fake_script_message_handler.h" @@ -260,6 +261,102 @@ EXPECT_FALSE(current_list); } +// Tests that NSObjectFromValueResult converts Value::Type::STRING to NSString. +TEST_F(WebViewJsUtilsTest, NSObjectFromStringValueResult) { + id wk_result = web::NSObjectFromValueResult(base::Value("test")); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSString class]]); + EXPECT_NSEQ(@"test", wk_result); +} + +// Tests that NSObjectFromValueResult converts Value::Type::INT to NSNumber. +TEST_F(WebViewJsUtilsTest, NSObjectFromIntValueResult) { + id wk_result = web::NSObjectFromValueResult(base::Value(1)); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSNumber class]]); + EXPECT_EQ(1, [wk_result intValue]); +} + +// Tests that NSObjectFromValueResult converts Value::Type::DOUBLE to NSNumber. +TEST_F(WebViewJsUtilsTest, NSObjectFromDoubleValueResult) { + id wk_result = web::NSObjectFromValueResult(base::Value(3.14)); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSNumber class]]); + EXPECT_EQ(3.14, [wk_result doubleValue]); +} + +// Tests that NSObjectFromValueResult converts Value::Type::BOOLEAN to NSNumber. +TEST_F(WebViewJsUtilsTest, NSObjectFromBoolValueResult) { + id wk_result = web::NSObjectFromValueResult(base::Value(true)); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSNumber class]]); + EXPECT_EQ(YES, [wk_result boolValue]); + + wk_result = web::NSObjectFromValueResult(base::Value(false)); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSNumber class]]); + EXPECT_EQ(NO, [wk_result boolValue]); +} + +// Tests that NSObjectFromValueResult converts Value::Type::NONE to NSNull. +TEST_F(WebViewJsUtilsTest, NSObjectFromNoneValueResult) { + id wk_result = web::NSObjectFromValueResult(base::Value()); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSNull class]]); +} + +// Tests that NSObjectFromValueResult converts Value::Type::DICT to +// NSDictionary. +TEST_F(WebViewJsUtilsTest, NSObjectFromDictValueResult) { + base::Value::Dict test_dict; + test_dict.Set("Key1", "Value1"); + + base::Value::Dict inner_test_dict; + inner_test_dict.Set("Key3", 42); + test_dict.Set("Key2", std::move(inner_test_dict)); + + id wk_result = + web::NSObjectFromValueResult(base::Value(std::move(test_dict))); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSDictionary class]]); + + NSDictionary* wk_result_dictionary = + base::mac::ObjCCastStrict<NSDictionary>(wk_result); + EXPECT_NSEQ(@"Value1", wk_result_dictionary[@"Key1"]); + + NSDictionary* inner_dictionary = wk_result_dictionary[@"Key2"]; + EXPECT_TRUE(inner_dictionary); + EXPECT_NSEQ(@(42), inner_dictionary[@"Key3"]); +} + +// Tests that NSObjectFromValueResult converts Value::Type::LIST to NSArray. +TEST_F(WebViewJsUtilsTest, NSObjectFromListValueResult) { + base::Value::List test_list; + test_list.Append("Value1"); + + base::Value::List inner_test_list; + inner_test_list.Append(true); + test_list.Append(std::move(inner_test_list)); + + test_list.Append(42); + + id wk_result = + web::NSObjectFromValueResult(base::Value(std::move(test_list))); + EXPECT_TRUE(wk_result); + EXPECT_TRUE([wk_result isKindOfClass:[NSArray class]]); + + NSArray* wk_result_array = base::mac::ObjCCastStrict<NSArray>(wk_result); + + EXPECT_EQ(3UL, wk_result_array.count); + EXPECT_NSEQ(@"Value1", wk_result_array[0]); + + NSArray* inner_array = wk_result_array[1]; + EXPECT_TRUE(inner_array); + EXPECT_TRUE([inner_array isKindOfClass:[NSArray class]]); + + EXPECT_NSEQ(@(42), wk_result_array[2]); +} + // Tests that ExecuteJavaScript returns an error if there is no web view. TEST_F(WebViewJsUtilsTest, ExecuteJavaScriptNoWebView) { __block bool complete = false;
diff --git a/media/video/video_encode_accelerator.cc b/media/video/video_encode_accelerator.cc index 60edb04..f69248c 100644 --- a/media/video/video_encode_accelerator.cc +++ b/media/video/video_encode_accelerator.cc
@@ -125,6 +125,16 @@ break; } + str += ", content_type: "; + switch (content_type) { + case ContentType::kCamera: + str += "camera"; + break; + case ContentType::kDisplay: + str += "display"; + break; + } + if (spatial_layers.empty()) return str;
diff --git a/mojo/public/js/bindings_lite.js b/mojo/public/js/bindings_lite.js index 087cd27..43ad585 100644 --- a/mojo/public/js/bindings_lite.js +++ b/mojo/public/js/bindings_lite.js
@@ -53,6 +53,14 @@ }; /** + * @param {*} x + * @return {boolean} + */ +mojo.internal.isNullableValueKindField = function(x) { + return typeof x.nullableValueKindProperties !== 'undefined'; +} + +/** * @param {number} size * @param {number} alignment * @return {number} @@ -575,6 +583,23 @@ field.packedBitOffset, field.nullable); }; + // Encode a single optional numeric field into a flag field + // or a value field. + if (value && mojo.internal.isNullableValueKindField(field)) { + const props = field.nullableValueKindProperties; + const hasValue = + !mojo.internal.isNullOrUndefined(value[props.originalFieldName]); + if (props.isPrimary) { + encodeStructField(hasValue); + } else if (hasValue) { + encodeStructField(value[props.originalFieldName]); + } else { + // Use `defaultValue` to cover the enum case. + encodeStructField(field.defaultValue); + } + continue; + } + if (value && !mojo.internal.isNullOrUndefined(value[field.name])) { encodeStructField(value[field.name]); continue; @@ -882,22 +907,53 @@ `version (${version})`); } + const decodeStructField = (structField) => { + const byteOffset = + mojo.internal.kStructHeaderSize + structField.packedOffset; + const value = structField.type.$.decode( + this, byteOffset, structField.packedBitOffset, !!structField.nullable); + + if (value === null && !structField.nullable) { + throw new Error( + `Received ${structSpec.name} with invalid null field ` + + `"${structField.name}"`) + } + return value; + }; + const result = {}; for (const field of structSpec.fields) { - const byteOffset = mojo.internal.kStructHeaderSize + field.packedOffset; if (field.minVersion > version) { result[field.name] = field.defaultValue; continue; } - const value = field.type.$.decode( - this, byteOffset, field.packedBitOffset, !!field.nullable); - if (value === null && !field.nullable) { - throw new Error( - 'Received ' + structSpec.name + ' with invalid null field ' + - '"' + field.name + '"') + + if (mojo.internal.isNullableValueKindField(field)) { + // Decode an optional numeric pair into a single + // field. + const props = field.nullableValueKindProperties; + if (props.isPrimary) { + const hasValue = decodeStructField(field); + // If the field is null, set it here. If it isn't, + // the value will be decoded as part of decoding + // the non-primary field below. + if (!hasValue) { + result[props.originalFieldName] = null; + } + } else { + // If the field hasn't been set yet, then it's not + // null and we need to decode the value. + if (!(props.originalFieldName in result)) { + result[props.originalFieldName] = + decodeStructField(field); + } + } + continue; } - result[field.name] = value; + + result[field.name] = decodeStructField(field); } + return result; } @@ -1070,6 +1126,20 @@ */ mojo.internal.MapSpec; +// Use a @record, otherwise Closure Compiler will mangle the property names and +// cause runtime errors. +/** @record */ +mojo.internal.NullableValueKindProperties = class { + constructor() { + /** @export { boolean } */ + this.isPrimary; + /** @export { (string|undefined) } */ + this.linkedValueFieldName; + /** @export { string } */ + this.originalFieldName; + } +}; + /** * @typedef {{ * name: string, @@ -1079,6 +1149,8 @@ * defaultValue: *, * nullable: boolean, * minVersion: number, + * nullableValueKindProperties: + * (mojo.internal.NullableValueKindProperties|undefined), * }} */ mojo.internal.StructFieldSpec; @@ -1461,12 +1533,14 @@ * @param {*} defaultValue * @param {boolean} nullable * @param {number=} minVersion + * @param {mojo.internal.NullableValueKindProperties=} + nullableValueKindProperties * @return {!mojo.internal.StructFieldSpec} * @export */ mojo.internal.StructField = function( - name, packedOffset, packedBitOffset, type, defaultValue, nullable, - minVersion = 0) { + name, packedOffset, packedBitOffset, type, defaultValue, nullable, + minVersion = 0, nullableValueKindProperties = undefined) { return { name: name, packedOffset: packedOffset, @@ -1475,6 +1549,7 @@ defaultValue: defaultValue, nullable: nullable, minVersion: minVersion, + nullableValueKindProperties: nullableValueKindProperties, }; };
diff --git a/mojo/public/js/interface_support.js b/mojo/public/js/interface_support.js index a33f743..04858e6 100644 --- a/mojo/public/js/interface_support.js +++ b/mojo/public/js/interface_support.js
@@ -696,14 +696,35 @@ return Promise.reject(new Error('The pipe has already been closed.')); } + // Turns a functions args into an object where each property corresponds to + // an argument. + // + // Each argument in `args` has a single corresponding field in `fields` + // except for optional numerics which map to two fields in `fields`. This + // means args' indexes don't exactly match `fields`'s. As we iterate + // over the fields we keep track of how many optional numeric args we've + // seen to get the right `args` index. const value = {}; - paramStruct.$.structSpec.fields.forEach( - (field, index) => value[field.name] = args[index]); + let nullableValueKindFields = 0; + paramStruct.$.structSpec.fields.forEach((field, index) => { + const fieldArgsIndex = index - nullableValueKindFields; + if (!mojo.internal.isNullableValueKindField(field)) { + value[field.name] = args[fieldArgsIndex]; + return; + } + + const props = field.nullableValueKindProperties; + if (props.isPrimary) { + nullableValueKindFields++; + value[props.originalFieldName] = args[fieldArgsIndex]; + } + }); + const requestId = this.endpoint_.generateRequestId(); this.endpoint_.send( - ordinal, requestId, - maybeResponseStruct ? mojo.internal.kMessageFlagExpectsResponse : 0, - paramStruct, value); + ordinal, requestId, + maybeResponseStruct ? mojo.internal.kMessageFlagExpectsResponse : 0, + paramStruct, value); if (!maybeResponseStruct) { return Promise.resolve(); } @@ -1057,10 +1078,24 @@ if (!request) throw new Error('Received malformed message'); - let result = handler.handler.apply( - null, - handler.paramStruct.$.structSpec.fields.map( - field => request[field.name])); + // Each field in `handler.paramStruct.$.structSpec.fields` corresponds to + // an argument, except for optional numerics where two fields correspond to + // a single argument. + const args = []; + for (const field of handler.paramStruct.$.structSpec.fields) { + if (!mojo.internal.isNullableValueKindField(field)) { + args.push(request[field.name]); + continue; + } + + const props = field.nullableValueKindProperties; + if (!props.isPrimary) { + continue; + } + args.push(request[props.originalFieldName]); + } + + let result = handler.handler.apply(null, args); // If the message expects a response, the handler must return either a // well-formed response object, or a Promise that will eventually yield one.
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition.tmpl index a4f1016..74a578c 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition.tmpl
@@ -25,11 +25,25 @@ {{packed_field.field.kind|lite_js_type}}, {{packed_field.field|lite_default_value}}, {%- if packed_field.field.kind.is_nullable %} - true /* nullable */), + true, /* nullable */ {%- else %} - false /* nullable */), + false, /* nullable */ {%- endif %} -{%- endfor %} + 0 /* minVersion */, +{%- if packed_field|is_nullable_value_kind_packed_field %} +{%- set name = packed_field.original_field.name %} +{%- set isPrimary = packed_field|is_primary_nullable_value_kind_packed_field %} + { +{%- if isPrimary %} + isPrimary: true, + linkedValueFieldName: "{{packed_field.linked_value_packed_field.field.name}}", +{%- else %} + isPrimary: false, +{%- endif %} + originalFieldName: "{{name}}", + } +{%- endif %} + ),{%- endfor %} ], [ {%- for info in struct.versions -%} @@ -49,10 +63,19 @@ /** @record */ {{module.namespace}}.{{struct.name}} = class { constructor() { -{%- for packed_field in struct.packed.packed_fields %} +{%- for packed_field in struct.packed.packed_fields_in_ordinal_order %} +{%- if packed_field|is_nullable_value_kind_packed_field %} +{%- if packed_field|is_primary_nullable_value_kind_packed_field %} +{%- set original_field = packed_field.original_field %} +{%- set name = original_field.name %} +{%- set kind = original_field.kind %} + /** @export { {{original_field.kind|lite_closure_field_type}} } */ + this.{{name}}; +{%- endif %} +{%- else %} /** @export { {{packed_field.field.kind|lite_closure_field_type}} } */ this.{{packed_field.field.name}}; -{%- endfor %} +{%- endif %} +{%- endfor %} } }; -
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition_for_module.tmpl b/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition_for_module.tmpl index f9d5241..309ce1e 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition_for_module.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/lite/struct_definition_for_module.tmpl
@@ -27,7 +27,21 @@ {%- else %} false /* nullable */, {%- endif %} - {{packed_field.field.min_version or 0}}), + {{packed_field.field.min_version or 0}}, +{%- if packed_field|is_nullable_value_kind_packed_field %} +{%- set name = packed_field.original_field.name %} +{%- set isPrimary = packed_field|is_primary_nullable_value_kind_packed_field %} + { +{%- if isPrimary %} + isPrimary: true, + linkedValueFieldName: "{{packed_field.linked_value_packed_field.field.name}}", +{%- else %} + isPrimary: false, +{%- endif %} + originalFieldName: "{{name}}", + } +{%- endif %} + ), {%- endfor %} ], [ @@ -46,9 +60,19 @@ */ export class {{struct.name}} { constructor() { -{%- for packed_field in struct.packed.packed_fields %} +{%- for packed_field in struct.packed.packed_fields_in_ordinal_order %} +{%- if packed_field|is_nullable_value_kind_packed_field %} +{%- if packed_field|is_primary_nullable_value_kind_packed_field %} +{%- set original_field = packed_field.original_field %} +{%- set name = original_field.name %} +{%- set kind = original_field.kind %} + /** @type { {{original_field.kind|field_type_in_js_module}} } */ + this.{{name}}; +{%- endif %} +{%- else %} /** @type { {{packed_field.field.kind|field_type_in_js_module}} } */ this.{{packed_field.field.name}}; +{%- endif %} {%- endfor %} } }
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/test/BUILD.gn b/mojo/public/tools/bindings/generators/js_templates/lite/test/BUILD.gn index 96d3e94c..9bc2a4c 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/test/BUILD.gn +++ b/mojo/public/tools/bindings/generators/js_templates/lite/test/BUILD.gn
@@ -20,4 +20,31 @@ js_library("test") { deps = [ ":mojo_bindings_js_library_for_compile" ] } + + js_type_check("closure_compile_modules") { + deps = [ ":module_test" ] + + closure_flags = + default_closure_args + [ + # Remap "bindings.js" reference to "bindings_uncompiled.js" which has + # the necessary type annotations for compilation. + "browser_resolver_prefix_replacements=" + + "\"../../../../../../js/bindings.js\"=" + + "\"../../../../../../js/bindings_uncompiled.js\"", + "js_module_root=" + rebase_path(root_gen_dir, root_build_dir), + ] + } + + js_library("module_test") { + sources = [ "test.m.js" ] + deps = [ ":mojo_bindings_m_js" ] + } + + js_library("mojo_bindings_m_js") { + sources = [ "$target_gen_dir/test.test-mojom.m.js" ] + externs_list = [ "${externs_path}/mojo_core.js" ] + + deps = [ "//mojo/public/js:bindings_uncompiled" ] + extra_deps = [ ":mojo_bindings_js__generator" ] + } }
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/test/test.js b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.js index 9b550d9..9a4bf43 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/test/test.js +++ b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.js
@@ -16,6 +16,199 @@ let testStruct = result.ts } +async function testFunctionNumerics() { + let remote = test.mojom.TestPageHandler.getRemote(); + + // Tests that compiling passing values as optional numeric params works. + let result = await remote.methodWithOptionalNumerics( + /*optionalBool=*/ true, + /*optionalUnit8=*/ 1, + /*optionalInt8=*/ -1, + /*optionalUint16=*/ 1, + /*optionalInt16=*/ -1, + /*optionalUint32=*/ 1, + /*optionalInt32=*/ -1, + /*optionalUint64=*/ BigInt('1'), + /*optionalInt64=*/ BigInt('-1'), + /*optionalFloat=*/ 1.0, + /*optionalDouble=*/ 1.0, + /*optionalEnum=*/ test.mojom.TestEnum.FIRST); + + // The following assignments test that the returned values + // have the right type. For example the returned optionalBool should be + // a nullable boolean i.e. `?boolean`. If it wasn't we wouldn't be able + // to assign both a boolean and null to it: compilation would fail. + + /** @type {?boolean} */ + let optionalBool = result.optionalBool; + result.optionalBool = true; + result.optionalBool = null; + + /** @type {?number} */ + let optionalUint8 = result.optionalUint8; + result.optionalUint8 = 1; + result.optionalUint8 = null; + + /** @type {?number} */ + let optionalInt8 = result.optionalInt8; + result.optionalInt8 = -1; + result.optionalInt8 = null; + + /** @type {?number} */ + let optionalUint16 = result.optionalUint16; + result.optionalUint16 = 1; + result.optionalUint16 = null; + + /** @type {?number} */ + let optionalInt16 = result.optionalInt16; + result.optionalInt16 = -1; + result.optionalInt16 = null; + + /** @type {?number} */ + let optionalUint32 = result.optionalUint32; + result.optionalUint32 = 1; + result.optionalUint32 = null; + + /** @type {?number} */ + let optionalInt32 = result.optionalInt32; + result.optionalInt32 = -1; + result.optionalInt32 = null; + + /** @type {?bigint} */ + let optionalUint64 = result.optionalUint64; + result.optionalUint64 = BigInt('64'); + result.optionalUint64 = null; + + /** @type {?bigint} */ + let optionalInt64 = result.optionalInt64; + result.optionalInt64 = BigInt('-64'); + result.optionalInt64 = null; + + /** @type {?number} */ + let optionalFloat = result.optionalFloat; + result.optionalFloat = 1.0; + result.optionalFloat = null; + + /** @type {?number} */ + let optionalDouble = result.optionalDouble; + result.optionalDouble = 1.0; + result.optionalDouble = null; + + /** @type {?test.mojom.TestEnum} */ + let optionalEnum = result.optionalEnum; + result.optionalEnum = test.mojom.TestEnum.SECOND; + result.optionalEnum = null; + + // Tests compiling passing null as optional numeric params works. + await remote.methodWithOptionalNumerics( + /*optionalBool=*/ null, + /*optionalUnit8=*/ null, + /*optionalInt8=*/ null, + /*optionalUint16=*/ null, + /*optionalInt16=*/ null, + /*optionalUint32=*/ null, + /*optionalInt32=*/ null, + /*optionalUint64=*/ null, + /*optionalInt64=*/ null, + /*optionalFloat=*/ null, + /*optionalDouble=*/ null, + /*optionalEnum=*/ null); +} + +async function testFunctionNumericsStruct() { + /** @type {!test.mojom.TestStructOptionalNumerics} */ + let input = {}; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + /** @type {boolean|undefined} */ + input.optionalBool = true; + input.optionalBool = undefined; + + input.optionalUint8 = 1; + input.optionalUint8 = undefined; + + input.optionalInt8 = -1; + input.optionalInt8 = undefined; + + input.optionalUint16 = 1; + input.optionalUint16 = undefined; + + input.optionalInt16 = -1; + input.optionalInt16 = undefined; + + input.optionalUint32 = 1; + input.optionalUint32 = undefined; + + input.optionalInt32 = -1; + input.optionalInt32 = undefined; + + input.optionalUint64 = BigInt('1'); + input.optionalUint64 = undefined; + + input.optionalInt64 = BigInt('-1'); + input.optionalInt64 = undefined; + + input.optionalFloat = 1.0; + input.optionalFloat = undefined; + + input.optionalDouble = 1.0; + input.optionalDouble = undefined; + + input.optionalEnum = test.mojom.TestEnum.FIRST; + input.optionalEnum = undefined; + + let remote = test.mojom.TestPageHandler.getRemote(); + + // Test that the response struct is a TestStructOptionalNumerics. If + // it wasn't, trying to assign `out` to `response` would fail. + const {out} = await remote.methodWithStructWithOptionalNumerics(input); + /** @type {!test.mojom.TestStructOptionalNumerics} */ + let response = out; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + out.optionalBool = true; + out.optionalBool = undefined; + + out.optionalUint8 = 1; + out.optionalUint8 = undefined; + + out.optionalInt8 = -1; + out.optionalInt8 = undefined; + + out.optionalUint16 = 1; + out.optionalUint16 = undefined; + + out.optionalInt16 = -1; + out.optionalInt16 = undefined; + + out.optionalUint32 = 1; + out.optionalUint32 = undefined; + + out.optionalInt32 = -1; + out.optionalInt32 = undefined; + + out.optionalUint64 = BigInt('1'); + out.optionalUint64 = undefined; + + out.optionalInt64 = BigInt('-1'); + out.optionalInt64 = undefined; + + out.optionalFloat = 1.0; + out.optionalFloat = undefined; + + out.optionalDouble = 1.0; + out.optionalDouble = undefined; + + out.optionalEnum = test.mojom.TestEnum.FIRST; + out.optionalEnum = undefined; +} + /** @implements {test.mojom.TestPageInterface} */ class TestPageImpl { /** @override */ @@ -36,4 +229,52 @@ t.numberToInterfaceProxyMap[3]; handler.onEvent1(t); } + + /** @override */ + onEventWithStructWithOptionalNumerics(s) { + // Test that the argument is a TestStructOptionalNumerics. If + // it wasn't, trying to assign `s` to `arg` would fail. + /** @type {!test.mojom.TestStructOptionalNumerics} */ + let arg = s; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + s.optionalBool = true; + s.optionalBool = undefined; + + s.optionalUint8 = 1; + s.optionalUint8 = undefined; + + s.optionalInt8 = -1; + s.optionalInt8 = undefined; + + s.optionalUint16 = 1; + s.optionalUint16 = undefined; + + s.optionalInt16 = -1; + s.optionalInt16 = undefined; + + s.optionalUint32 = 1; + s.optionalUint32 = undefined; + + s.optionalInt32 = -1; + s.optionalInt32 = undefined; + + s.optionalUint64 = BigInt('1'); + s.optionalUint64 = undefined; + + s.optionalInt64 = BigInt('-1'); + s.optionalInt64 = undefined; + + s.optionalFloat = 1.0; + s.optionalFloat = undefined; + + s.optionalDouble = 1.0; + s.optionalDouble = undefined; + + s.optionalEnum = test.mojom.TestEnum.FIRST; + s.optionalEnum = undefined; + } }
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/test/test.m.js b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.m.js new file mode 100644 index 0000000..bd070b08 --- /dev/null +++ b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.m.js
@@ -0,0 +1,288 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {TestPageHandler, + TestPageHandlerRemote, + TestPageInterface, + TestStruct, + TestStructOptionalNumerics, + TestEnum, + Message} from "/mojo/public/tools/bindings/generators/js_templates/lite/test/test.test-mojom.m.js" + +async function testFunction() { + /** @type {TestPageHandlerRemote} */ + let remote = TestPageHandler.getRemote() + + // Type infers {?{values: !Array<!string>}} from Promise return type. + let result = await remote.method1(' ', 5); + + /** @type {Array<string>} */ + let values = result.values; + + /** @type {TestStruct} */ + let testStruct = result.ts +} + +async function testFunctionNumerics() { + let remote = TestPageHandler.getRemote(); + + // Tests that compiling passing values as optional numeric params works. + let result = await remote.methodWithOptionalNumerics( + /*optionalBool=*/ true, + /*optionalUnit8=*/ 1, + /*optionalInt8=*/ -1, + /*optionalUint16=*/ 1, + /*optionalInt16=*/ -1, + /*optionalUint32=*/ 1, + /*optionalInt32=*/ -1, + /*optionalUint64=*/ BigInt('1'), + /*optionalInt64=*/ BigInt('-1'), + /*optionalFloat=*/ 1.0, + /*optionalDouble=*/ 1.0, + /*optionalEnum=*/ TestEnum.FIRST); + + // The following assignments test that the returned values + // have the right type. For example the returned optionalBool should be + // a nullable boolean i.e. `?boolean`. If it wasn't we wouldn't be able + // to assign both a boolean and null to it: compilation would fail. + + /** @type {?boolean} */ + let optionalBool = result.optionalBool; + result.optionalBool = true; + result.optionalBool = null; + + /** @type {?number} */ + let optionalUint8 = result.optionalUint8; + result.optionalUint8 = 1; + result.optionalUint8 = null; + + /** @type {?number} */ + let optionalInt8 = result.optionalInt8; + result.optionalInt8 = -1; + result.optionalInt8 = null; + + /** @type {?number} */ + let optionalUint16 = result.optionalUint16; + result.optionalUint16 = 1; + result.optionalUint16 = null; + + /** @type {?number} */ + let optionalInt16 = result.optionalInt16; + result.optionalInt16 = -1; + result.optionalInt16 = null; + + /** @type {?number} */ + let optionalUint32 = result.optionalUint32; + result.optionalUint32 = 1; + result.optionalUint32 = null; + + /** @type {?number} */ + let optionalInt32 = result.optionalInt32; + result.optionalInt32 = -1; + result.optionalInt32 = null; + + /** @type {?bigint} */ + let optionalUint64 = result.optionalUint64; + result.optionalUint64 = BigInt('64'); + result.optionalUint64 = null; + + /** @type {?bigint} */ + let optionalInt64 = result.optionalInt64; + result.optionalInt64 = BigInt('-64'); + result.optionalInt64 = null; + + /** @type {?number} */ + let optionalFloat = result.optionalFloat; + result.optionalFloat = 1.0; + result.optionalFloat = null; + + /** @type {?number} */ + let optionalDouble = result.optionalDouble; + result.optionalDouble = 1.0; + result.optionalDouble = null; + + /** @type {?TestEnum} */ + let optionalEnum = result.optionalEnum; + result.optionalEnum = TestEnum.SECOND; + result.optionalEnum = null; + + // Tests compiling passing null as optional numeric params works. + await remote.methodWithOptionalNumerics( + /*optionalBool=*/ null, + /*optionalUnit8=*/ null, + /*optionalInt8=*/ null, + /*optionalUint16=*/ null, + /*optionalInt16=*/ null, + /*optionalUint32=*/ null, + /*optionalInt32=*/ null, + /*optionalUint64=*/ null, + /*optionalInt64=*/ null, + /*optionalFloat=*/ null, + /*optionalDouble=*/ null, + /*optionalEnum=*/ null); +} + +async function testFunctionNumericsStruct() { + /** @type {!TestStructOptionalNumerics} */ + let input = {}; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + /** @type {boolean|undefined} */ + input.optionalBool = true; + input.optionalBool = undefined; + + input.optionalUint8 = 1; + input.optionalUint8 = undefined; + + input.optionalInt8 = -1; + input.optionalInt8 = undefined; + + input.optionalUint16 = 1; + input.optionalUint16 = undefined; + + input.optionalInt16 = -1; + input.optionalInt16 = undefined; + + input.optionalUint32 = 1; + input.optionalUint32 = undefined; + + input.optionalInt32 = -1; + input.optionalInt32 = undefined; + + input.optionalUint64 = BigInt('1'); + input.optionalUint64 = undefined; + + input.optionalInt64 = BigInt('-1'); + input.optionalInt64 = undefined; + + input.optionalFloat = 1.0; + input.optionalFloat = undefined; + + input.optionalDouble = 1.0; + input.optionalDouble = undefined; + + input.optionalEnum = TestEnum.FIRST; + input.optionalEnum = undefined; + + let remote = TestPageHandler.getRemote(); + + // Test that the response struct is a TestStructOptionalNumerics. If + // it wasn't, trying to assign `out` to `response` would fail. + const {out} = await remote.methodWithStructWithOptionalNumerics(input); + /** @type {!TestStructOptionalNumerics} */ + let response = out; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + out.optionalBool = true; + out.optionalBool = undefined; + + out.optionalUint8 = 1; + out.optionalUint8 = undefined; + + out.optionalInt8 = -1; + out.optionalInt8 = undefined; + + out.optionalUint16 = 1; + out.optionalUint16 = undefined; + + out.optionalInt16 = -1; + out.optionalInt16 = undefined; + + out.optionalUint32 = 1; + out.optionalUint32 = undefined; + + out.optionalInt32 = -1; + out.optionalInt32 = undefined; + + out.optionalUint64 = BigInt('1'); + out.optionalUint64 = undefined; + + out.optionalInt64 = BigInt('-1'); + out.optionalInt64 = undefined; + + out.optionalFloat = 1.0; + out.optionalFloat = undefined; + + out.optionalDouble = 1.0; + out.optionalDouble = undefined; + + out.optionalEnum = TestEnum.FIRST; + out.optionalEnum = undefined; +} + +/** @implements {TestPageInterface} */ +class TestPageImpl { + /** @override */ + onEvent1(s) { + /** @type {TestStruct} */ let t = s; + /** @type {string} */ let id = t.id; + /** @type {string|undefined} */ let title = t.title; + /** @type {TestEnum} */ let enumValue = t.enums[0]; + + /** @type {string} */ let numberToStringMapValue = t.numberToStringMap[5]; + + /** @type {Message} */ let messageToMessageArrayValue = + t.messageToArrayMap.get({message: 'asdf'})[0]; + + /** @type {TestEnum} */ let enumToMapMapValue = + t.enumToMapMap[TestEnum.FIRST][TestEnum.SECOND]; + /** @type {TestPageInterface} */ let handler = + t.numberToInterfaceProxyMap[3]; + handler.onEvent1(t); + } + + /** @override */ + onEventWithStructWithOptionalNumerics(s) { + // Test that the argument is a TestStructOptionalNumerics. If + // it wasn't, trying to assign `s` to `arg` would fail. + /** @type {!TestStructOptionalNumerics} */ + let arg = s; + + // The following assignments test that the struct annotations have the + // the right type. For example `optionalBool` should be boolean or + // undefined i.e. `boolean|undefined`. If it wasn't we wouldn't be able to + // assign both a boolean and `undefined` to it: compilation would fail. + s.optionalBool = true; + s.optionalBool = undefined; + + s.optionalUint8 = 1; + s.optionalUint8 = undefined; + + s.optionalInt8 = -1; + s.optionalInt8 = undefined; + + s.optionalUint16 = 1; + s.optionalUint16 = undefined; + + s.optionalInt16 = -1; + s.optionalInt16 = undefined; + + s.optionalUint32 = 1; + s.optionalUint32 = undefined; + + s.optionalInt32 = -1; + s.optionalInt32 = undefined; + + s.optionalUint64 = BigInt('1'); + s.optionalUint64 = undefined; + + s.optionalInt64 = BigInt('-1'); + s.optionalInt64 = undefined; + + s.optionalFloat = 1.0; + s.optionalFloat = undefined; + + s.optionalDouble = 1.0; + s.optionalDouble = undefined; + + s.optionalEnum = TestEnum.FIRST; + s.optionalEnum = undefined; + } +}
diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/test/test.test-mojom b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.test-mojom index 5af51f3..7f9ecae 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/test/test.test-mojom +++ b/mojo/public/tools/bindings/generators/js_templates/lite/test/test.test-mojom
@@ -23,10 +23,55 @@ map<uint32, pending_remote<TestPage>> numberToInterfaceProxyMap; }; +struct TestStructOptionalNumerics { + bool? optional_bool; + uint8? optional_uint8; + int8? optional_int8; + uint16? optional_uint16; + int16? optional_int16; + uint32? optional_uint32; + int32? optional_int32; + uint64? optional_uint64; + int64? optional_int64; + float? optional_float; + double? optional_double; + TestEnum? optional_enum; +}; + interface TestPageHandler { Method1(string p1, int32 p2) => (array<string> values, TestStruct ts); + MethodWithOptionalNumerics( + bool? optional_bool, + uint8? optional_uint8, + int8? optional_int8, + uint16? optional_uint16, + int16? optional_int16, + uint32? optional_uint32, + int32? optional_int32, + uint64? optional_uint64, + int64? optional_int64, + float? optional_float, + double? optional_double, + TestEnum? optional_enum + ) => ( + bool? optional_bool, + uint8? optional_uint8, + int8? optional_int8, + uint16? optional_uint16, + int16? optional_int16, + uint32? optional_uint32, + int32? optional_int32, + uint64? optional_uint64, + int64? optional_int64, + float? optional_float, + double? optional_double, + TestEnum? optional_enum + ); + MethodWithStructWithOptionalNumerics(TestStructOptionalNumerics input) + => (TestStructOptionalNumerics out); }; interface TestPage { OnEvent1(TestStruct s); + OnEventWithStructWithOptionalNumerics(TestStructOptionalNumerics s); };
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py index 1643464..c65c93a 100644 --- a/mojo/public/tools/bindings/generators/mojom_js_generator.py +++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py
@@ -77,9 +77,22 @@ mojom.INT32: "number", mojom.UINT32: "number", mojom.FLOAT: "number", - mojom.INT64: "number", - mojom.UINT64: "number", + mojom.INT64: "bigint", + mojom.UINT64: "bigint", mojom.DOUBLE: "number", + # The nullability annotation i.e. '?' is added by the code that needs it, so + # these have the same types as the above non-nullable kinds. + mojom.NULLABLE_BOOL: "boolean", + mojom.NULLABLE_INT8: "number", + mojom.NULLABLE_UINT8: "number", + mojom.NULLABLE_INT16: "number", + mojom.NULLABLE_UINT16: "number", + mojom.NULLABLE_INT32: "number", + mojom.NULLABLE_UINT32: "number", + mojom.NULLABLE_FLOAT: "number", + mojom.NULLABLE_INT64: "bigint", + mojom.NULLABLE_UINT64: "bigint", + mojom.NULLABLE_DOUBLE: "number", mojom.STRING: "string", mojom.NULLABLE_STRING: "string", mojom.HANDLE: "MojoHandle", @@ -328,6 +341,10 @@ def GetFilters(self): js_filters = { + "is_nullable_value_kind_packed_field": + pack.IsNullableValueKindPackedField, + "is_primary_nullable_value_kind_packed_field": + pack.IsPrimaryNullableValueKindPackedField, "closure_type": self._ClosureType, "constant_value": self._GetConstantValue, "constant_value_in_js_module": self._GetConstantValueInJsModule, @@ -517,6 +534,8 @@ kind, with_nullability=False, for_module=False): + # If `with_nullability` is true, we'll include a nullable annotation which + # in the Closure case is `?`. Otherwise, the annotation will be omitted. def recurse_with_nullability(kind): return self._GetTypeNameForNewBindings(kind, with_nullability=True, @@ -580,6 +599,8 @@ return "Object" raise Exception("No valid closure type: %s" % kind) + # Prepend `?` for nullable kinds and `!` for non-nullable kinds. These are + # used by Closure. if with_nullability: return ('?' if mojom.IsNullableKind(kind) else '!') + get_type_name(kind) @@ -788,7 +809,10 @@ if field.kind in mojom.PRIMITIVES: return _kind_to_javascript_default_value[field.kind] if mojom.IsEnumKind(field.kind): + if field.kind.min_value is not None: + return f'{field.kind.min_value}' return "0" + return "null" def _LiteJavaScriptDefaultValue(self, field):
diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc index 81e98d4..aff09da 100644 --- a/net/base/io_buffer.cc +++ b/net/base/io_buffer.cc
@@ -95,8 +95,8 @@ } void DrainableIOBuffer::SetOffset(int bytes) { - DCHECK_GE(bytes, 0); - DCHECK_LE(bytes, size_); + CHECK_GE(bytes, 0); + CHECK_LE(bytes, size_); used_ = bytes; data_ = base_->data() + used_; } @@ -109,7 +109,7 @@ GrowableIOBuffer::GrowableIOBuffer() = default; void GrowableIOBuffer::SetCapacity(int capacity) { - DCHECK_GE(capacity, 0); + CHECK_GE(capacity, 0); // this will get reset in `set_offset`. data_ = nullptr; // realloc will crash if it fails. @@ -123,8 +123,8 @@ } void GrowableIOBuffer::set_offset(int offset) { - DCHECK_GE(offset, 0); - DCHECK_LE(offset, capacity_); + CHECK_GE(offset, 0); + CHECK_LE(offset, capacity_); offset_ = offset; data_ = real_data_.get() + offset; }
diff --git a/net/socket/socket_bio_adapter.cc b/net/socket/socket_bio_adapter.cc index 3f91a6a..de100ed 100644 --- a/net/socket/socket_bio_adapter.cc +++ b/net/socket/socket_bio_adapter.cc
@@ -297,6 +297,8 @@ } // Advance the ring buffer. + CHECK_LE(result, write_buffer_used_); + CHECK_LE(result, write_buffer_->RemainingCapacity()); write_buffer_->set_offset(write_buffer_->offset() + result); write_buffer_used_ -= result; if (write_buffer_->RemainingCapacity() == 0)
diff --git a/services/network/cors/preflight_cache.cc b/services/network/cors/preflight_cache.cc index 0e15dd8..b5fe078 100644 --- a/services/network/cors/preflight_cache.cc +++ b/services/network/cors/preflight_cache.cc
@@ -58,9 +58,8 @@ return dict; } -void ReportCacheMetricAndRecordNetLog(CacheMetric metric, - const net::NetLogWithSource& net_log) { - UMA_HISTOGRAM_ENUMERATION("Net.Cors.PreflightCacheResult", metric); +void RecordCacheMetricNetLog(CacheMetric metric, + const net::NetLogWithSource& net_log) { net_log.AddEvent(net::NetLogEventType::CHECK_CORS_PREFLIGHT_CACHE, [&] { return NetLogCacheStatusParams(metric); }); } @@ -93,9 +92,6 @@ // kMaxCacheEntries at maximum. MayPurge(kMaxCacheEntries - 1, kPurgeUnit); } - UMA_HISTOGRAM_COUNTS_10000("Net.Cors.PreflightCacheKeySize", - url_spec.length()); - cache_[key] = std::move(preflight_result); } @@ -115,7 +111,7 @@ target_ip_address_space); auto cache_entry = cache_.find(key); if (cache_entry == cache_.end()) { - ReportCacheMetricAndRecordNetLog(CacheMetric::kMiss, net_log); + RecordCacheMetricNetLog(CacheMetric::kMiss, net_log); return false; } @@ -130,15 +126,15 @@ // Note that we always use the "with non-wildcard request headers" // variant, because it is hard to generate the correct error information // from here, and cache miss is in most case recoverable. - ReportCacheMetricAndRecordNetLog(CacheMetric::kHitAndPass, net_log); + RecordCacheMetricNetLog(CacheMetric::kHitAndPass, net_log); net_log.AddEvent( net::NetLogEventType::CORS_PREFLIGHT_CACHED_RESULT, [&cache_entry] { return cache_entry->second->NetLogParams(); }); return true; } - ReportCacheMetricAndRecordNetLog(CacheMetric::kHitAndFail, net_log); + RecordCacheMetricNetLog(CacheMetric::kHitAndFail, net_log); } else { - ReportCacheMetricAndRecordNetLog(CacheMetric::kStale, net_log); + RecordCacheMetricNetLog(CacheMetric::kStale, net_log); } // The cache entry is either stale or not sufficient. Remove the item from the
diff --git a/services/network/cors/preflight_controller.cc b/services/network/cors/preflight_controller.cc index fbe76d4..bda1b00 100644 --- a/services/network/cors/preflight_controller.cc +++ b/services/network/cors/preflight_controller.cc
@@ -228,15 +228,6 @@ actual_credentials_mode, origin); const bool has_ok_status = IsSuccessfulStatus(response_status_code); - AccessCheckResult result = (!cors_result.has_value() || !has_ok_status) - ? AccessCheckResult::kNotPermittedInPreflight - : AccessCheckResult::kPermittedInPreflight; - UMA_HISTOGRAM_ENUMERATION("Net.Cors.AccessCheckResult", result); - if (!network::IsOriginPotentiallyTrustworthy(origin)) { - UMA_HISTOGRAM_ENUMERATION("Net.Cors.AccessCheckResult.NotSecureRequestor", - result); - } - if (cors_result.has_value()) { if (has_ok_status) { return base::ok();
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 859a8c4..03c4945 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -123,8 +123,6 @@ "simple_url_loader.cc", "simple_url_loader.h", "simple_url_loader_stream_consumer.h", - "simple_url_loader_throttle.cc", - "simple_url_loader_throttle.h", "single_request_url_loader_factory.cc", "single_request_url_loader_factory.h", "source_stream_to_data_pipe.cc",
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc index 07cf4d8..a4ad24c8 100644 --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc
@@ -263,12 +263,6 @@ "CorsNonWildcardRequestHeadersSupport", base::FEATURE_DISABLED_BY_DEFAULT); -// Allow batching SimpleURLLoaders when the underlying network state is -// inactive. -BASE_FEATURE(kBatchSimpleURLLoader, - "BatchSimpleURLLoader", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kNetworkServiceMemoryCache, "NetworkServiceMemoryCache", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h index 7979eda..7acc973 100644 --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h
@@ -83,8 +83,6 @@ COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kCorsNonWildcardRequestHeadersSupport); -COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kBatchSimpleURLLoader); - COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkServiceMemoryCache); COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kOmitCorsClientCert);
diff --git a/services/network/public/cpp/simple_url_loader.cc b/services/network/public/cpp/simple_url_loader.cc index 3f22170..9ad751c 100644 --- a/services/network/public/cpp/simple_url_loader.cc +++ b/services/network/public/cpp/simple_url_loader.cc
@@ -42,7 +42,6 @@ #include "services/network/public/cpp/record_ontransfersizeupdate_utils.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" -#include "services/network/public/cpp/simple_url_loader_throttle.h" #include "services/network/public/mojom/data_pipe_getter.mojom.h" #include "services/network/public/mojom/early_hints.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" @@ -257,7 +256,6 @@ void SetURLLoaderFactoryOptions(uint32_t options) override; void SetRequestID(int32_t request_id) override; void SetTimeoutDuration(base::TimeDelta timeout_duration) override; - void SetAllowBatching() override; int NetError() const override; const mojom::URLResponseHead* ResponseInfo() const override; @@ -267,7 +265,6 @@ bool LoadedFromCache() const override; int64_t GetContentSize() const override; int GetNumRetries() const override; - SimpleURLLoaderThrottle* GetThrottleForTesting() override; // IN-TEST // Called by BodyHandler when the BodyHandler body handler is done. If |error| // is not net::OK, some error occurred reading or consuming the body. If it is @@ -420,8 +417,6 @@ // of zero means do not set a timeout. base::TimeDelta timeout_duration_ = base::TimeDelta(); - std::unique_ptr<SimpleURLLoaderThrottle> throttle_; - SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<SimpleURLLoaderImpl> weak_ptr_factory_{this}; @@ -1497,12 +1492,6 @@ timeout_duration_ = timeout_duration; } -void SimpleURLLoaderImpl::SetAllowBatching() { - // Check if a request has not yet been started. - DCHECK(!body_handler_); - throttle_ = std::make_unique<SimpleURLLoaderThrottle>(); -} - int SimpleURLLoaderImpl::NetError() const { // Should only be called once the request is complete. DCHECK(request_state_->finished); @@ -1532,10 +1521,6 @@ return num_retries_; } -SimpleURLLoaderThrottle* SimpleURLLoaderImpl::GetThrottleForTesting() { - return throttle_.get(); -} - const mojom::URLResponseHead* SimpleURLLoaderImpl::ResponseInfo() const { // Should only be called once the request is complete. DCHECK(request_state_->finished); @@ -1637,8 +1622,8 @@ DCHECK(!url_loader_); DCHECK(!request_state_->body_started); - // Stash the information if retries are enabled or the request can be batched. - if (remaining_retries_ > 0 || throttle_) { + // Stash the information if retries are enabled. + if (remaining_retries_ > 0) { // Clone the URLLoaderFactory, to avoid any dependencies on its lifetime. // Results in an easier to use API, with no shutdown ordering requirements, // at the cost of some resources. @@ -1646,12 +1631,6 @@ url_loader_factory_remote_.BindNewPipeAndPassReceiver()); } - if (throttle_) { - throttle_->NotifyWhenReady(base::BindOnce( - &SimpleURLLoaderImpl::OnReadyToStart, weak_ptr_factory_.GetWeakPtr())); - return; - } - StartRequest(url_loader_factory); }
diff --git a/services/network/public/cpp/simple_url_loader.h b/services/network/public/cpp/simple_url_loader.h index 39f6cd7..101bda9 100644 --- a/services/network/public/cpp/simple_url_loader.h +++ b/services/network/public/cpp/simple_url_loader.h
@@ -45,7 +45,6 @@ namespace network { class SimpleURLLoaderStreamConsumer; -class SimpleURLLoaderThrottle; // Creates and wraps a URLLoader, and runs it to completion. It's recommended // that consumers use this class instead of URLLoader directly, due to the @@ -355,13 +354,6 @@ // as much time as it wants. virtual void SetTimeoutDuration(base::TimeDelta timeout_duration) = 0; - // Allows this SimpleURLLoader to be batched when sending a network request - // impacts on battery consumption. This should be called before the request - // is started. - // NOTE: This is for an experimental use. Please contact bashi@chromium.org - // before starting using this function. - virtual void SetAllowBatching() = 0; - // Returns the net::Error representing the final status of the request. May // only be called once the loader has informed the caller of completion. virtual int NetError() const = 0; @@ -401,8 +393,6 @@ // Returns the number of times retry has been attempted. virtual int GetNumRetries() const = 0; - virtual SimpleURLLoaderThrottle* GetThrottleForTesting() = 0; - protected: SimpleURLLoader(); };
diff --git a/services/network/public/cpp/simple_url_loader_throttle.cc b/services/network/public/cpp/simple_url_loader_throttle.cc deleted file mode 100644 index 24b41842..0000000 --- a/services/network/public/cpp/simple_url_loader_throttle.cc +++ /dev/null
@@ -1,216 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "services/network/public/cpp/simple_url_loader_throttle.h" - -#include "base/containers/flat_set.h" -#include "base/feature_list.h" -#include "base/memory/raw_ptr.h" -#include "base/metrics/histogram_functions.h" -#include "base/no_destructor.h" -#include "base/power_monitor/power_monitor.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_split.h" -#include "build/build_config.h" -#include "net/base/network_change_notifier.h" -#include "net/traffic_annotation/network_traffic_annotation.h" -#include "services/network/public/cpp/features.h" - -#if BUILDFLAG(IS_ANDROID) -#include "base/android/radio_utils.h" -#endif // BUILDFLAGS(IS_ANDROID) - -namespace network { - -namespace { - -// A SimpleURLLoaderBatcher::Delegate which tries to batch loaders when -// the default network is inactive (e.g. in low power state). -class BatchingDelegate - : public SimpleURLLoaderThrottle::Delegate, - public net::NetworkChangeNotifier::DefaultNetworkActiveObserver { - public: - explicit BatchingDelegate(SimpleURLLoaderThrottle* owner) : owner_(owner) {} - ~BatchingDelegate() override { - if (is_observing_default_network_) - net::NetworkChangeNotifier::RemoveDefaultNetworkActiveObserver(this); - } - - bool ShouldThrottle() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (net::NetworkChangeNotifier::IsDefaultNetworkActive()) - return false; - - if (base::PowerMonitor::IsInitialized() && - !base::PowerMonitor::IsOnBatteryPower()) { - return false; - } - -#if BUILDFLAG(IS_ANDROID) - if (base::android::RadioUtils::GetConnectionType() != - base::android::RadioConnectionType::kCell) { - return false; - } -#endif // BUILDFLAGS(IS_ANDROID) - - if (!is_observing_default_network_) { - net::NetworkChangeNotifier::AddDefaultNetworkActiveObserver(this); - is_observing_default_network_ = true; - } - - return true; - } - - private: - // net::NetworkChangeNotifier::DefaultNetworkActiveObserver method: - void OnDefaultNetworkActive() override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(is_observing_default_network_); - - net::NetworkChangeNotifier::RemoveDefaultNetworkActiveObserver(this); - is_observing_default_network_ = false; - - // `owner_` deletes `this`. - owner_->OnReadyToStart(); - } - - // Must outlive `this`. - raw_ptr<SimpleURLLoaderThrottle> const owner_; - - bool is_observing_default_network_ = false; - - SEQUENCE_CHECKER(sequence_checker_); -}; - -// Parses field trial parameters and holds parsed parameters. -class BatchingConfig { - public: - BatchingConfig() { Initialize(); } - - ~BatchingConfig() = default; - - BatchingConfig(const BatchingConfig&) = delete; - BatchingConfig& operator=(const BatchingConfig&) = delete; - BatchingConfig(BatchingConfig&&) = delete; - BatchingConfig& operator=(BatchingConfig&&) = delete; - - bool IsBatchingEnabledForTrafficAnnotation( - const net::NetworkTrafficAnnotationTag& traffic_annotation) const { - return enabled_traffic_annotation_hashes_.contains( - traffic_annotation.unique_id_hash_code); - } - - void ResetForTesting() { - enabled_traffic_annotation_hashes_.clear(); - Initialize(); - } - - private: - void Initialize() { - DCHECK(enabled_traffic_annotation_hashes_.empty()); - - std::string comma_separated_hashes = base::GetFieldTrialParamValueByFeature( - features::kBatchSimpleURLLoader, - kBatchSimpleURLLoaderEnabledTrafficAnnotationHashesParam); - const std::vector<std::string> values = - base::SplitString(comma_separated_hashes, ",", base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); - for (const auto& value : values) { - uint32_t parsed; - if (!base::StringToUint(value, &parsed)) - continue; - enabled_traffic_annotation_hashes_.insert(parsed); - } - } - - base::flat_set<uint32_t> enabled_traffic_annotation_hashes_; -}; - -BatchingConfig& GetBatchingConfig() { - static base::NoDestructor<BatchingConfig> configuration; - return *configuration; -} - -} // namespace - -// static -bool SimpleURLLoaderThrottle::IsBatchingEnabled( - const net::NetworkTrafficAnnotationTag& traffic_annotation) { - if (!base::FeatureList::IsEnabled(features::kBatchSimpleURLLoader)) - return false; - - if (!GetBatchingConfig().IsBatchingEnabledForTrafficAnnotation( - traffic_annotation)) { - return false; - } - - return true; -} - -// static -void SimpleURLLoaderThrottle::ResetConfigForTesting() { - GetBatchingConfig().ResetForTesting(); // IN-TEST -} - -SimpleURLLoaderThrottle::Delegate::Delegate() = default; -SimpleURLLoaderThrottle::Delegate::~Delegate() = default; - -SimpleURLLoaderThrottle::SimpleURLLoaderThrottle() - : delegate_(std::make_unique<BatchingDelegate>(this)) {} - -SimpleURLLoaderThrottle::~SimpleURLLoaderThrottle() = default; - -void SimpleURLLoaderThrottle::NotifyWhenReady(base::OnceClosure callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(callback_.is_null()); - DCHECK(!timeout_timer_.IsRunning()); - DCHECK(delegate_); - - bool should_throttle = delegate_->ShouldThrottle(); - base::UmaHistogramBoolean("Network.Radio.SimpleURLLoaderIsThrottled", - should_throttle); - - if (!should_throttle) { - std::move(callback).Run(); - return; - } - - throttling_start_time_ = base::TimeTicks::Now(); - callback_ = std::move(callback); - - // Unretained is safe because `this` owns `timeout_timer_`. - timeout_timer_.Start(FROM_HERE, timeout_, - base::BindOnce(&SimpleURLLoaderThrottle::OnTimeout, - base::Unretained(this))); -} - -void SimpleURLLoaderThrottle::OnReadyToStart() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(callback_); - timeout_timer_.Stop(); - delegate_.reset(); - - base::TimeDelta throttled_time = - base::TimeTicks::Now() - throttling_start_time_; - base::UmaHistogramLongTimes("Network.Radio.SimpleURLLoaderThrottledTime", - throttled_time); - - std::move(callback_).Run(); -} - -void SimpleURLLoaderThrottle::OnTimeout() { - OnReadyToStart(); -} - -void SimpleURLLoaderThrottle::SetDelegateForTesting( - std::unique_ptr<Delegate> delegate) { - delegate_ = std::move(delegate); -} - -void SimpleURLLoaderThrottle::SetTimeoutForTesting(base::TimeDelta timeout) { - DCHECK(!timeout_timer_.IsRunning()); - timeout_ = timeout; -} - -} // namespace network
diff --git a/services/network/public/cpp/simple_url_loader_throttle.h b/services/network/public/cpp/simple_url_loader_throttle.h deleted file mode 100644 index fedcaa51..0000000 --- a/services/network/public/cpp/simple_url_loader_throttle.h +++ /dev/null
@@ -1,87 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef SERVICES_NETWORK_PUBLIC_CPP_SIMPLE_URL_LOADER_THROTTLE_H_ -#define SERVICES_NETWORK_PUBLIC_CPP_SIMPLE_URL_LOADER_THROTTLE_H_ - -#include "base/component_export.h" -#include "base/functional/callback.h" -#include "base/sequence_checker.h" -#include "base/time/time.h" -#include "base/timer/timer.h" - -namespace net { -struct NetworkTrafficAnnotationTag; -} // namespace net - -namespace network { - -constexpr char kBatchSimpleURLLoaderEnabledTrafficAnnotationHashesParam[] = - "batching_enabled_traffic_annotation_hashes"; - -// Throttles SimpleURLLoader creations based on the underlying network -// connection status. When a SimpleURLLoader is allowed to be batched, this -// class hooks the the SimpleURLLoader creation and delays the SimpleURLLoader -// until the underlying network connection becomes active, or a certain amount -// of time has elapsed. -class COMPONENT_EXPORT(NETWORK_CPP) SimpleURLLoaderThrottle { - public: - // Returns true when batching a SimpleURLLoader associated with - // `traffic_annotation` is enabled via experiment configurations. - static bool IsBatchingEnabled( - const net::NetworkTrafficAnnotationTag& traffic_annotation); - - // Resets experiment configurations for testing. - static void ResetConfigForTesting(); - - // Handles platform specific logic to determine whether a request should be - // batched or not. Also used for testing. - class COMPONENT_EXPORT(NETWORK_CPP) Delegate { - public: - Delegate(); - virtual ~Delegate(); - - Delegate(const Delegate&) = delete; - Delegate& operator=(const Delegate&) = delete; - - // Returns whether a request should be throttled. - virtual bool ShouldThrottle() = 0; - }; - - SimpleURLLoaderThrottle(); - ~SimpleURLLoaderThrottle(); - SimpleURLLoaderThrottle(const SimpleURLLoaderThrottle&) = delete; - SimpleURLLoaderThrottle& operator=(const SimpleURLLoaderThrottle&) = delete; - SimpleURLLoaderThrottle(SimpleURLLoaderThrottle&&) = delete; - SimpleURLLoaderThrottle& operator=(SimpleURLLoaderThrottle&&) = delete; - - // Called before starting a SimpleURLLoader which can be batched. The loader - // will be suspended if Delegate::ShouldThrottle() returns true. - void NotifyWhenReady(base::OnceClosure callback); - - // Resumes the throttled callback if needed. - void OnReadyToStart(); - - void SetDelegateForTesting(std::unique_ptr<Delegate> delegate); - void SetTimeoutForTesting(base::TimeDelta timeout); - Delegate& GetDelegateForTesting() { return *delegate_; } - - private: - void OnTimeout(); - - std::unique_ptr<Delegate> delegate_; - base::OnceClosure callback_; - - static constexpr base::TimeDelta kDefaultTimeout = base::Minutes(15); - base::TimeDelta timeout_ = kDefaultTimeout; - base::OneShotTimer timeout_timer_; - - base::TimeTicks throttling_start_time_; - - SEQUENCE_CHECKER(sequence_checker_); -}; - -} // namespace network - -#endif // SERVICES_NETWORK_PUBLIC_CPP_SIMPLE_URL_LOADER_THROTTLE_H_
diff --git a/services/network/public/cpp/simple_url_loader_unittest.cc b/services/network/public/cpp/simple_url_loader_unittest.cc index b3fff98..a6b7d48 100644 --- a/services/network/public/cpp/simple_url_loader_unittest.cc +++ b/services/network/public/cpp/simple_url_loader_unittest.cc
@@ -56,7 +56,6 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" -#include "services/network/public/cpp/simple_url_loader_throttle.h" #include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/mojom/data_pipe_getter.mojom.h" #include "services/network/public/mojom/network_service.mojom.h" @@ -3787,209 +3786,5 @@ run_loop.Run(); } -namespace { - -class FakeSimpleURLLoaderThrottleDelegate - : public SimpleURLLoaderThrottle::Delegate { - public: - FakeSimpleURLLoaderThrottleDelegate() = default; - ~FakeSimpleURLLoaderThrottleDelegate() override = default; - - bool ShouldThrottle() override { return true; } -}; - -} // namespace - -TEST_P(SimpleURLLoaderTest, BatchingSuccess) { - std::unique_ptr<network::ResourceRequest> resource_request = - std::make_unique<network::ResourceRequest>(); - resource_request->url = test_server_.GetURL("/echoheader?foo"); - resource_request->headers.SetHeader("foo", kExpectedResponse); - std::unique_ptr<SimpleLoaderTestHelper> test_helper = - CreateHelper(std::move(resource_request)); - - test_helper->simple_url_loader()->SetAllowBatching(); - SimpleURLLoaderThrottle* throttle = - test_helper->simple_url_loader()->GetThrottleForTesting(); - throttle->SetDelegateForTesting( - std::make_unique<FakeSimpleURLLoaderThrottleDelegate>()); - - test_helper->StartSimpleLoader(url_loader_factory_.get()); - - throttle->OnReadyToStart(); - test_helper->Wait(); - - EXPECT_EQ(net::OK, test_helper->simple_url_loader()->NetError()); - EXPECT_EQ(200, test_helper->GetResponseCode()); - if (GetParam() != SimpleLoaderTestHelper::DownloadType::HEADERS_ONLY) { - EXPECT_TRUE(test_helper->simple_url_loader()->CompletionStatus()); - EXPECT_EQ(kExpectedResponse, *test_helper->response_body()); - } -} - -TEST_P(SimpleURLLoaderTest, BatchingURLLoaderDisconnected) { - std::unique_ptr<network::ResourceRequest> resource_request = - std::make_unique<network::ResourceRequest>(); - resource_request->url = test_server_.GetURL("/echoheader?foo"); - resource_request->headers.SetHeader("foo", kExpectedResponse); - std::unique_ptr<SimpleLoaderTestHelper> test_helper = - CreateHelper(std::move(resource_request)); - - test_helper->simple_url_loader()->SetAllowBatching(); - SimpleURLLoaderThrottle* throttle = - test_helper->simple_url_loader()->GetThrottleForTesting(); - throttle->SetDelegateForTesting( - std::make_unique<FakeSimpleURLLoaderThrottleDelegate>()); - - test_helper->StartSimpleLoader(url_loader_factory_.get()); - - // Destroy the NetworkContext to disconnect the URLLoaderFactory. - network_context_.reset(); - base::RunLoop().RunUntilIdle(); - - throttle->OnReadyToStart(); - test_helper->Wait(); - - EXPECT_EQ(net::ERR_FAILED, test_helper->simple_url_loader()->NetError()); - EXPECT_FALSE(test_helper->simple_url_loader()->CompletionStatus()); - EXPECT_FALSE(test_helper->simple_url_loader()->ResponseInfo()); -} - -TEST_P(SimpleURLLoaderTest, BatchingTimeout) { - constexpr base::TimeDelta kTimeout = base::Microseconds(1); - - std::unique_ptr<network::ResourceRequest> resource_request = - std::make_unique<network::ResourceRequest>(); - resource_request->url = test_server_.GetURL("/echoheader?foo"); - resource_request->headers.SetHeader("foo", kExpectedResponse); - std::unique_ptr<SimpleLoaderTestHelper> test_helper = - CreateHelper(std::move(resource_request)); - - test_helper->simple_url_loader()->SetAllowBatching(); - SimpleURLLoaderThrottle* throttle = - test_helper->simple_url_loader()->GetThrottleForTesting(); - throttle->SetDelegateForTesting( - std::make_unique<FakeSimpleURLLoaderThrottleDelegate>()); - throttle->SetTimeoutForTesting(kTimeout); - - test_helper->StartSimpleLoaderAndWait(url_loader_factory_.get()); - - EXPECT_EQ(net::OK, test_helper->simple_url_loader()->NetError()); - EXPECT_EQ(200, test_helper->GetResponseCode()); - if (GetParam() != SimpleLoaderTestHelper::DownloadType::HEADERS_ONLY) { - EXPECT_TRUE(test_helper->simple_url_loader()->CompletionStatus()); - EXPECT_EQ(kExpectedResponse, *test_helper->response_body()); - } -} - -TEST(SimpleURLLoaderThrottleTest, ShouldThrottle) { - base::test::TaskEnvironment task_environment( - base::test::TaskEnvironment::MainThreadType::IO); - base::test::ScopedPowerMonitorTestSource power_monitor_source; - auto notifier = net::test::MockNetworkChangeNotifier::Create(); - SimpleURLLoaderThrottle throttle = SimpleURLLoaderThrottle(); - - // Device NOT on battery power - power_monitor_source.SetOnBatteryPower(false); - - // Device's DefaultNetwork NOT Active - notifier.get()->ForceNetworkHandlesSupported(); - notifier.get()->SetIsDefaultNetworkActiveInternalForTesting(false); - -// Device's RadioConnectionType is kCell -#if BUILDFLAG(IS_ANDROID) - base::android::RadioUtils::OverrideForTesting radio_utils_test; - radio_utils_test.SetConnectionTypeForTesting( - base::android::RadioConnectionType::kCell); -#endif // BUILDFLAG(IS_ANDROID) - - EXPECT_FALSE(throttle.GetDelegateForTesting().ShouldThrottle()); - power_monitor_source.SetOnBatteryPower(true); - - // Device's DefaultNetwork is active - notifier.get()->SetIsDefaultNetworkActiveInternalForTesting(true); - - EXPECT_FALSE(throttle.GetDelegateForTesting().ShouldThrottle()); - notifier.get()->SetIsDefaultNetworkActiveInternalForTesting(false); - -// Device's connection type is != kCell -#if BUILDFLAG(IS_ANDROID) - radio_utils_test.SetConnectionTypeForTesting( - base::android::RadioConnectionType::kWifi); - - EXPECT_FALSE(throttle.GetDelegateForTesting().ShouldThrottle()); - radio_utils_test.SetConnectionTypeForTesting( - base::android::RadioConnectionType::kCell); -#endif // BUILDFLAG(IS_ANDROID) - - EXPECT_TRUE(throttle.GetDelegateForTesting().ShouldThrottle()); -} - -TEST(SimpleURLLoaderThrottleTest, BatchingDisabled_FeatureDisabled) { - SimpleURLLoaderThrottle::ResetConfigForTesting(); - net::NetworkTrafficAnnotationTag traffic_annotation = - TRAFFIC_ANNOTATION_FOR_TESTS; - - base::test::ScopedFeatureList feature_list; - feature_list.InitAndDisableFeature(features::kBatchSimpleURLLoader); - - ASSERT_FALSE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)); -} - -TEST(SimpleURLLoaderThrottleTest, - BatchingDisabled_TrafficAnnotationIsNotSpecified) { - net::NetworkTrafficAnnotationTag traffic_annotation = - TRAFFIC_ANNOTATION_FOR_TESTS; - - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kBatchSimpleURLLoader); - SimpleURLLoaderThrottle::ResetConfigForTesting(); - - ASSERT_FALSE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)); -} - -TEST(SimpleURLLoaderThrottleTest, BatchingEnabled_OneTrafficAnnotation) { - net::NetworkTrafficAnnotationTag traffic_annotation = - TRAFFIC_ANNOTATION_FOR_TESTS; - - std::string traffic_annotation_hashes = - base::StringPrintf("%d", traffic_annotation.unique_id_hash_code); - - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeatureWithParameters( - features::kBatchSimpleURLLoader, - {{kBatchSimpleURLLoaderEnabledTrafficAnnotationHashesParam, - traffic_annotation_hashes}}); - SimpleURLLoaderThrottle::ResetConfigForTesting(); - - ASSERT_TRUE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation)); -} - -TEST(SimpleURLLoaderThrottleTest, BatchingEnabled_TwoTrafficAnnotations) { - net::NetworkTrafficAnnotationTag traffic_annotation1 = - TRAFFIC_ANNOTATION_FOR_TESTS; - net::NetworkTrafficAnnotationTag traffic_annotation2 = - net::DefineNetworkTrafficAnnotation( - "test2", "Second traffic annotation for tests"); - net::NetworkTrafficAnnotationTag traffic_annotation3 = - net::DefineNetworkTrafficAnnotation("test3", - "Third traffic annotation for tests"); - - std::string traffic_annotation_hashes = - base::StringPrintf("%d,%d", traffic_annotation1.unique_id_hash_code, - traffic_annotation2.unique_id_hash_code); - - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeatureWithParameters( - features::kBatchSimpleURLLoader, - {{kBatchSimpleURLLoaderEnabledTrafficAnnotationHashesParam, - traffic_annotation_hashes}}); - SimpleURLLoaderThrottle::ResetConfigForTesting(); - - ASSERT_TRUE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation1)); - ASSERT_TRUE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation2)); - ASSERT_FALSE(SimpleURLLoaderThrottle::IsBatchingEnabled(traffic_annotation3)); -} - } // namespace } // namespace network
diff --git a/styleguide/c++/checks.md b/styleguide/c++/checks.md index 0a0fb584..3b994b3 100644 --- a/styleguide/c++/checks.md +++ b/styleguide/c++/checks.md
@@ -111,16 +111,27 @@ ## Less fatal options -If an unexpected situation is happening, `base::debug::DumpWithoutCrashing()` -can be used to help debug in production. While this is usually not desirable in -the long term, it can be necessary for investigations. -`base::debug::DumpWithoutCrashing()` generates a crash report, but the code -continues on after, so be sure to handle the situation in a way that doesn't -leave the process in a bad state. +If an unexpected situation is happening, `DUMP_WILL_BE_CHECK()` can be used to +help debug in production. This macro generates a non-fatal crash report if the +condition passed to it does not hold. This macro preserves log-stream parameters +(like CHECK() in a local build), so additional information can be streamed to it +on failure to help debugging. Note that this does not abort on failure so be +sure to handle the situation in a way that doesn't leave the process in a bad +state. -`SCOPED_CRASH_KEY_BOOL()`, `SCOPED_CRASH_KEY_NUMBER()`, etc. are macros in -`base/debug/crash_logging.h` that can be used ahead of -`base::debug::DumpWithoutCrashing()` to add additional data to the crash report. +This macro can also be used to more cautiously add a new `CHECK()`. This may be +used when it's hard to reason about whether a new invariant currently holds +globally, you suspect that a DCHECK is currently firing or you have a small +pre-stable population (iOS for instance). Do not be overly cautious about adding +new CHECKs if you have reasonable pre-stable coverage, or the invariant is +inside a new feature already guarded by a feature flag. + +This macro is only to be used temporarily, so `DUMP_WILL_BE_CHECK()` instances +should always be tagged with a bug like `// TODO(crbug.com/nnnn)`. Use +NextAction date to remember to revisit and clean up this macro (replace with a +`CHECK()`) once sufficiently certain. Instances that are left unattended for too +long may be upgraded as we presumably are not generating enough +invariant-failure reports for a `CHECK()` to be a stability concern here. For failures in tests, GoogleTest macros such as `EXPECT_*`, `ASSERT_*` or `ADD_FAILURE()` are more appropriate than `CHECKing`. For production code:
diff --git a/testing/buildbot/chromium.accessibility.json b/testing/buildbot/chromium.accessibility.json index d9019d3..8a14e3f 100644 --- a/testing/buildbot/chromium.accessibility.json +++ b/testing/buildbot/chromium.accessibility.json
@@ -42,7 +42,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=force-renderer-accessibility" ], "check_flakiness_for_new_tests": false, @@ -54,11 +53,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -79,7 +73,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=force-renderer-accessibility" ], "check_flakiness_for_new_tests": false, @@ -91,11 +84,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.cft.json b/testing/buildbot/chromium.cft.json index 178bd1a..71bdf41b 100644 --- a/testing/buildbot/chromium.cft.json +++ b/testing/buildbot/chromium.cft.json
@@ -1535,7 +1535,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw", "--test-launcher-filter-file=../../testing/buildbot/filters/cft.blink_web_tests.filter" ], @@ -1549,11 +1548,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1749,8 +1743,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1762,11 +1755,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1787,8 +1775,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1800,11 +1787,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1847,7 +1829,6 @@ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -1860,11 +1841,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1885,8 +1861,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1898,11 +1873,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2047,8 +2017,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -2060,11 +2029,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3634,7 +3598,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--test-launcher-filter-file=../../testing/buildbot/filters/cft.blink_web_tests.filter" ], "check_flakiness_for_new_tests": false, @@ -3647,11 +3610,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5781,7 +5739,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64", "--test-launcher-filter-file=../../testing/buildbot/filters/cft.blink_web_tests.filter" @@ -5796,11 +5753,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 1d1fb9e78..c1cc8e1 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5731,9 +5731,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5744,8 +5744,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -5896,9 +5896,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5909,8 +5909,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -6043,9 +6043,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6056,8 +6056,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.clang.json b/testing/buildbot/chromium.clang.json index 36d044a2..24786e37 100644 --- a/testing/buildbot/chromium.clang.json +++ b/testing/buildbot/chromium.clang.json
@@ -9018,7 +9018,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia" ], "check_flakiness_for_new_tests": false, @@ -9030,11 +9029,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -9055,7 +9049,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia" ], "check_flakiness_for_new_tests": false, @@ -9067,11 +9060,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -21346,8 +21334,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -21358,11 +21345,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -21383,8 +21365,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -21395,11 +21376,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24873,8 +24849,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -24885,11 +24860,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24911,8 +24881,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -24923,11 +24892,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index a26bef8..418c0c6 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -24087,7 +24087,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -24100,11 +24099,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24125,7 +24119,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -24138,11 +24131,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24294,8 +24282,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -24307,11 +24294,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24332,8 +24314,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -24345,11 +24326,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24392,7 +24368,6 @@ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -24405,11 +24380,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24430,8 +24400,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -24443,11 +24412,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24569,8 +24533,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -24582,11 +24545,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -24629,8 +24587,7 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -24642,11 +24599,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -25539,9 +25491,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25552,8 +25504,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -25704,9 +25656,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25717,8 +25669,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -25851,9 +25803,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25864,8 +25816,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -29686,8 +29638,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -29699,11 +29650,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.dawn.json b/testing/buildbot/chromium.dawn.json index 5bc5b23a..80278702 100644 --- a/testing/buildbot/chromium.dawn.json +++ b/testing/buildbot/chromium.dawn.json
@@ -396,8 +396,7 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -408,11 +407,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -435,8 +429,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -446,11 +439,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -548,8 +536,7 @@ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -559,11 +546,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -586,8 +568,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -597,11 +578,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -909,8 +885,7 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -921,11 +896,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -948,8 +918,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -959,11 +928,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1060,8 +1024,7 @@ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1071,11 +1034,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1098,8 +1056,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1109,11 +1066,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1420,8 +1372,7 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -1432,11 +1383,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1459,8 +1405,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1470,11 +1415,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1572,8 +1512,7 @@ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1583,11 +1522,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1610,8 +1544,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1621,11 +1554,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1933,8 +1861,7 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -1945,11 +1872,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1972,8 +1894,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -1983,11 +1904,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2084,8 +2000,7 @@ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -2095,11 +2010,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2122,8 +2032,7 @@ "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--no-xvfb", - "--additional-driver-flag=--enable-features=Vulkan", - "--git-revision=${got_revision}" + "--additional-driver-flag=--enable-features=Vulkan" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -2133,11 +2042,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2463,8 +2367,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -2475,11 +2378,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2504,8 +2402,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -2515,11 +2412,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2626,8 +2518,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -2637,11 +2528,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2666,8 +2552,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -2677,11 +2562,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3000,8 +2880,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -3012,11 +2891,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3039,8 +2913,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3050,11 +2923,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3153,8 +3021,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3164,11 +3031,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3191,8 +3053,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3202,11 +3063,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3563,8 +3419,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -3575,11 +3430,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3603,8 +3453,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3614,11 +3463,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3720,8 +3564,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3731,11 +3574,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3759,8 +3597,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -3770,11 +3607,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4104,8 +3936,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -4116,11 +3947,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4145,8 +3971,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4156,11 +3981,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4267,8 +4087,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4278,11 +4097,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4307,8 +4121,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4318,11 +4131,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4641,8 +4449,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -4653,11 +4460,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4680,8 +4482,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4691,11 +4492,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4794,8 +4590,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4805,11 +4600,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4832,8 +4622,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11", - "--git-revision=${got_revision}" + "--platform=mac-mac11" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -4843,11 +4632,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5175,7 +4959,6 @@ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", "--target=Release_x64", - "--git-revision=${got_revision}", "--timeout-ms=48000" ], "check_flakiness_for_new_tests": false, @@ -5187,11 +4970,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5220,8 +4998,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -5231,11 +5008,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5307,8 +5079,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -5318,11 +5089,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5351,8 +5117,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -5362,11 +5127,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5604,8 +5364,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -5616,11 +5375,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5680,8 +5434,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -5691,11 +5444,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -5718,8 +5466,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -5729,11 +5476,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6003,8 +5745,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -6015,11 +5756,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6042,8 +5778,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -6053,11 +5788,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6156,8 +5886,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -6167,11 +5896,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6194,8 +5918,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -6205,11 +5928,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6556,8 +6274,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -6568,11 +6285,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6632,8 +6344,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -6643,11 +6354,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6670,8 +6376,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -6681,11 +6386,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6955,8 +6655,7 @@ "args": [ "--flag-specific=webgpu", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -6967,11 +6666,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6994,8 +6688,7 @@ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7005,11 +6698,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7108,8 +6796,7 @@ "args": [ "--flag-specific=webgpu-swiftshader", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7119,11 +6806,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7146,8 +6828,7 @@ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--target=Release_x64", - "--git-revision=${got_revision}" + "--target=Release_x64" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7157,11 +6838,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7473,8 +7149,7 @@ { "args": [ "--flag-specific=webgpu", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -7485,11 +7160,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7511,8 +7181,7 @@ "args": [ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7522,11 +7191,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7585,8 +7249,7 @@ { "args": [ "--flag-specific=webgpu-swiftshader", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7596,11 +7259,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7622,8 +7280,7 @@ "args": [ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7633,11 +7290,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7906,8 +7558,7 @@ { "args": [ "--flag-specific=webgpu", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -7918,11 +7569,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7944,8 +7590,7 @@ "args": [ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -7955,11 +7600,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8057,8 +7697,7 @@ { "args": [ "--flag-specific=webgpu-swiftshader", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8068,11 +7707,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8094,8 +7728,7 @@ "args": [ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8105,11 +7738,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8455,8 +8083,7 @@ { "args": [ "--flag-specific=webgpu", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -8467,11 +8094,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8493,8 +8115,7 @@ "args": [ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8504,11 +8125,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8567,8 +8183,7 @@ { "args": [ "--flag-specific=webgpu-swiftshader", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8578,11 +8193,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8604,8 +8214,7 @@ "args": [ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8615,11 +8224,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8888,8 +8492,7 @@ { "args": [ "--flag-specific=webgpu", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "check_flakiness_for_new_tests": false, "isolate_name": "webgpu_blink_web_tests", @@ -8900,11 +8503,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8926,8 +8524,7 @@ "args": [ "--flag-specific=webgpu-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -8937,11 +8534,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -9039,8 +8631,7 @@ { "args": [ "--flag-specific=webgpu-swiftshader", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -9050,11 +8641,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -9076,8 +8662,7 @@ "args": [ "--flag-specific=webgpu-swiftshader-with-backend-validation", "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--git-revision=${got_revision}" + "--initialize-webgpu-adapter-at-startup-timeout-ms=60000" ], "isolate_name": "webgpu_blink_web_tests", "merge": { @@ -9087,11 +8672,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.devtools-frontend.json b/testing/buildbot/chromium.devtools-frontend.json index 582b410d..9d7a2cc 100644 --- a/testing/buildbot/chromium.devtools-frontend.json +++ b/testing/buildbot/chromium.devtools-frontend.json
@@ -28,8 +28,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -40,11 +39,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -66,8 +60,7 @@ "--flag-specific=devtools-tab-target", "--num-retries=3", "http/tests/devtools", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -78,11 +71,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests_dt_tab_target", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -102,8 +90,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -114,11 +101,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.fuchsia.json b/testing/buildbot/chromium.fuchsia.json index c0df1841..d52cc7d 100644 --- a/testing/buildbot/chromium.fuchsia.json +++ b/testing/buildbot/chromium.fuchsia.json
@@ -3451,7 +3451,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia", "--jobs=1" ], @@ -3465,11 +3464,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3490,7 +3484,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia", "--jobs=1" ], @@ -3504,11 +3497,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4872,7 +4860,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia", "--jobs=1" ], @@ -4885,11 +4872,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4910,7 +4892,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--platform=fuchsia", "--jobs=1" ], @@ -4923,11 +4904,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index dfb231e..4902a13 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -92,8 +92,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -104,11 +103,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1534,8 +1528,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1546,11 +1539,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1571,8 +1559,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1583,11 +1570,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -39687,7 +39669,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -39699,11 +39680,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -39724,7 +39700,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -39736,11 +39711,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -40478,8 +40448,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -40490,11 +40459,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -40514,8 +40478,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -40526,11 +40489,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -40555,7 +40513,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-driver-flag=--force-browsing-instance-reset-between-tests" ], "check_flakiness_for_new_tests": false, @@ -40567,11 +40524,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -40593,7 +40545,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-driver-flag=--force-browsing-instance-reset-between-tests" ], "check_flakiness_for_new_tests": false, @@ -40605,11 +40556,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -41594,9 +41540,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41606,8 +41552,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -41759,9 +41705,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41771,8 +41717,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -41906,9 +41852,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41918,8 +41864,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -43383,9 +43329,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43395,8 +43341,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -43548,9 +43494,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43560,8 +43506,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -43695,9 +43641,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43707,8 +43653,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -44443,9 +44389,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44455,8 +44401,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -46433,8 +46379,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -46446,11 +46391,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -46472,8 +46412,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -46485,11 +46424,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -46703,8 +46637,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -46716,11 +46649,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -46743,8 +46671,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -46756,11 +46683,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -46806,8 +46728,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -46819,11 +46740,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -46846,8 +46762,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -46859,11 +46774,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -47020,8 +46930,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -47033,11 +46942,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -49245,8 +49149,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -49257,11 +49160,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -49283,8 +49181,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -49295,11 +49192,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -52809,7 +52701,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -52823,11 +52714,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -52851,7 +52737,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -52865,11 +52750,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 4c380a2..b8ad5e3 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -3391,7 +3391,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -3404,11 +3403,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3429,7 +3423,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -3442,11 +3435,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3642,8 +3630,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -3655,11 +3642,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3680,8 +3662,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -3693,11 +3674,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3740,7 +3716,6 @@ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "check_flakiness_for_new_tests": false, @@ -3753,11 +3728,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3778,8 +3748,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -3791,11 +3760,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3940,8 +3904,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -3953,11 +3916,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7174,7 +7132,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -7186,11 +7143,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7211,7 +7163,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -7223,11 +7174,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7310,8 +7256,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -7322,11 +7267,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7580,8 +7520,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -7592,11 +7531,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -7617,7 +7551,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--ignore-tests=external/wpt/html/browsers/browsing-the-web/back-forward-cache/events.html" ], "check_flakiness_for_new_tests": false, @@ -7629,11 +7562,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 81d81cf..f1009bc8 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -1430,8 +1430,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1442,11 +1441,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1467,8 +1461,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1479,11 +1472,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3163,8 +3151,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -3175,11 +3162,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -3200,8 +3182,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -3212,11 +3193,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4904,8 +4880,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -4916,11 +4891,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -4941,8 +4911,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -4953,11 +4922,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6721,8 +6685,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -6734,11 +6697,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6759,8 +6717,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -6772,11 +6729,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8580,8 +8532,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -8593,11 +8544,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -8618,8 +8564,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -8631,11 +8576,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -10357,7 +10297,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -10370,11 +10309,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -10396,7 +10330,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--debug" ], "check_flakiness_for_new_tests": false, @@ -10409,11 +10342,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -22222,8 +22150,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -22234,11 +22161,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -22259,8 +22181,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -22271,11 +22192,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -23958,8 +23874,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "ci_only": true, @@ -23971,11 +23886,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -23996,8 +23906,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "ci_only": true, @@ -24009,11 +23918,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 896e317..47b4fc7 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -11861,7 +11861,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/ASANExpectations", "--timeout-ms", @@ -11877,11 +11876,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -11902,7 +11896,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/ASANExpectations", "--timeout-ms", @@ -11918,11 +11911,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -11950,7 +11938,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/LeakExpectations", "--timeout-ms", @@ -11966,11 +11953,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -11991,7 +11973,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/LeakExpectations", "--timeout-ms", @@ -12007,11 +11988,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -12036,7 +12012,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/MSANExpectations", "--timeout-ms", @@ -12052,11 +12027,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -12080,7 +12050,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--additional-expectations", "../../third_party/blink/web_tests/MSANExpectations", "--timeout-ms", @@ -12096,11 +12065,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -18116,12 +18080,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -18132,8 +18096,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -18301,12 +18265,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -18317,8 +18281,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [ @@ -18463,12 +18427,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 115.0.5759.0", + "description": "Run with ash-chrome version 115.0.5760.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -18479,8 +18443,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v115.0.5759.0", - "revision": "version:115.0.5759.0" + "location": "lacros_version_skew_tests_v115.0.5760.0", + "revision": "version:115.0.5760.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index b38f283..dff2cd8d 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -6,8 +6,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -18,11 +17,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -42,8 +36,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -54,11 +47,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1976,7 +1964,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -1990,11 +1977,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2016,7 +1998,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -2030,11 +2011,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6006,7 +5982,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -6020,11 +5995,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -6046,7 +6016,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -6060,11 +6029,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/client.devtools-frontend.integration.json b/testing/buildbot/client.devtools-frontend.integration.json index f2948983..897a801e 100644 --- a/testing/buildbot/client.devtools-frontend.integration.json +++ b/testing/buildbot/client.devtools-frontend.integration.json
@@ -48,8 +48,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -60,11 +59,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -84,8 +78,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -96,11 +89,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -196,8 +184,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -208,11 +195,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -232,8 +214,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -244,11 +225,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/client.v8.fyi.json b/testing/buildbot/client.v8.fyi.json index 54fa0d28..4982dbe0 100644 --- a/testing/buildbot/client.v8.fyi.json +++ b/testing/buildbot/client.v8.fyi.json
@@ -1588,8 +1588,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1600,11 +1599,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1624,8 +1618,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1636,11 +1629,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1687,7 +1675,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "-t", "Debug", "--release" @@ -1701,11 +1688,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1726,7 +1708,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "-t", "Debug", "--release" @@ -1740,11 +1721,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1791,7 +1767,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=future-js" ], "check_flakiness_for_new_tests": false, @@ -1803,11 +1778,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1828,7 +1798,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=future-js" ], "check_flakiness_for_new_tests": false, @@ -1840,11 +1809,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1891,8 +1855,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1903,11 +1866,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1928,8 +1886,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1940,11 +1897,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1972,8 +1924,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1984,11 +1935,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2008,8 +1954,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -2020,11 +1965,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/internal.chrome.fyi.json b/testing/buildbot/internal.chrome.fyi.json index 55da0b6..43affda7 100644 --- a/testing/buildbot/internal.chrome.fyi.json +++ b/testing/buildbot/internal.chrome.fyi.json
@@ -2340,8 +2340,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -2353,11 +2352,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -2381,8 +2375,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -2394,11 +2387,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 11d72d9..f8f531a 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -1549,7 +1549,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1582,7 +1581,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1613,7 +1611,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1641,7 +1638,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1876,7 +1872,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1904,7 +1899,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -1999,7 +1993,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -2029,7 +2022,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -2057,7 +2049,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -2113,7 +2104,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -2141,7 +2131,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -2734,7 +2723,6 @@ # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', 'webgpu_cts', - 'skia_gold_test', ], }, 'webgpu_blink_web_tests_with_backend_validation': { @@ -2747,7 +2735,6 @@ ], 'mixins': [ 'webgpu_cts', - 'skia_gold_test', ], }, }, @@ -2761,7 +2748,6 @@ ], 'mixins': [ 'webgpu_cts', - 'skia_gold_test', ], }, 'webgpu_swiftshader_blink_web_tests_with_backend_validation': { @@ -2774,7 +2760,6 @@ ], 'mixins': [ 'webgpu_cts', - 'skia_gold_test', ], }, }, @@ -4399,7 +4384,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -4433,7 +4417,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -5290,7 +5273,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True, @@ -5427,7 +5409,6 @@ 'blink_tests_write_run_histories', # TODO(crbug.com/1327314): Enable for blink web tests. 'disable_check_flakiness_web_tests', - 'skia_gold_test', ], 'resultdb': { 'enable': True,
diff --git a/testing/buildbot/tryserver.blink.json b/testing/buildbot/tryserver.blink.json index 99e3104..7c9abce 100644 --- a/testing/buildbot/tryserver.blink.json +++ b/testing/buildbot/tryserver.blink.json
@@ -6,8 +6,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -18,11 +17,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -43,8 +37,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -55,11 +48,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -82,8 +70,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -94,11 +81,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -119,8 +101,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -131,11 +112,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -156,8 +132,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -168,11 +143,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -193,8 +163,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -205,11 +174,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -231,8 +195,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -243,11 +206,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -291,8 +249,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -303,11 +260,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -330,8 +282,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -342,11 +293,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -373,8 +319,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -385,11 +330,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -410,8 +350,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -422,11 +361,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -451,8 +385,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -463,11 +396,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -491,8 +419,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -503,11 +430,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -535,8 +457,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -547,11 +468,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -573,8 +489,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -585,11 +500,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -615,8 +525,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -627,11 +536,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -653,8 +557,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -665,11 +568,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -695,8 +593,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -707,11 +604,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -733,8 +625,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -745,11 +636,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -775,8 +661,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -787,11 +672,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -813,8 +693,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -825,11 +704,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -855,8 +729,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -867,11 +740,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -892,8 +760,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -904,11 +771,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -933,8 +795,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -945,11 +806,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -970,8 +826,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -982,11 +837,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1011,8 +861,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -1023,11 +872,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1048,8 +892,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -1060,11 +903,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1090,7 +928,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -1103,11 +940,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -1129,7 +961,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--target", "Release_x64" ], @@ -1142,11 +973,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/tryserver.chromium.linux.json b/testing/buildbot/tryserver.chromium.linux.json index 1772cc3a..6e4a713 100644 --- a/testing/buildbot/tryserver.chromium.linux.json +++ b/testing/buildbot/tryserver.chromium.linux.json
@@ -10,7 +10,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=enable-editing-ng" ], "check_flakiness_for_new_tests": false, @@ -22,11 +21,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -47,7 +41,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "--flag-specific=enable-editing-ng" ], "check_flakiness_for_new_tests": false, @@ -59,11 +52,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/tryserver.devtools-frontend.json b/testing/buildbot/tryserver.devtools-frontend.json index 0f05121..c6f6724 100644 --- a/testing/buildbot/tryserver.devtools-frontend.json +++ b/testing/buildbot/tryserver.devtools-frontend.json
@@ -29,7 +29,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "http/tests/devtools" ], "check_flakiness_for_new_tests": false, @@ -41,11 +40,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -122,7 +116,6 @@ "args": [ "--num-retries=3", "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}", "http/tests/devtools" ], "check_flakiness_for_new_tests": false, @@ -134,11 +127,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -192,8 +180,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -204,11 +191,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -228,8 +210,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -240,11 +221,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/tryserver.v8.json b/testing/buildbot/tryserver.v8.json index c6eceb0..61cc3222 100644 --- a/testing/buildbot/tryserver.v8.json +++ b/testing/buildbot/tryserver.v8.json
@@ -6,8 +6,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -18,11 +17,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -42,8 +36,7 @@ { "args": [ "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -54,11 +47,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -80,8 +68,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -92,11 +79,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -117,8 +99,7 @@ "--flag-specific=highdpi", "--skipped=always", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -129,11 +110,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "high_dpi_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -154,8 +130,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -166,11 +141,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -191,8 +161,7 @@ "args": [ "--flag-specific=disable-site-isolation-trials", "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -203,11 +172,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "not_site_per_process_blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true }, @@ -229,8 +193,7 @@ "--num-retries=3", "--skipped=always", "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_web_tests", @@ -241,11 +204,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "vulkan_swiftshader_blink_web_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/tryserver.webrtc.json b/testing/buildbot/tryserver.webrtc.json index a7108e3..60f9f9f 100644 --- a/testing/buildbot/tryserver.webrtc.json +++ b/testing/buildbot/tryserver.webrtc.json
@@ -61,8 +61,7 @@ "external/wpt/webrtc-priority", "external/wpt/webrtc-stats", "external/wpt/webrtc-svc", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json", - "--git-revision=${got_revision}" + "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" ], "check_flakiness_for_new_tests": false, "isolate_name": "blink_wpt_tests", @@ -73,11 +72,6 @@ "script": "//third_party/blink/tools/merge_web_test_results.py" }, "name": "blink_wpt_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], "resultdb": { "enable": true },
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index f0e58c2..95384ba 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -22,16 +22,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5759.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v115.0.5760.0/test_ash_chrome', ], - 'description': 'Run with ash-chrome version 115.0.5759.0', + 'description': 'Run with ash-chrome version 115.0.5760.0', 'identifier': 'Lacros version skew testing ash canary', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v115.0.5759.0', - 'revision': 'version:115.0.5759.0', + 'location': 'lacros_version_skew_tests_v115.0.5760.0', + 'revision': 'version:115.0.5760.0', }, ], },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 8d237f5e..5e6a4223 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -9650,6 +9650,22 @@ ] } ], + "PartialLowEndModeOnMidRangeDevices": [ + { + "platforms": [ + "android", + "android_webview" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "PartialLowEndModeOnMidRangeDevices" + ] + } + ] + } + ], "PartitionAllocBackupRefPtr": [ { "platforms": [ @@ -10900,6 +10916,30 @@ ] } ], + "QueueNavigationsWhileWaitingForCommit": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "fuchsia", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "params": { + "level": "avoid-redundant" + }, + "enable_features": [ + "QueueNavigationsWhileWaitingForCommit" + ] + } + ] + } + ], "QuickAnswersForMoreLocales": [ { "platforms": [ @@ -10936,6 +10976,26 @@ ] } ], + "ReadAnything": [ + { + "platforms": [ + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "ReadAnything", + "ReadAnythingWithScreen2x" + ] + } + ] + } + ], "ReadLaterReminderNotification": [ { "platforms": [
diff --git a/third_party/blink/renderer/core/css/css_property_value.h b/third_party/blink/renderer/core/css/css_property_value.h index ebc34b0..9623797 100644 --- a/third_party/blink/renderer/core/css/css_property_value.h +++ b/third_party/blink/renderer/core/css/css_property_value.h
@@ -32,6 +32,8 @@ struct CORE_EXPORT CSSPropertyValueMetadata { DISALLOW_NEW(); + CSSPropertyValueMetadata() = default; + CSSPropertyValueMetadata(const CSSPropertyName&, bool is_set_from_shorthand, int index_in_shorthands_vector,
diff --git a/third_party/blink/renderer/core/css/css_property_value_set.cc b/third_party/blink/renderer/core/css/css_property_value_set.cc index 1279228..47f7df1 100644 --- a/third_party/blink/renderer/core/css/css_property_value_set.cc +++ b/third_party/blink/renderer/core/css/css_property_value_set.cc
@@ -100,6 +100,7 @@ Member<const CSSValue>* value_array = const_cast<Member<const CSSValue>*>(ValueArray()); for (unsigned i = 0; i < array_size_; ++i) { + new (metadata_array + i) CSSPropertyValueMetadata(); metadata_array[i] = properties[i].Metadata(); value_array[i] = properties[i].Value(); }
diff --git a/third_party/blink/renderer/core/editing/selection_template.cc b/third_party/blink/renderer/core/editing/selection_template.cc index 48ee19ce..85de31e 100644 --- a/third_party/blink/renderer/core/editing/selection_template.cc +++ b/third_party/blink/renderer/core/editing/selection_template.cc
@@ -353,7 +353,8 @@ DCHECK(extent.IsNull()) << extent; return SetBaseAndExtent(EphemeralRangeTemplate<Strategy>()); } - DCHECK(extent.IsNotNull()); + // TODO(crbug.com/1423127): `extent` is not expected to be `IsNull` but it + // looks like there are such cases. return Collapse(base).Extend(extent); }
diff --git a/third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc b/third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc index 6e7b55c..5353cdee 100644 --- a/third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc +++ b/third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
@@ -552,26 +552,6 @@ } } -void AnimationFrameTimingMonitor::Will( - const probe::InvokeCallback& probe_data) { - // Callbacks can be recursive. We only want the top-level one. We need to - // keep track of the depth so that we report only when the top-levle one is - // done. - user_callback_depth_++; - if (pending_script_info_) { - return; - } - - if (!probe_data.context->IsWindow() || - !client_.ShouldReportLongAnimationFrameTiming()) { - return; - } - pending_script_info_ = - PendingScriptInfo{.type = ScriptTimingInfo::Type::kUserCallback, - .start_time = probe_data.CaptureStartTime(), - .execution_start_time = probe_data.CaptureStartTime()}; -} - namespace { ScriptTimingInfo::ScriptSourceLocation CaptureScriptSourceLocation( @@ -587,12 +567,12 @@ } v8::Local<v8::Value> bound = value.As<v8::Function>()->GetBoundFunction(); - if (bound.IsEmpty() || !bound->IsFunction()) { - return ScriptTimingInfo::ScriptSourceLocation(); + if (!bound.IsEmpty() && bound->IsFunction()) { + value = bound; } if (std::unique_ptr<SourceLocation> location = - CaptureSourceLocation(bound.As<v8::Function>())) { + CaptureSourceLocation(value.As<v8::Function>())) { return ScriptTimingInfo::ScriptSourceLocation{ location->Url(), location->Function(), location->LineNumber(), location->ColumnNumber()}; @@ -603,6 +583,32 @@ } // namespace +void AnimationFrameTimingMonitor::Will( + const probe::InvokeCallback& probe_data) { + // Callbacks can be recursive. We only want the top-level one. We need to + // keep track of the depth so that we report only when the top-levle one is + // done. + user_callback_depth_++; + if (pending_script_info_) { + return; + } + + if (!probe_data.context->IsWindow() || + !client_.ShouldReportLongAnimationFrameTiming()) { + return; + } + + pending_script_info_ = + PendingScriptInfo{.type = ScriptTimingInfo::Type::kUserCallback, + .start_time = probe_data.CaptureStartTime(), + .execution_start_time = probe_data.CaptureStartTime()}; + v8::HandleScope handle_scope(probe_data.context->GetIsolate()); + + pending_script_info_->source_location = CaptureScriptSourceLocation( + probe_data.callback ? probe_data.callback->CallbackObject() + : probe_data.function); +} + void AnimationFrameTimingMonitor::Did(const probe::InvokeCallback& probe_data) { user_callback_depth_--; if (user_callback_depth_) { @@ -615,13 +621,6 @@ } info->SetPropertyLikeName(probe_data.name); - v8::HandleScope handle_scope(probe_data.context->GetIsolate()); - if (probe_data.callback) { - info->SetSourceLocation( - CaptureScriptSourceLocation(probe_data.callback->CallbackObject())); - } else { - info->SetSourceLocation(CaptureScriptSourceLocation(probe_data.function)); - } } void AnimationFrameTimingMonitor::Will(
diff --git a/third_party/blink/renderer/core/script/modulator_impl_base.cc b/third_party/blink/renderer/core/script/modulator_impl_base.cc index 08dcd251..c47bfe7 100644 --- a/third_party/blink/renderer/core/script/modulator_impl_base.cc +++ b/third_party/blink/renderer/core/script/modulator_impl_base.cc
@@ -132,7 +132,7 @@ // Output the resolution log. This is too verbose to be always shown, but // will be helpful for Web developers (and also Chromium developers) for // debugging import maps. - LOG(INFO) << import_map_debug_message; + VLOG(1) << import_map_debug_message; if (mapped_url) { KURL url = *mapped_url;
diff --git a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc index fb17f5a..cb2ec9ac 100644 --- a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc +++ b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.cc
@@ -241,12 +241,14 @@ return std::make_unique<media::OpenH264VideoEncoder>(); })); #endif // BUILDFLAG(RTC_USE_H264) +#if BUILDFLAG(ENABLE_LIBVPX) case CodecId::kVp8: case CodecId::kVp9: return ConvertToBaseRepeatingCallback(WTF::CrossThreadBindRepeating( []() -> std::unique_ptr<media::VideoEncoder> { return std::make_unique<media::VpxVideoEncoder>(); })); +#endif #if BUILDFLAG(ENABLE_LIBAOM) case CodecId::kAv1: return ConvertToBaseRepeatingCallback(WTF::CrossThreadBindRepeating(
diff --git a/third_party/blink/renderer/platform/fonts/font.cc b/third_party/blink/renderer/platform/fonts/font.cc index 3e18ab2d..93dfe1c 100644 --- a/third_party/blink/renderer/platform/fonts/font.cc +++ b/third_party/blink/renderer/platform/fonts/font.cc
@@ -286,7 +286,6 @@ run.Direction()); TextRun run_with_override = run_info.run; run_with_override.SetText(text_with_override); - run_with_override.SetCharactersLength(text_with_override.length()); run_with_override.SetDirectionalOverride(false); return DrawBidiText(canvas, TextRunPaintInfo(run_with_override), point, custom_font_not_ready_action, flags, draw_type); @@ -588,27 +587,6 @@ return mark_font_data->GetFontMetrics().Height(); } -CharacterRange Font::GetCharacterRange(const TextRun& run, - unsigned from, - unsigned to) const { - FontCachePurgePreventer purge_preventer; - CachingWordShaper shaper(*this); - return shaper.GetCharacterRange(run, from, to); -} - -Vector<CharacterRange> Font::IndividualCharacterRanges( - const TextRun& run) const { - FontCachePurgePreventer purge_preventer; - CachingWordShaper shaper(*this); - auto ranges = shaper.IndividualCharacterRanges(run); - // The shaper should return ranges.size == run.length but on some platforms - // (OSX10.9.5) we are seeing cases in the upper end of the unicode range - // where this is not true (see: crbug.com/620952). To catch these cases on - // more popular platforms, and to protect users, we are using a CHECK here. - CHECK_EQ(ranges.size(), run.length()); - return ranges; -} - Vector<double> Font::IndividualCharacterAdvances(const TextRun& run) const { FontCachePurgePreventer purge_preventer; CachingWordShaper shaper(*this);
diff --git a/third_party/blink/renderer/platform/fonts/font.h b/third_party/blink/renderer/platform/fonts/font.h index c4bfa5fe..ef67c1f 100644 --- a/third_party/blink/renderer/platform/fonts/font.h +++ b/third_party/blink/renderer/platform/fonts/font.h
@@ -54,7 +54,6 @@ namespace blink { class NGShapeCache; -struct CharacterRange; class FontSelector; class ShapeCache; class TextRun; @@ -156,10 +155,6 @@ float height, int from = 0, int to = -1) const; - CharacterRange GetCharacterRange(const TextRun&, - unsigned from, - unsigned to) const; - Vector<CharacterRange> IndividualCharacterRanges(const TextRun&) const; // Returns a vector of same size as TextRun.length() with advances measured // in pixels from the left bounding box of the full TextRun to the left bound
diff --git a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shape_iterator.h b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shape_iterator.h index c0ad46b..9ecbc55 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shape_iterator.h +++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shape_iterator.h
@@ -55,9 +55,7 @@ // fall back on shaping the entire run. shape_by_word_ = font_->CanShapeWordByWord(); - // SVG sets SpacingDisabled because it handles spacing by themselves. - if (!run.SpacingDisabled()) - spacing_.SetSpacingAndExpansion(font->GetFontDescription()); + spacing_.SetSpacingAndExpansion(font->GetFontDescription()); } CachingWordShapeIterator(const CachingWordShapeIterator&) = delete; CachingWordShapeIterator& operator=(const CachingWordShapeIterator&) = delete;
diff --git a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc index 94ac84e6..8a4c72f 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc
@@ -119,19 +119,6 @@ total_width, from, to); } -Vector<CharacterRange> CachingWordShaper::IndividualCharacterRanges( - const TextRun& run) { - ShapeResultBuffer buffer; - float total_width = ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); - auto ranges = buffer.IndividualCharacterRanges(run.Direction(), total_width); - // The shaper can fail to return glyph metrics for all characters (see - // crbug.com/613915 and crbug.com/615661) so add empty ranges to ensure all - // characters have an associated range. - while (ranges.size() < static_cast<unsigned>(run.length())) - ranges.push_back(CharacterRange(0, 0, 0, 0)); - return ranges; -} - Vector<double> CachingWordShaper::IndividualCharacterAdvances( const TextRun& run) { ShapeResultBuffer buffer;
diff --git a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h index 9ed0cf6d..699dc14 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h +++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h
@@ -58,7 +58,6 @@ void FillResultBuffer(const TextRunPaintInfo&, ShapeResultBuffer*); CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); - Vector<CharacterRange> IndividualCharacterRanges(const TextRun&); Vector<double> IndividualCharacterAdvances(const TextRun&); Vector<ShapeResult::RunFontData> GetRunFontData(const TextRun&) const;
diff --git a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc index 706a6413..72f2aeb0 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc
@@ -125,16 +125,6 @@ return CharacterRange(to_x, from_x, -min_y, max_y); } -Vector<CharacterRange> ShapeResultBuffer::IndividualCharacterRanges( - TextDirection direction, - float total_width) const { - Vector<CharacterRange> ranges; - float current_x = direction == TextDirection::kRtl ? total_width : 0; - for (const scoped_refptr<const ShapeResult>& result : results_) - current_x = result->IndividualCharacterRanges(&ranges, current_x); - return ranges; -} - void ShapeResultBuffer::AddRunInfoAdvances(const ShapeResult::RunInfo& run_info, double offset, Vector<double>& advances) {
diff --git a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h index 4736b0b..2a5cd12d 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h +++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h
@@ -43,8 +43,6 @@ float total_width, unsigned from, unsigned to) const; - Vector<CharacterRange> IndividualCharacterRanges(TextDirection, - float total_width) const; Vector<double> IndividualCharacterAdvances(const StringView&, TextDirection, float total_width) const;
diff --git a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc index 16ff233..52547bb 100644 --- a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc +++ b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h" +#include "base/debug/alias.h" #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" #include "base/numerics/safe_conversions.h" @@ -181,7 +182,9 @@ } void BufferingBytesConsumer::OnStateChange() { + base::debug::Alias(&client_); BytesConsumer::Client* client = client_; + base::debug::Alias(&client); BufferData(); if (client) client->OnStateChange();
diff --git a/third_party/blink/renderer/platform/text/text_run.cc b/third_party/blink/renderer/platform/text/text_run.cc index f372a49..9cfa991 100644 --- a/third_party/blink/renderer/platform/text/text_run.cc +++ b/third_party/blink/renderer/platform/text/text_run.cc
@@ -35,8 +35,8 @@ struct SameSizeAsTextRun { DISALLOW_NEW(); const void* pointer; - int integers[2]; - uint32_t bitfields : 7; + int integer; + uint32_t bitfields : 6; }; ASSERT_SIZE(TextRun, SameSizeAsTextRun);
diff --git a/third_party/blink/renderer/platform/text/text_run.h b/third_party/blink/renderer/platform/text/text_run.h index 37db341..8aa151b51 100644 --- a/third_party/blink/renderer/platform/text/text_run.h +++ b/third_party/blink/renderer/platform/text/text_run.h
@@ -46,12 +46,10 @@ unsigned len, TextDirection direction = TextDirection::kLtr, bool directional_override = false) - : characters_length_(len), - len_(len), + : len_(len), is_8bit_(true), direction_(static_cast<unsigned>(direction)), directional_override_(directional_override), - disable_spacing_(false), normalize_space_(false) { data_.characters8 = c; } @@ -60,12 +58,10 @@ unsigned len, TextDirection direction = TextDirection::kLtr, bool directional_override = false) - : characters_length_(len), - len_(len), + : len_(len), is_8bit_(false), direction_(static_cast<unsigned>(direction)), directional_override_(directional_override), - disable_spacing_(false), normalize_space_(false) { data_.characters16 = c; } @@ -73,13 +69,11 @@ TextRun(const StringView& string, TextDirection direction = TextDirection::kLtr, bool directional_override = false) - : characters_length_(string.length()), - len_(string.length()), + : len_(string.length()), direction_(static_cast<unsigned>(direction)), directional_override_(directional_override), - disable_spacing_(false), normalize_space_(false) { - if (!characters_length_) { + if (!len_) { is_8bit_ = true; data_.characters8 = nullptr; } else if (string.Is8Bit()) { @@ -169,7 +163,6 @@ bool Is8Bit() const { return is_8bit_; } unsigned length() const { return len_; } - unsigned CharactersLength() const { return characters_length_; } bool NormalizeSpace() const { return normalize_space_; } void SetNormalizeSpace(bool normalize_space) { @@ -187,9 +180,6 @@ is_8bit_ = false; } void SetText(const String&); - void SetCharactersLength(unsigned characters_length) { - characters_length_ = characters_length; - } TextDirection Direction() const { return static_cast<TextDirection>(direction_); @@ -197,9 +187,6 @@ bool Rtl() const { return Direction() == TextDirection::kRtl; } bool Ltr() const { return Direction() == TextDirection::kLtr; } bool DirectionalOverride() const { return directional_override_; } - bool SpacingDisabled() const { return disable_spacing_; } - - void DisableSpacing() { disable_spacing_ = true; } void SetDirection(TextDirection direction) { direction_ = static_cast<unsigned>(direction); } @@ -219,15 +206,12 @@ const UChar* characters16; const void* bytes_; } data_; - // Marks the end of the characters buffer. Default equals to m_len. - unsigned characters_length_; unsigned len_; unsigned is_8bit_ : 1; unsigned direction_ : 1; // Was this direction set by an override character. unsigned directional_override_ : 1; - unsigned disable_spacing_ : 1; unsigned text_justify_ : 2; unsigned normalize_space_ : 1; };
diff --git a/third_party/blink/tools/BUILD.gn b/third_party/blink/tools/BUILD.gn index cb7b879..7a982fd 100644 --- a/third_party/blink/tools/BUILD.gn +++ b/third_party/blink/tools/BUILD.gn
@@ -15,9 +15,6 @@ # Include blinkpy tools for uploading results to ResultDB. "//third_party/blink/tools/blinkpy/", - # Imported by some code in blinkpy. - "//build/skia_gold_common/", - # The web_tests/external directory contains manifest file and public WPTs. "//third_party/blink/web_tests/external/",
diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py index 8dc1e76..e3da73c 100644 --- a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py +++ b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
@@ -36,8 +36,6 @@ _log = logging.getLogger(__name__) -SKIA_GOLD_CORPUS = 'blink-web-tests' - def run_single_test(port, options, results_directory, worker_name, driver, test_input): @@ -610,34 +608,6 @@ if not driver_output.image or not driver_output.image_hash: return [] - # Do a dry run upload to Skia Gold, ignoring any of its output, for - # data collection to see if we can switch to using Gold for web tests - # in the future. - # This is currently not run since other options besides Gold are being - # investigated and this code can make local runs slow, see - # crbug.com/1394307. - # try: - # gold_keys = self._port.skia_gold_json_keys() - # gold_session = ( - # self._port.skia_gold_session_manager().GetSkiaGoldSession( - # gold_keys, corpus=SKIA_GOLD_CORPUS)) - # gold_properties = self._port.skia_gold_properties() - # use_luci = not gold_properties.local_pixel_tests - # img_path = self._filesystem.join( - # str(self._port.skia_gold_temp_dir()), - # '%s.png' % self._test_name.replace('/', '_')) - # self._filesystem.write_binary_file(img_path, driver_output.image) - # status, error = gold_session.RunComparison(name=self._test_name, - # png_file=img_path, - # use_luci=use_luci) - # _log.debug('Ran Skia Gold dry run, got status %s and error %s', - # status, error) - # except Exception as e: - # _log.warning( - # 'Got exception while dry running Skia Gold. This can be ' - # 'safely ignored unless you are actively working with Gold: %s', - # e) - if driver_output.image_hash != expected_driver_output.image_hash: max_channel_diff, max_pixels_diff = self._port.get_wpt_fuzzy_metadata( self._test_name)
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py index 0f06ebe..0479b06d 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py
@@ -70,9 +70,6 @@ from blinkpy.web_tests.servers import apache_http from blinkpy.web_tests.servers import pywebsocket from blinkpy.web_tests.servers import wptserve -from blinkpy.web_tests.skia_gold import blink_skia_gold_session_manager as sgsm - -from skia_gold_common import skia_gold_properties as sgp _log = logging.getLogger(__name__) @@ -288,15 +285,6 @@ self._virtual_test_suites = None self._used_expectation_files = None - self._skia_gold_temp_dir = None - self._skia_gold_session_manager = None - self._skia_gold_properties = None - - def __del__(self): - if self._skia_gold_temp_dir: - self._filesystem.rmtree(self._skia_gold_temp_dir, - ignore_errors=True) - def __str__(self): return 'Port{name=%s, version=%s, architecture=%s, test_configuration=%s}' % ( self._name, self._version, self._architecture, @@ -423,30 +411,6 @@ return 2 * timeout_ms return timeout_ms - def skia_gold_temp_dir(self): - return self._skia_gold_temp_dir - - def skia_gold_properties(self): - if not self._skia_gold_properties: - self._skia_gold_properties = sgp.SkiaGoldProperties(self._options) - return self._skia_gold_properties - - def skia_gold_session_manager(self): - if not self._skia_gold_session_manager: - self._skia_gold_temp_dir = self._filesystem.mkdtemp() - self._skia_gold_session_manager = sgsm.BlinkSkiaGoldSessionManager( - str(self._skia_gold_temp_dir), self.skia_gold_properties()) - return self._skia_gold_session_manager - - def skia_gold_json_keys(self): - return { - 'configuration': self._options.configuration.lower(), - 'version': self._version, - 'port': self.port_name, - 'architecture': self._architecture, - 'ignore': '1', - } - @memoized def _build_args_gn_content(self): args_gn_file = self._build_path('args.gn')
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base_unittest.py b/third_party/blink/tools/blinkpy/web_tests/port/base_unittest.py index 591d820..fc9eb2ba 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base_unittest.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base_unittest.py
@@ -1863,24 +1863,6 @@ finally: port.host.filesystem.chdir(original_dir) - def test_skia_gold_properties_initialization(self): - # The Gold code usually assumes that argparse is used, not optparse, so - # ensure that it still works with optparse here. - port = self.make_port() - expected_revision = 'a' * 40 - expected_issue = '1234' - expected_patchset = '1' - expected_id = 'bbid' - port._options.git_revision = expected_revision - port._options.gerrit_issue = expected_issue - port._options.gerrit_patchset = expected_patchset - port._options.buildbucket_id = expected_id - properties = port.skia_gold_properties() - self.assertEqual(properties.git_revision, expected_revision) - self.assertEqual(properties.issue, expected_issue) - self.assertEqual(properties.patchset, expected_patchset) - self.assertEqual(properties.job_id, expected_id) - class NaturalCompareTest(unittest.TestCase): def setUp(self):
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_web_tests.py b/third_party/blink/tools/blinkpy/web_tests/run_web_tests.py index d0b9fad7..c461418 100644 --- a/third_party/blink/tools/blinkpy/web_tests/run_web_tests.py +++ b/third_party/blink/tools/blinkpy/web_tests/run_web_tests.py
@@ -615,27 +615,6 @@ 'Default is 1 second, can be overriden for specific use cases.' )), optparse.make_option( - '--git-revision', - help=( - 'The Chromium git revision being tested. This is only used ' - 'for an experimental Skia Gold dryrun.')), - optparse.make_option( - '--gerrit-issue', - help=( - 'The Gerrit issue/CL number being tested, if applicable. ' - 'This is only used for an experimental Skia Gold dryrun.' - )), - optparse.make_option( - '--gerrit-patchset', - help=( - 'The Gerrit patchset being tested, if applicable. This is ' - 'only used for an experimental Skia Gold dryrun.')), - optparse.make_option( - '--buildbucket-id', - help=( - 'The Buildbucket ID of the bot running the test. This is ' - 'only used for an experimental Skia Gold dryrun.')), - optparse.make_option( '--ignore-testharness-expected-txt', action='store_true', help=('Ignore *-expected.txt for all testharness tests. All '
diff --git a/third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py b/third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py index c523eca9..24517d1 100644 --- a/third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py +++ b/third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py
@@ -105,6 +105,7 @@ # TODO(509038): To be removed after bluetooth tests are ported to WPT. '-c', 'Alias /resources/chromium "%s/external/wpt/resources/chromium"' % test_dir, '-c', 'Alias /resources/testharness.js "%s/resources/testharness.js"' % test_dir, + '-c', 'Alias /resources/testharness-helpers.js "%s/resources/testharness-helpers.js"' % test_dir, '-c', 'Alias /resources/testharnessreport.js "%s/resources/testharnessreport.js"' % test_dir, '-c', 'Alias /resources/testdriver.js "%s/resources/testdriver.js"' % test_dir, '-c', 'Alias /resources/testdriver-vendor.js "%s/resources/testdriver-vendor.js"' % test_dir,
diff --git a/third_party/blink/tools/blinkpy/web_tests/skia_gold/__init__.py b/third_party/blink/tools/blinkpy/web_tests/skia_gold/__init__.py deleted file mode 100644 index 70e4c04..0000000 --- a/third_party/blink/tools/blinkpy/web_tests/skia_gold/__init__.py +++ /dev/null
@@ -1,13 +0,0 @@ -# Copyright 2022 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import sys - -from blinkpy.common import path_finder - -BUILD_DIR = os.path.join(path_finder.get_chromium_src_dir(), 'build') - -if BUILD_DIR not in sys.path: - sys.path.append(BUILD_DIR)
diff --git a/third_party/blink/tools/blinkpy/web_tests/skia_gold/blink_skia_gold_session_manager.py b/third_party/blink/tools/blinkpy/web_tests/skia_gold/blink_skia_gold_session_manager.py deleted file mode 100644 index 8f92c19..0000000 --- a/third_party/blink/tools/blinkpy/web_tests/skia_gold/blink_skia_gold_session_manager.py +++ /dev/null
@@ -1,13 +0,0 @@ -# Copyright 2021 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -"""Blink impl of //build/skia_gold_common/skia_gold_session_manager.py""" - -from skia_gold_common import output_managerless_skia_gold_session as omsgs -from skia_gold_common import skia_gold_session_manager as sgsm - - -class BlinkSkiaGoldSessionManager(sgsm.SkiaGoldSessionManager): - @staticmethod - def GetSessionClass(): - return omsgs.OutputManagerlessSkiaGoldSession \ No newline at end of file
diff --git a/third_party/blink/web_tests/FlagSpecificConfig b/third_party/blink/web_tests/FlagSpecificConfig index 0feba4f0..1d73bf47 100644 --- a/third_party/blink/web_tests/FlagSpecificConfig +++ b/third_party/blink/web_tests/FlagSpecificConfig
@@ -50,7 +50,7 @@ "name": "webgpu", "args": [ "--enable-unsafe-webgpu", - "--disable-dawn-features=disallow_unsafe_apis", + "--enable-dawn-features=allow_unsafe_apis", "--enable-webgpu-developer-features", "--use-gpu-in-tests", "--enable-accelerated-2d-canvas", @@ -59,7 +59,7 @@ "comments": [ "--enable-unsafe-webgpu makes sure WebGPU is enabled even if it", "isn't launched in stable on that configuration yet", - "--disable-dawn-features=disallow_unsafe_apis is added so 'unsafe'", + "--enable-dawn-features=allow_unsafe_apis is added so 'unsafe'", "APIs can be tested with WebGPU CTS", "--enable-webgpu-developer-features exposes extra WebGPU API", "features useful for testing but not generally available.", @@ -77,7 +77,7 @@ "args": [ "--enable-unsafe-webgpu", "--use-webgpu-adapter=swiftshader", - "--disable-dawn-features=disallow_unsafe_apis", + "--enable-dawn-features=allow_unsafe_apis", "--enable-webgpu-developer-features", "--use-gpu-in-tests", "--enable-accelerated-2d-canvas" @@ -85,7 +85,7 @@ "comments": [ "--enable-unsafe-webgpu makes sure WebGPU is enabled even if it", "isn't launched in stable on that configuration yet", - "--disable-dawn-features=disallow_unsafe_apis is added so 'unsafe'", + "--enable-dawn-features=allow_unsafe_apis is added so 'unsafe'", "APIs can be tested with WebGPU CTS", "--enable-webgpu-developer-features exposes extra WebGPU API", "features useful for testing but not generally available.", @@ -103,7 +103,7 @@ "--enable-unsafe-webgpu", "--use-webgpu-adapter=swiftshader", "--enable-dawn-backend-validation", - "--disable-dawn-features=disallow_unsafe_apis", + "--enable-dawn-features=allow_unsafe_apis", "--enable-webgpu-developer-features", "--use-gpu-in-tests", "--enable-accelerated-2d-canvas" @@ -111,7 +111,7 @@ "comments": [ "--enable-unsafe-webgpu makes sure WebGPU is enabled even if it", "isn't launched in stable on that configuration yet", - "--disable-dawn-features=disallow_unsafe_apis is added so 'unsafe'", + "--enable-dawn-features=allow_unsafe_apis is added so 'unsafe'", "APIs can be tested with WebGPU CTS", "--enable-webgpu-developer-features exposes extra WebGPU API", "features useful for testing but not generally available.", @@ -128,7 +128,7 @@ "args": [ "--enable-unsafe-webgpu", "--enable-dawn-backend-validation", - "--disable-dawn-features=disallow_unsafe_apis", + "--enable-dawn-features=allow_unsafe_apis", "--enable-webgpu-developer-features", "--use-gpu-in-tests", "--enable-accelerated-2d-canvas", @@ -137,7 +137,7 @@ "comments": [ "--enable-unsafe-webgpu makes sure WebGPU is enabled even if it", "isn't launched in stable on that configuration yet", - "--disable-dawn-features=disallow_unsafe_apis is added so 'unsafe'", + "--enable-dawn-features=allow_unsafe_apis is added so 'unsafe'", "APIs can be tested with WebGPU CTS", "--enable-webgpu-developer-features exposes extra WebGPU API", "features useful for testing but not generally available.", @@ -155,7 +155,7 @@ "args": [ "--enable-unsafe-webgpu", "--enable-dawn-backend-validation=partial", - "--disable-dawn-features=disallow_unsafe_apis", + "--enable-dawn-features=allow_unsafe_apis", "--enable-webgpu-developer-features", "--use-gpu-in-tests", "--enable-accelerated-2d-canvas", @@ -164,7 +164,7 @@ "comments": [ "--enable-unsafe-webgpu makes sure WebGPU is enabled even if it", "isn't launched in stable on that configuration yet", - "--disable-dawn-features=disallow_unsafe_apis is added so 'unsafe'", + "--enable-dawn-features=allow_unsafe_apis is added so 'unsafe'", "APIs can be tested with WebGPU CTS", "--enable-webgpu-developer-features exposes extra WebGPU API", "features useful for testing but not generally available.",
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index b14f23e9..e7fa6ef 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -6799,3 +6799,7 @@ # Sheriff 2023-05-04 crbug.com/1434164 http/tests/streams/chromium/transferable-streams-optimization.html [ Crash Failure Pass ] + +# TODO(crbug.com/1443872): Re-enable this test +crbug.com/1443872 [ Fuchsia ] editing/selection/4402375.html [ Failure ] +crbug.com/1443872 [ Fuchsia ] paint/invalidation/selection/selection-in-composited-scrolling-container.html [ Failure ]
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location-bound.html b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location-bound.html deleted file mode 100644 index 8e801910..0000000 --- a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location-bound.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE HTML> -<meta charset=utf-8> -<title>Long Animation Frame Timing: source location extraction</title> -<meta name="timeout" content="long"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/utils.js"></script> - -<body> -<h1>Long Animation Frame: source location extraction</h1> -<div id="log"></div> -<script> - -promise_test(async t => { - const [entry, script] = await expect_long_frame_with_script(() => { - const object = {}; - requestAnimationFrame((function my_bound_function() { - busy_wait(); - }).bind(object)); - }, script => script.name === "FrameRequestCallback", t); - assert_true(script.sourceLocation.startsWith("my_bound_function")); -}, "Source location should be extracted from bound functions"); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location.html b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location.html new file mode 100644 index 0000000..ffda000 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-source-location.html
@@ -0,0 +1,43 @@ +<!DOCTYPE HTML> +<meta charset=utf-8> +<title>Long Animation Frame Timing: source location extraction</title> +<meta name="timeout" content="long"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/utils.js"></script> + +<body> +<h1>Long Animation Frame: source location extraction</h1> +<div id="log"></div> +<script> + +promise_test(async t => { + const [entry, script] = await expect_long_frame_with_script(() => { + requestAnimationFrame(function non_bound_function() { + busy_wait(); + }); + }, script => script.name === "FrameRequestCallback", t); + assert_true(script.sourceLocation?.startsWith("non_bound_function")); +}, "Source location should be extracted from non-bound functions"); + +promise_test(async t => { + const [entry, script] = await expect_long_frame_with_script(() => { + const object = {}; + requestAnimationFrame((function my_bound_function() { + busy_wait(); + }).bind(object)); + }, script => script.name === "FrameRequestCallback", t); + assert_true(script.sourceLocation?.startsWith("my_bound_function")); +}, "Source location should be extracted from bound functions"); + +promise_test(async t => { + const [entry, script] = await expect_long_frame_with_script(() => { + t.step_timeout(function my_timeout() { + busy_wait(); + }); + }, script => script.name === "TimerHandler:setTimeout" && script.sourceLocation, t ); + assert_true(script.sourceLocation.includes("testharness.js")); +}, "Source location should be extracted for setTimeout"); + +</script> +</body>
diff --git a/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-params.html b/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-params.html new file mode 100644 index 0000000..e22173d --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-params.html
@@ -0,0 +1,9 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings_lite.js"></script> +<script src="/gen/content/test/data/lite_js_test.mojom-lite.js"></script> +<script src="/gen/content/web_test/common/mojo_echo.mojom-lite.js"></script> +<script src="/gen/content/web_test/common/mojo_optional_numerics_unittest.mojom-lite.js"></script> +<script src="../resources/classic-test-helper.js"></script> +<script src="../shared/optional-numerics-params.js"></script>
diff --git a/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-response-params.html b/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-response-params.html new file mode 100644 index 0000000..953db34 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/lite/optional-numerics-response-params.html
@@ -0,0 +1,9 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings_lite.js"></script> +<script src="/gen/content/test/data/lite_js_test.mojom-lite.js"></script> +<script src="/gen/content/web_test/common/mojo_echo.mojom-lite.js"></script> +<script src="/gen/content/web_test/common/mojo_optional_numerics_unittest.mojom-lite.js"></script> +<script src="../resources/classic-test-helper.js"></script> +<script src="../shared/optional-numerics-response-params.js"></script>
diff --git a/third_party/blink/web_tests/http/tests/mojo/optional-numerics-params.html b/third_party/blink/web_tests/http/tests/mojo/optional-numerics-params.html new file mode 100644 index 0000000..7c6e93f --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/optional-numerics-params.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script type="module"> +import "./resources/module-test-helper.js"; +import "./shared/optional-numerics-params.js"; +</script>
diff --git a/third_party/blink/web_tests/http/tests/mojo/optional-numerics-response-params.html b/third_party/blink/web_tests/http/tests/mojo/optional-numerics-response-params.html new file mode 100644 index 0000000..1fe5383 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/optional-numerics-response-params.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script type="module"> +import "./resources/module-test-helper.js"; +import "./shared/optional-numerics-response-params.js"; +</script>
diff --git a/third_party/blink/web_tests/http/tests/mojo/resources/classic-test-helper.js b/third_party/blink/web_tests/http/tests/mojo/resources/classic-test-helper.js index 3d03d78..716a1d5 100644 --- a/third_party/blink/web_tests/http/tests/mojo/resources/classic-test-helper.js +++ b/third_party/blink/web_tests/http/tests/mojo/resources/classic-test-helper.js
@@ -2,11 +2,31 @@ // bindings-tests.js script to be used for both various types of tests. See // README.md for more information. -globalThis.TestMessageTargetReceiver = liteJsTest.mojom.TestMessageTargetReceiver; -globalThis.TestMessageTarget_NestedEnum = liteJsTest.mojom.TestMessageTarget_NestedEnum; -globalThis.TestMessageTarget = liteJsTest.mojom.TestMessageTarget; -globalThis.TestMessageTargetCallbackRouter = liteJsTest.mojom.TestMessageTargetCallbackRouter; -globalThis.SubinterfaceCallbackRouter = liteJsTest.mojom.SubinterfaceCallbackRouter; -globalThis.SubinterfaceRemote = liteJsTest.mojom.SubinterfaceRemote; -globalThis.SubinterfaceClientCallbackRouter = liteJsTest.mojom.SubinterfaceClientCallbackRouter; -globalThis.MojoEchoRemote = content.mojom.MojoEchoRemote; +if (typeof liteJsTest?.mojom !== 'undefined') { + globalThis.TestMessageTargetReceiver = liteJsTest.mojom.TestMessageTargetReceiver; + globalThis.TestMessageTarget_NestedEnum = liteJsTest.mojom.TestMessageTarget_NestedEnum; + globalThis.TestMessageTarget = liteJsTest.mojom.TestMessageTarget; + globalThis.TestMessageTargetCallbackRouter = liteJsTest.mojom.TestMessageTargetCallbackRouter; + globalThis.SubinterfaceCallbackRouter = liteJsTest.mojom.SubinterfaceCallbackRouter; + globalThis.SubinterfaceRemote = liteJsTest.mojom.SubinterfaceRemote; + globalThis.SubinterfaceClientCallbackRouter = liteJsTest.mojom.SubinterfaceClientCallbackRouter; +} + +if (typeof content?.mojom?.MojoEchoRemote !== 'undefined') { + globalThis.MojoEchoRemote = content.mojom.MojoEchoRemote; +} + +if (typeof content?.optionalNumericsUnittest !== 'undefined') { + Object.assign(globalThis, { + OptionalNumericsParamsRemote: + content.optionalNumericsUnittest.mojom.ParamsRemote, + OptionalNumericsParamsReceiver: + content.optionalNumericsUnittest.mojom.ParamsReceiver, + OptionalNumericsResponseParamsRemote: + content.optionalNumericsUnittest.mojom.ResponseParamsRemote, + OptionalNumericsResponseParamsReceiver: + content.optionalNumericsUnittest.mojom.ResponseParamsReceiver, + OptionalNumericsRegularEnum: + content.optionalNumericsUnittest.mojom.RegularEnum, + }); +}
diff --git a/third_party/blink/web_tests/http/tests/mojo/resources/module-test-helper.js b/third_party/blink/web_tests/http/tests/mojo/resources/module-test-helper.js index ef1545c..c13421f 100644 --- a/third_party/blink/web_tests/http/tests/mojo/resources/module-test-helper.js +++ b/third_party/blink/web_tests/http/tests/mojo/resources/module-test-helper.js
@@ -6,6 +6,14 @@ import {MojoEchoRemote} from "/gen/content/web_test/common/mojo_echo.mojom.m.js" +import { + ParamsRemote as OptionalNumericsParamsRemote, + ParamsReceiver as OptionalNumericsParamsReceiver, + ResponseParamsRemote as OptionalNumericsResponseParamsRemote, + ResponseParamsReceiver as OptionalNumericsResponseParamsReceiver, + RegularEnum as OptionalNumericsRegularEnum, +} from "/gen/content/web_test/common/mojo_optional_numerics_unittest.mojom.m.js" + globalThis.TestMessageTargetReceiver = TestMessageTargetReceiver; globalThis.TestMessageTarget_NestedEnum = TestMessageTarget_NestedEnum; globalThis.TestMessageTarget = TestMessageTarget; @@ -15,3 +23,12 @@ globalThis.SubinterfaceClientCallbackRouter = SubinterfaceClientCallbackRouter; globalThis.MojoEchoRemote = MojoEchoRemote; + +Object.assign(globalThis, { + OptionalNumericsParamsRemote: OptionalNumericsParamsRemote, + OptionalNumericsParamsReceiver: OptionalNumericsParamsReceiver, + OptionalNumericsResponseParamsRemote: OptionalNumericsResponseParamsRemote, + OptionalNumericsResponseParamsReceiver: + OptionalNumericsResponseParamsReceiver, + OptionalNumericsRegularEnum: OptionalNumericsRegularEnum, +});
diff --git a/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-params.js b/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-params.js new file mode 100644 index 0000000..9c82b18e --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-params.js
@@ -0,0 +1,357 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +// This file tests that JS can correctly encode optional numerics (by binding +// to an interface implemented in C++) and that JS can correctly decode optional +// numerics params (by binding to a interface implemented in JS). +// +// These tests can be imported as a module or added as a script to tests lite +// bindings. + +class ParamsJsImpl { + constructor() { + const sendNullMethods = [ + 'sendNullBool', + 'sendNullUint8', + 'sendNullInt8', + 'sendNullUint16', + 'sendNullInt16', + 'sendNullUint32', + 'sendNullInt32', + 'sendNullUint64', + 'sendNullInt64', + 'sendNullFloat', + 'sendNullDouble', + 'sendNullEnum', + ]; + for (const method of sendNullMethods) { + this[method] = this.sendNull; + } + + const sendOptionalMethods = [ + 'sendOptionalBool', + 'sendOptionalUint8', + 'sendOptionalInt8', + 'sendOptionalUint16', + 'sendOptionalInt16', + 'sendOptionalUint32', + 'sendOptionalInt32', + 'sendOptionalUint64', + 'sendOptionalInt64', + 'sendOptionalFloat', + 'sendOptionalDouble', + 'sendOptionalEnum', + ]; + for (const method of sendOptionalMethods) { + this[method] = this.sendOptional; + } + + this.receiver = new OptionalNumericsParamsReceiver(this); + } + + async sendNull(value) { + assert_equals(value, null); + } + + async sendOptional(value) { + return {value: value}; + } + + async sendNullStructWithOptionalNumerics(s) { + assert_equals(s, null); + } + + async sendStructWithNullOptionalNumerics(s) { + assert_equals(s.optionalBool, null); + assert_equals(s.optionalUint8, null); + assert_equals(s.optionalInt8, null); + assert_equals(s.optionalUint16, null); + assert_equals(s.optionalInt16, null); + assert_equals(s.optionalUint32, null); + assert_equals(s.optionalInt32, null); + assert_equals(s.optionalUint64, null); + assert_equals(s.optionalInt64, null); + assert_equals(s.optionalFloat, null); + assert_equals(s.optionalDouble, null); + assert_equals(s.optionalEnum, null); + } + + async sendStructWithOptionalNumerics(s) { + return { + optionalBool: s.optionalBool, + optionalUint8: s.optionalUint8, + optionalInt8: s.optionalInt8, + optionalUint16: s.optionalUint16, + optionalInt16: s.optionalInt16, + optionalUint32: s.optionalUint32, + optionalInt32: s.optionalInt32, + optionalUint64: s.optionalUint64, + optionalInt64: s.optionalInt64, + optionalFloat: s.optionalFloat, + optionalDouble: s.optionalDouble, + optionalEnum: s.optionalEnum, + }; + } +} + +const cpp = new OptionalNumericsParamsRemote(); +cpp.$.bindNewPipeAndPassReceiver().bindInBrowser('process'); + +const jsImpl = new ParamsJsImpl(); +const js = jsImpl.receiver.$.bindNewPipeAndPassRemote(); + +function assert_empty_response(response) { + assert_equals(Object.keys(response).length, 0); +}; + +const testNullMethods = [{ + method: 'sendNullBool', + numericalType: 'bool' +}, { + method: 'sendNullUint8', + numericalType: 'uint8' +}, { + method: 'sendNullInt8', + numericalType: 'int8' +}, { + method: 'sendNullUint16', + numericalType: 'uint16' +}, { + method: 'sendNullInt16', + numericalType: 'int16' +}, { + method: 'sendNullUint32', + numericalType: 'uint32' +}, { + method: 'sendNullInt32', + numericalType: 'int32' +}, { + method: 'sendNullUint64', + numericalType: 'uint64' +}, { + method: 'sendNullInt64', + numericalType: 'int64' +}, { + method: 'sendNullFloat', + numericalType: 'float' +}, { + method: 'sendNullDouble', + numericalType: 'double' +}, { + method: 'sendNullEnum', + numericalType: 'enum' +}]; + +for (const {method, numericalType} of testNullMethods) { + promise_test(async () => { + assert_empty_response(await cpp[method]()); + assert_empty_response(await cpp[method](null)); + assert_empty_response(await cpp[method](undefined)); + }, `JS encoding and C++ decoding of null ${numericalType}.`); + + promise_test(async () => { + assert_empty_response(await js[method]()); + assert_empty_response(await js[method](null)); + assert_empty_response(await js[method](undefined)); + }, `JS decoding of null ${numericalType} param.`); +} + +promise_test(async () => { + assert_empty_response(await cpp.sendNullStructWithOptionalNumerics(null)); +}, `JS encoding and C++ decoding of null struct with optional numerics.`); + +promise_test(async () => { + assert_empty_response(await js.sendNullStructWithOptionalNumerics(null)); +}, `JS decoding of null struct with optional numerics.`); + +function assert_value_equals(response, expectedValue) { + assert_equals(response.value, expectedValue); +} + +const testMethods = [{ + method: 'sendOptionalBool', + valueToUse: true, + numericalType: 'bool', +}, { + method: 'sendOptionalUint8', + valueToUse: 8, + numericalType: 'uint8', +}, { + method: 'sendOptionalInt8', + valueToUse: -8, + numericalType: 'int8', +}, { + method: 'sendOptionalUint16', + valueToUse: 16, + numericalType: 'uint16', +}, { + method: 'sendOptionalInt16', + valueToUse: -16, + numericalType: 'int16', +}, { + method: 'sendOptionalUint32', + valueToUse: 32, + numericalType: 'uint32', +}, { + method: 'sendOptionalInt32', + valueToUse: -32, + numericalType: 'int32', +}, { + method: 'sendOptionalUint64', + valueToUse: BigInt("64"), + numericalType: 'uint64', +}, { + method: 'sendOptionalInt64', + valueToUse: BigInt("-64"), + numericalType: 'int64', +}, { + method: 'sendOptionalFloat', + valueToUse: -0.5, + numericalType: 'float', +}, { + method: 'sendOptionalDouble', + valueToUse: 0.25, + numericalType: 'double', +}, { + method: 'sendOptionalEnum', + valueToUse: OptionalNumericsRegularEnum.kBar, + numericalType: 'enum', +}]; + +for (const {method, valueToUse, numericalType} of testMethods) { + promise_test(async () => { + assert_value_equals(await cpp[method](valueToUse), valueToUse); + }, `JS encoding and C++ decoding of optional ${numericalType}.`); + + promise_test(async () => { + assert_value_equals(await cpp[method](valueToUse), valueToUse); + }, `JS decoding of optional ${numericalType} params.`); +} + +const structFields = [ + 'optionalBool', + 'optionalUint8', + 'optionalInt8', + 'optionalUint16', + 'optionalInt16', + 'optionalUint32', + 'optionalInt32', + 'optionalUint64', + 'optionalInt64', + 'optionalFloat', + 'optionalDouble', + 'optionalEnum', +]; + +promise_test(async () => { + assert_empty_response(await cpp.sendStructWithNullOptionalNumerics({})); + + const structWithNullFields = {}; + const structWithUndefinedFields = {}; + for (const field of structFields) { + structWithNullFields[field] = null; + structWithUndefinedFields[field] = undefined; + } + + assert_empty_response(await cpp.sendStructWithNullOptionalNumerics( + structWithNullFields)); + assert_empty_response(await cpp.sendStructWithNullOptionalNumerics( + structWithUndefinedFields)); + +}, 'JS encoding and C++ decoding of struct with null optional numerics.'); + +promise_test(async () => { + assert_empty_response(await cpp.sendStructWithNullOptionalNumerics({})); + + const structWithNullFields = {}; + const structWithUndefinedFields = {}; + for (const field of structFields) { + structWithNullFields[field] = null; + structWithUndefinedFields[field] = undefined; + } + + assert_empty_response(await js.sendStructWithNullOptionalNumerics( + structWithNullFields)); + assert_empty_response(await js.sendStructWithNullOptionalNumerics( + structWithUndefinedFields)); + +}, 'JS decoding of struct param with null optional numerics.'); + +const testStructFields = [{ + name: 'optionalBool', + value: true, + responseArgName: 'boolValue' + }, { + name: 'optionalUint8', + value: 8, + responseArgName: 'uint8Value' + }, { + name: 'optionalInt8', + value: -8, + responseArgName: 'int8Value' + }, { + name: 'optionalUint16', + value: 16, + responseArgName: 'uint16Value' + }, { + name: 'optionalInt16', + value: -16, + responseArgName: 'int16Value' + }, { + name: 'optionalUint32', + value: 32, + responseArgName: 'uint32Value' + }, { + name: 'optionalInt32', + value: -32, + responseArgName: 'int32Value' + }, { + name: 'optionalUint64', + value: BigInt("64"), + responseArgName: 'uint64Value' + }, { + name: 'optionalInt64', + value: BigInt("-64"), + responseArgName: 'int64Value' + }, { + name: 'optionalFloat', + value: -0.5, + responseArgName: 'floatValue' + }, { + name: 'optionalDouble', + value: 0.25, + responseArgName: 'doubleValue' + }, { + name: 'optionalEnum', + value: OptionalNumericsRegularEnum.kFoo, + responseArgName: 'enumValue' +}]; + +promise_test(async () => { + const testStruct = {}; + for (const {name, value} of testStructFields) { + testStruct[name] = value; + } + + const response = await cpp.sendStructWithOptionalNumerics(testStruct); + + for (const {name, value, responseArgName} of testStructFields) { + assert_equals(response[responseArgName], value, `${name}:`); + } +}, 'JS encoding and C++ decoding of struct with optional numerics.'); + +promise_test(async () => { + const testStruct = {}; + for (const {name, value} of testStructFields) { + testStruct[name] = value; + } + + const response = await cpp.sendStructWithOptionalNumerics(testStruct); + + for (const {name, value, responseArgName} of testStructFields) { + assert_equals(response[responseArgName], value, `${name}:`); + } +}, 'JS decoding of struct param with optional numerics.');
diff --git a/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-response-params.js b/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-response-params.js new file mode 100644 index 0000000..d293a42 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/shared/optional-numerics-response-params.js
@@ -0,0 +1,461 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +// This file tests that JS can correctly decode optional numerics response +// params (by binding to an interface implemented in C++) and that JS can +// correctly encode optional numerics response params (by binding to a interface +// implemented in JS). +// +// These tests can be imported as a module or added as a script to tests lite +// bindings. + +class ResponseParamsJsImpl { + constructor() { + const nullMethods = [ + 'getNullBool', + 'getNullUint8', + 'getNullInt8', + 'getNullUint16', + 'getNullInt16', + 'getNullUint32', + 'getNullInt32', + 'getNullUint64', + 'getNullInt64', + 'getNullFloat', + 'getNullDouble', + 'getNullEnum', + ]; + for (const method of nullMethods) { + this[method] = this.getNullOptional; + } + + const methods = [ + 'getOptionalBool', + 'getOptionalUint8', + 'getOptionalInt8', + 'getOptionalUint16', + 'getOptionalInt16', + 'getOptionalUint32', + 'getOptionalInt32', + 'getOptionalUint64', + 'getOptionalInt64', + 'getOptionalFloat', + 'getOptionalDouble', + 'getOptionalEnum', + ]; + for (const method of methods) { + this[method] = this.getOptional; + } + + this.receiver = new OptionalNumericsResponseParamsReceiver(this); + } + + async getOptional(value) { + return {optionalValue: value}; + } + + async getNullOptional() { + if (typeof this.nullType_ === 'undefined') { + throw new Error('setNullForNextResponse should be called first.'); + } + + const response = {}; + switch (this.nullType_) { + case 'undefined': + response.optionalValue = undefined; + break; + case 'null': + response.optionalValue = null; + break; + case 'empty': + break; + } + + delete this.nullType_; + return response; + } + + // nullType can be `undefined`, `null`, or `empty` and they correspond to + // what we use as a response for null values. + setNullForNextResponse(nullType) { + assert_true(nullType === 'undefined' || + nullType === 'null' || + nullType === 'empty'); + this.nullType_ = nullType; + } + + async getNullStructWithOptionalNumerics() { + let response = {}; + switch (this.nullType_) { + case 'undefined': + response.s = undefined; + break; + case 'null': + response.s = null; + break; + case 'empty': + break; + } + + delete this.nullType_; + return response; + } + + async getStructWithNullOptionalNumerics() { + if (typeof this.nullType_ === 'undefined') { + throw new Error('setNullForNextResponse should be called first.'); + } + + const structFields = [ + 'optionalBool', + 'optionalUint8', + 'optionalInt8', + 'optionalUint16', + 'optionalInt16', + 'optionalUint32', + 'optionalInt32', + 'optionalUint64', + 'optionalInt64', + 'optionalFloat', + 'optionalDouble', + 'optionalEnum', + ]; + + let s = {}; + switch (this.nullType_) { + case 'undefined': + for (const field of structFields) { + s[field] = undefined; + } + break; + case 'null': + for (const field of structFields) { + s[field] = null; + } + break; + case 'empty': + break; + } + + delete this.nullType_; + return {s}; + } + + async getStructWithOptionalNumerics( + boolValue, + uint8Value, + int8Value, + uint16Value, + int16Value, + uint32Value, + int32Value, + uint64Value, + int64Value, + floatValue, + doubleValue, + enumValue) { + const struct = { + optionalBool: boolValue, + optionalUint8: uint8Value, + optionalInt8: int8Value, + optionalUint16: uint16Value, + optionalInt16: int16Value, + optionalUint32: uint32Value, + optionalInt32: int32Value, + optionalUint64: uint64Value, + optionalInt64: int64Value, + optionalFloat: floatValue, + optionalDouble: doubleValue, + optionalEnum: enumValue, + }; + + return { + s: struct + }; + } +}; + +const cpp = new OptionalNumericsResponseParamsRemote(); +cpp.$.bindNewPipeAndPassReceiver().bindInBrowser('process'); + +const jsImpl = new ResponseParamsJsImpl(); +const js = jsImpl.receiver.$.bindNewPipeAndPassRemote(); + +const testGetNullMethods = [{ + method: 'getNullBool', + numericType: 'bool', +}, { + method: 'getNullUint8', + numericType: 'uint8', +}, { + method: 'getNullInt8', + numericType: 'int8', +}, { + method: 'getNullUint16', + numericType: 'uint16', +}, { + method: 'getNullInt16', + numericType: 'int16', +}, { + method: 'getNullUint32', + numericType: 'uint32', +}, { + method: 'getNullInt32', + numericType: 'int32', +}, { + method: 'getNullUint64', + numericType: 'uint64', +}, { + method: 'getNullInt64', + numericType: 'int64', +}, { + method: 'getNullFloat', + numericType: 'float', +}, { + method: 'getNullDouble', + numericType: 'double', +}, { + method: 'getNullEnum', + numericType: 'enum', +}]; + +for (const {method, responseArgName, numericType} of testGetNullMethods) { + promise_test(async () => { + const response = await cpp[method](); + assert_true('optionalValue' in response); + assert_equals(response.optionalValue, null); + }, `C++ encoding and JS decoding of null ${numericType} response param.`); + + promise_test(async () => { + { + jsImpl.setNullForNextResponse('null'); + const response = await js[method](); + assert_true('optionalValue' in response); + assert_equals(response.optionalValue, null); + } + { + jsImpl.setNullForNextResponse('undefined'); + const response = await js[method](); + assert_true('optionalValue' in response); + assert_equals(response.optionalValue, null); + } + { + jsImpl.setNullForNextResponse('empty'); + const response = await js[method](); + assert_true('optionalValue' in response); + assert_equals(response.optionalValue, null); + } + }, `JS decoding of null ${numericType} response param.`); +} + +promise_test(async () => { + const response = await cpp.getNullStructWithOptionalNumerics(); + assert_true('s' in response); + assert_equals(response.s, null); +}, 'C++ encoding and JS decoding of null struct with optional numerics ' + + 'in response param.'); + +promise_test(async () => { + { + jsImpl.setNullForNextResponse('null'); + const response = await js.getNullStructWithOptionalNumerics(); + assert_true('s' in response); + assert_equals(response.s, null); + } + { + jsImpl.setNullForNextResponse('undefined'); + const response = await js.getNullStructWithOptionalNumerics(); + assert_true('s' in response); + assert_equals(response.s, null); + } + { + jsImpl.setNullForNextResponse('empty'); + const response = await js.getNullStructWithOptionalNumerics(); + assert_true('s' in response); + assert_equals(response.s, null); + } +}, 'JS decoding of null struct with optional numerics.'); + +const testMethods = [{ + method: 'getOptionalBool', + valueToUse: true, + numericType: 'bool', +}, { + method: 'getOptionalUint8', + valueToUse: 8, + numericType: 'uint8', +}, { + method: 'getOptionalInt8', + valueToUse: -8, + numericType: 'int8', +}, { + method: 'getOptionalUint16', + valueToUse: 16, + numericType: 'uint16', +}, { + method: 'getOptionalInt16', + valueToUse: -16, + numericType: 'int16', +}, { + method: 'getOptionalUint32', + valueToUse: 32, + numericType: 'uint32', +}, { + method: 'getOptionalInt32', + valueToUse: -32, + numericType: 'int32', +}, { + method: 'getOptionalUint64', + valueToUse: BigInt('64'), + numericType: 'uint64', +}, { + method: 'getOptionalInt64', + valueToUse: BigInt('-64'), + numericType: 'int64', +}, { + method: 'getOptionalFloat', + valueToUse: -0.5, + numericType: 'float', +}, { + method: 'getOptionalDouble', + valueToUse: 0.25, + numericType: 'double', +}, { + method: 'getOptionalEnum', + valueToUse: OptionalNumericsRegularEnum.kBar, + numericType: 'enum', +}]; + +for (const {method, valueToUse, numericType} of testMethods) { + promise_test(async () => { + const {optionalValue} = await cpp[method](valueToUse); + assert_equals(optionalValue, valueToUse); + }, `C++ encoding and JS decoding of optional ${numericType} response param.`); + + promise_test(async () => { + const {optionalValue} = await js[method](valueToUse); + assert_equals(optionalValue, valueToUse); + }, `JS encoding and decoding of ${numericType} response param.`); +} + +const structFields = [ + 'optionalBool', + 'optionalUint8', + 'optionalInt8', + 'optionalUint16', + 'optionalInt16', + 'optionalUint32', + 'optionalInt32', + 'optionalUint64', + 'optionalInt64', + 'optionalFloat', + 'optionalDouble', + 'optionalEnum', +]; + +promise_test(async () => { + const {s} = await cpp.getStructWithNullOptionalNumerics(); + for (const field of structFields) { + assert_true(field in s); + assert_equals(s[field], null); + } +}, 'C++ encoding and JS decoding of struct with null optional numerics ' + + 'in response params.'); + +promise_test(async () => { + { + jsImpl.setNullForNextResponse('empty'); + const {s} = await js.getStructWithNullOptionalNumerics(); + for (const field of structFields) { + assert_true(field in s); + assert_equals(s[field], null); + } + } + { + jsImpl.setNullForNextResponse('undefined'); + const {s} = await js.getStructWithNullOptionalNumerics(); + for (const field of structFields) { + assert_true(field in s); + assert_equals(s[field], null); + } + } + { + jsImpl.setNullForNextResponse('null'); + const {s} = await js.getStructWithNullOptionalNumerics(); + for (const field of structFields) { + assert_true(field in s); + assert_equals(s[field], null); + } + } +}, 'JS encoding and decoding of struct with null optional numerics in ' + + 'response params.'); + +const testStructFields = [{ + name: 'optionalBool', + value: true, + }, { + name: 'optionalUint8', + value: 8, + }, { + name: 'optionalInt8', + value: -8, + }, { + name: 'optionalUint16', + value: 16, + }, { + name: 'optionalInt16', + value: -16, + }, { + name: 'optionalUint32', + value: 32, + }, { + name: 'optionalInt32', + value: -32, + }, { + name: 'optionalUint64', + value: BigInt("64"), + }, { + name: 'optionalInt64', + value: BigInt("-64"), + }, { + name: 'optionalFloat', + value: -0.5, + }, { + name: 'optionalDouble', + value: 0.25, + }, { + name: 'optionalEnum', + value: OptionalNumericsRegularEnum.kFoo, +}]; + +promise_test(async () => { + const args = testStructFields.map((field) => { + return field.value; + }); + + const {s} = await cpp.getStructWithOptionalNumerics(...args); + assert_equals(Object.keys(s).length, testStructFields.length); + + for (const field of testStructFields) { + assert_true(field.name in s, field.name); + assert_equals(s[field.name], field.value, field.name); + } +}, 'C++ encoding and JS decoding of struct with optional numerics in ' + + 'response params.'); + +promise_test(async () => { + const args = testStructFields.map((field) => { + return field.value; + }); + + const {s} = await js.getStructWithOptionalNumerics(...args); + assert_equals(Object.keys(s).length, testStructFields.length); + + for (const field of testStructFields) { + assert_true(field.name in s, field.name); + assert_equals(s[field.name], field.value, field.name); + } +}, 'JS encoding of struct with optional numerics in response params.');
diff --git a/third_party/blink/web_tests/http/tests/mojo/versioned-optional-numerics.html b/third_party/blink/web_tests/http/tests/mojo/versioned-optional-numerics.html new file mode 100644 index 0000000..ee3b3c2e --- /dev/null +++ b/third_party/blink/web_tests/http/tests/mojo/versioned-optional-numerics.html
@@ -0,0 +1,142 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharness-helpers.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script type="module"> +import { + InterfaceV2Remote, + InterfaceV2Receiver, + RegularEnum, +} from "/gen/content/web_test/common/mojo_optional_numerics_unittest.mojom.m.js" + +class InterfaceV2Impl { + constructor() { + this.receiver = new InterfaceV2Receiver(this); + } + + async methodWithVersionedParams( + boolValue, + uint8Value, + int8Value, + uint16Value, + int16Value, + uint32Value, + int32Value, + uint64Value, + int64Value, + floatValue, + doubleValue, + enumValue, + ) { + return { + boolValue: boolValue === null ? null : !boolValue, + uint8Value: uint8Value === null ? null : uint8Value * 2, + int8Value: int8Value === null ? null : int8Value * 2, + uint16Value: uint16Value === null ? null : uint16Value * 2, + int16Value: int16Value === null ? null : int16Value * 2, + uint32Value: uint32Value === null ? null : uint32Value * 2, + int32Value: int32Value === null ? null : int32Value * 2, + uint64Value: uint64Value === null ? null : uint64Value * BigInt('2'), + int64Value: int64Value === null ? null : int64Value * BigInt('2'), + floatValue: floatValue === null ? null : floatValue * 3, + doubleValue: doubleValue === null ? null : doubleValue * 3, + enumValue: enumValue === null ? null : enumValue - 1, + }; + } +} + +const impl = new InterfaceV2Impl; +const remote = impl.receiver.$.bindNewPipeAndPassRemote(); + +promise_test(async () => { + const nullArgs = { + boolValue: null, + uint8Value: null, + int8Value: null, + uint16Value: null, + int16Value: null, + uint32Value: null, + int32Value: null, + uint64Value: null, + int64Value: null, + floatValue: null, + doubleValue: null, + enumValue: null, + }; + + const expectedResponse = { + boolValue: null, + uint8Value: null, + int8Value: null, + uint16Value: null, + int16Value: null, + uint32Value: null, + int32Value: null, + uint64Value: null, + int64Value: null, + floatValue: null, + doubleValue: null, + enumValue: null, + }; + + const nullArgsResponse = + await remote.methodWithVersionedParams(...Object.values(nullArgs)); + assert_weak_equals(nullArgsResponse, expectedResponse); + + const undefinedArgs = { + boolValue: undefined, + uint8Value: undefined, + int8Value: undefined, + uint16Value: undefined, + int16Value: undefined, + uint32Value: undefined, + int32Value: undefined, + uint64Value: undefined, + int64Value: undefined, + floatValue: undefined, + doubleValue: undefined, + enumValue: undefined, + }; + + const undefinedArgsResponse = + await remote.methodWithVersionedParams(...Object.values(undefinedArgs)); + assert_weak_equals(undefinedArgsResponse, expectedResponse); +}, 'Basic test for sending/receiving null numerics in versioned ' + + 'interfaces.'); + +promise_test(async () => { + const args = { + boolValue: true, + uint8Value: 8, + int8Value: -8, + uint16Value: 16, + int16Value: -16, + uint32Value: 32, + int32Value: -32, + uint64Value: BigInt('64'), + int64Value: BigInt('-64'), + floatValue: -0.5, + doubleValue: 0.25, + enumValue: RegularEnum.kBar, + }; + const expectedResponse = { + boolValue: !args.boolValue, + uint8Value: 16, + int8Value: -16, + uint16Value: 32, + int16Value: -32, + uint32Value: 64, + int32Value: -64, + uint64Value: BigInt('128'), + int64Value: BigInt('-128'), + floatValue: -1.5, + doubleValue: 0.75, + enumValue: RegularEnum.kFoo, + }; + + const response = + await remote.methodWithVersionedParams(...Object.values(args)); + assert_weak_equals(response, expectedResponse); +}, 'Basic test for sending/receiving optional numerics in versioned ' + + 'interfaces.'); +</script>
diff --git a/third_party/closure_compiler/externs/file_manager_private.js b/third_party/closure_compiler/externs/file_manager_private.js index 6f7c792..c229815 100644 --- a/third_party/closure_compiler/externs/file_manager_private.js +++ b/third_party/closure_compiler/externs/file_manager_private.js
@@ -1748,6 +1748,12 @@ chrome.fileManagerPrivate.getBulkPinProgress = function(callback) {}; /** + * Starts calculating the space required to pin all the items in a users My + * drive. + */ +chrome.fileManagerPrivate.calculateBulkPinRequiredSpace = function() {}; + +/** * @type {!ChromeEvent} */ chrome.fileManagerPrivate.onMountCompleted;
diff --git a/third_party/freetype/README.chromium b/third_party/freetype/README.chromium index 363491c3..b89ced14d 100644 --- a/third_party/freetype/README.chromium +++ b/third_party/freetype/README.chromium
@@ -1,7 +1,7 @@ Name: FreeType URL: http://www.freetype.org/ -Version: VER-2-13-0-97-g8fe50c2ad -Revision: 8fe50c2adca74a4eca1501c831251283b4cc6d9b +Version: VER-2-13-0-128-ge02a40a4f +Revision: e02a40a4f8754774c8dccc01aeb0f07ea58e81c7 CPEPrefix: cpe:/a:freetype:freetype:2.12.1 License: Custom license "inspired by the BSD, Artistic, and IJG (Independent JPEG Group) licenses"
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 2a9b7f8b..bbb4b22 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -36064,6 +36064,7 @@ <int value="1783" label="FILEMANAGERPRIVATE_GETBULKPINPROGRESS"/> <int value="1784" label="ENTERPRISE_REMOTEAPPS_SETPINNEDAPPS"/> <int value="1785" label="SMARTCARDPROVIDERPRIVATE_REPORTDATARESULT"/> + <int value="1786" label="FILEMANAGERPRIVATE_CALCULATEBULKPINREQUIREDSPACE"/> </enum> <enum name="ExtensionIconState"> @@ -60895,6 +60896,7 @@ <int value="-832154680" label="AutofillEnforceDelaysInStrikeDatabase:enabled"/> <int value="-831066457" label="IncognitoBrandConsistencyForDesktop:disabled"/> + <int value="-829665817" label="AltClickAndSixPackCustomization:enabled"/> <int value="-829498062" label="HttpsFirstModeV2:disabled"/> <int value="-826010284" label="EnterpriseReportingUI:disabled"/> <int value="-825942229" label="tab-management-experiment-type-elderberry"/> @@ -61696,6 +61698,7 @@ <int value="-390624541" label="RestrictedApiOrigins:disabled"/> <int value="-389664522" label="OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRefOnInteraction:enabled"/> + <int value="-389601101" label="HelpAppAutoTriggerInstallDialog:enabled"/> <int value="-389283574" label="IPH_PasswordsAccountStorage:disabled"/> <int value="-387606010" label="ArcBootCompletedBroadcast:enabled"/> <int value="-387217874" label="LinkCapturingInfoBar:enabled"/> @@ -61998,6 +62001,7 @@ <int value="-231642350" label="EnableWindowsGamingInputDataFetcher:disabled"/> <int value="-231426350" label="AutofillEnableToolbarStatusChip:enabled"/> <int value="-230824955" label="NTPMostLikelyFaviconsFromServer:enabled"/> + <int value="-229995076" label="AltClickAndSixPackCustomization:disabled"/> <int value="-226826278" label="ForceEnableFastCheckoutCapabilities:disabled"/> <int value="-226715863" label="SHA1ServerSignature:enabled"/> <int value="-225505731" label="CCTModule:enabled"/> @@ -65740,6 +65744,7 @@ <int value="1800375282" label="UseDMSAAForTiles:disabled"/> <int value="1800509458" label="DriveFsChromeNetworking:disabled"/> <int value="1800603694" label="DXGIWaitableSwapChain:disabled"/> + <int value="1801297618" label="HelpAppAutoTriggerInstallDialog:disabled"/> <int value="1801585504" label="ContextMenuShopWithGoogleLens:enabled"/> <int value="1802821192" label="VCBackgroundReplace:disabled"/> <int value="1802874714" label="QueryTilesEnableQueryEditing:disabled"/>
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index b18eb801e..1adb629e 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -166,7 +166,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.Clicked" - enum="AdaptiveToolbarButtonVariant" expires_after="2023-09-03"> + enum="AdaptiveToolbarButtonVariant" expires_after="2023-11-05"> <owner>bttk@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -176,7 +176,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.SessionVariant" - enum="AdaptiveToolbarButtonVariant" expires_after="2023-09-03"> + enum="AdaptiveToolbarButtonVariant" expires_after="2023-11-05"> <owner>bttk@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -560,7 +560,7 @@ </histogram> <histogram name="Android.BackPress.Intercept" enum="BackPressConsumer" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>lazzzis@chromium.org</owner> <owner>src/chrome/browser/back_press/android/OWNERS</owner> <summary> @@ -569,7 +569,7 @@ </histogram> <histogram name="Android.BackPress.MinimizeAppAndCloseTab" - enum="MinimizeAppAndCloseTabType" expires_after="2023-09-03"> + enum="MinimizeAppAndCloseTabType" expires_after="2023-11-05"> <owner>lazzzis@chromium.org</owner> <owner>src/chrome/browser/back_press/android/OWNERS</owner> <summary> @@ -3169,7 +3169,7 @@ </histogram> <histogram name="Android.SelectFileDialogContentSelected" - enum="SelectFileDialogContent" expires_after="2023-08-27"> + enum="SelectFileDialogContent" expires_after="2023-11-05"> <owner>finnur@chromium.org</owner> <owner>peter@chromium.org</owner> <summary> @@ -3181,7 +3181,7 @@ </histogram> <histogram name="Android.SelectFileDialogImgCount" units="images" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>finnur@chromium.org</owner> <owner>peter@chromium.org</owner> <summary> @@ -3193,7 +3193,7 @@ </histogram> <histogram name="Android.SelectFileDialogScope" enum="SelectFileDialogScope" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>peter@chromium.org</owner> <owner>finnur@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index 5061069..53f961d 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -2904,7 +2904,7 @@ </histogram> <histogram name="Apps.StateTransition.AnimationSmoothness" units="%" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>tbarzic@chromium.org</owner> <owner>newcomer@chromium.org</owner> <owner>src/ash/app_list/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index 4cee0b2..97c85437 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -269,7 +269,7 @@ </summary> </histogram> -<histogram name="Arc.AndroidBootTime" units="ms" expires_after="2023-09-01"> +<histogram name="Arc.AndroidBootTime" units="ms" expires_after="2023-11-05"> <owner>khmel@google.com</owner> <owner>arc-performance@google.com</owner> <summary>The time elapsed for booting up the ARC instance.</summary> @@ -2131,7 +2131,7 @@ </histogram> <histogram name="Arc.Runtime.Performance.Generic.Jankiness" units="%" - expires_after="2023-09-01"> + expires_after="2023-11-05"> <owner>khmel@google.com</owner> <owner>alanding@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 1a5213d..e2761a9 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -2731,7 +2731,7 @@ </histogram> <histogram name="Ash.DeviceActiveClient.SavePreservedFileSuccess" - enum="BooleanSuccess" expires_after="2023-09-01"> + enum="BooleanSuccess" expires_after="2023-11-05"> <owner>hirthanan@google.com</owner> <owner>chromeos-data-team@google.com</owner> <summary> @@ -2741,7 +2741,7 @@ </histogram> <histogram name="Ash.DeviceActiveClient.StateCount" - enum="DeviceActiveClientState" expires_after="2023-09-01"> + enum="DeviceActiveClientState" expires_after="2023-11-05"> <owner>hirthanan@google.com</owner> <owner>chromeos-data-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/assistant/histograms.xml b/tools/metrics/histograms/metadata/assistant/histograms.xml index 8427826..c6d4c8f 100644 --- a/tools/metrics/histograms/metadata/assistant/histograms.xml +++ b/tools/metrics/histograms/metadata/assistant/histograms.xml
@@ -65,7 +65,7 @@ </histogram> <histogram name="Assistant.DspHotwordDetection" - enum="DspHotwordDetectionStatus" expires_after="2023-08-27"> + enum="DspHotwordDetectionStatus" expires_after="2023-11-05"> <owner>xiaohuic@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 17a87e1..66634dd 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -1059,7 +1059,7 @@ </histogram> <histogram name="Autofill.CardUploadDecisionMetric" - enum="AutofillCardUploadDecisionMetric" expires_after="2023-08-27"> + enum="AutofillCardUploadDecisionMetric" expires_after="2023-11-05"> <owner>jsaul@google.com</owner> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> @@ -3396,7 +3396,7 @@ </histogram> <histogram name="Autofill.ProfileImport.NewProfileDecision" - enum="AutofillProfileImportDecision" expires_after="2023-09-03"> + enum="AutofillProfileImportDecision" expires_after="2023-11-05"> <owner>koerber@google.com</owner> <owner>src/components/autofill/OWNERS</owner> <summary> @@ -3517,7 +3517,7 @@ </histogram> <histogram name="Autofill.ProfileImport.UpdateProfileDecision" - enum="AutofillProfileImportDecision" expires_after="2023-09-03"> + enum="AutofillProfileImportDecision" expires_after="2023-11-05"> <owner>koerber@google.com</owner> <owner>src/components/autofill/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 26bf57b..34f8bba 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -1709,7 +1709,7 @@ </histogram> <histogram name="Blink.HTMLParsing.ParsingTimeMax4" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>masonf@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -1739,7 +1739,7 @@ </histogram> <histogram name="Blink.HTMLParsing.ParsingTimeTotal4" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>masonf@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -1754,7 +1754,7 @@ </histogram> <histogram name="Blink.HTMLParsing.TimeToDeferredPumpTokenizer4" - units="microseconds" expires_after="2023-09-03"> + units="microseconds" expires_after="2023-11-05"> <owner>sky@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -3605,7 +3605,7 @@ </histogram> <histogram name="Blink.VisibleBeforeLoaded.LazyLoadImages.BelowTheFold2" - enum="NQEEffectiveConnectionType" expires_after="2023-09-01"> + enum="NQEEffectiveConnectionType" expires_after="2023-11-05"> <owner>pdr@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/bookmarks/histograms.xml b/tools/metrics/histograms/metadata/bookmarks/histograms.xml index 1ff55ae..0be5bb0a 100644 --- a/tools/metrics/histograms/metadata/bookmarks/histograms.xml +++ b/tools/metrics/histograms/metadata/bookmarks/histograms.xml
@@ -399,7 +399,7 @@ </histogram> <histogram name="Bookmarks.OpenBookmarkType" enum="BookmarkType" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>wylieb@chromium.org</owner> <owner>chrome-collections@google.com</owner> <component>UI>Browser>Bookmarks</component>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index 9eed9733..130bea63 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -1784,7 +1784,7 @@ </histogram> <histogram name="ChromeOS.LanguagePacks.GetPackState.LanguageCode" - enum="LanguagePackLanguageCodes" expires_after="2023-09-03"> + enum="LanguagePackLanguageCodes" expires_after="2023-11-05"> <owner>claudiomagni@chromium.org</owner> <owner>mlcui@google.com</owner> <owner>dvallet@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index 705ce34..64046fe8 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -1030,7 +1030,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.LoadStreamStatus.LoadMore" - enum="FeedLoadStreamStatus" expires_after="2023-09-03"> + enum="FeedLoadStreamStatus" expires_after="2023-11-05"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/content_creation/histograms.xml b/tools/metrics/histograms/metadata/content_creation/histograms.xml index a29cb26f..7c8f76d4 100644 --- a/tools/metrics/histograms/metadata/content_creation/histograms.xml +++ b/tools/metrics/histograms/metadata/content_creation/histograms.xml
@@ -203,7 +203,7 @@ </histogram> <histogram name="SharedHighlights.LinkGenerated.Error.Requested" - enum="LinkGenerationError" expires_after="2023-08-27"> + enum="LinkGenerationError" expires_after="2023-11-05"> <owner>jeffreycohen@chromium.org</owner> <owner>chrome-shared-highlighting@google.com</owner> <summary> @@ -338,7 +338,7 @@ </histogram> <histogram name="TextFragmentAnchor.LinkOpenSource" - enum="TextFragmentLinkOpenSource" expires_after="2023-09-03"> + enum="TextFragmentLinkOpenSource" expires_after="2023-11-05"> <owner>jeffreycohen@chromium.org</owner> <owner>chrome-shared-highlighting@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cros_ml/histograms.xml b/tools/metrics/histograms/metadata/cros_ml/histograms.xml index 048403d..a24549c0 100644 --- a/tools/metrics/histograms/metadata/cros_ml/histograms.xml +++ b/tools/metrics/histograms/metadata/cros_ml/histograms.xml
@@ -211,7 +211,7 @@ </histogram> <histogram name="MachineLearningService.NumWorkerProcess" units="count" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>alanlxl@chromium.org</owner> <owner>amoylan@chromium.org</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="MachineLearningService.WorkerProcessAcceptMojoConnectionTime" - units="microseconds" expires_after="2023-08-27"> + units="microseconds" expires_after="2023-11-05"> <owner>alanlxl@chromium.org</owner> <owner>amoylan@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/crostini/histograms.xml b/tools/metrics/histograms/metadata/crostini/histograms.xml index 9c636e8d..a726f72 100644 --- a/tools/metrics/histograms/metadata/crostini/histograms.xml +++ b/tools/metrics/histograms/metadata/crostini/histograms.xml
@@ -343,7 +343,7 @@ </histogram> <histogram name="Crostini.RestarterResult" enum="CrostiniResult" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>davidmunro@google.com</owner> <owner>clumptini@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index cb2eeb0..33bdab7 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -139,7 +139,7 @@ </histogram> <histogram name="Extensions.ActiveScriptController.PermittedExtensions" - units="Extension Count" expires_after="2023-09-03"> + units="Extension Count" expires_after="2023-11-05"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -2112,7 +2112,7 @@ </histogram> <histogram name="Extensions.Functions.SucceededTotalExecutionTime" units="ms" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml index 28965001..868f48a 100644 --- a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml +++ b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml
@@ -345,7 +345,7 @@ </variants> <histogram name="InProductHelp.Config.ParsingEvent" enum="ConfigParsingEvent" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>nyquist@chromium.org</owner> <summary> Records if in-product help configuration is parsed correctly, and the
diff --git a/tools/metrics/histograms/metadata/history/histograms.xml b/tools/metrics/histograms/metadata/history/histograms.xml index b4715bd..0b89f2b 100644 --- a/tools/metrics/histograms/metadata/history/histograms.xml +++ b/tools/metrics/histograms/metadata/history/histograms.xml
@@ -1875,7 +1875,7 @@ </summary> </histogram> -<histogram name="History.DatabaseFileMB" units="MB" expires_after="2023-07-01"> +<histogram name="History.DatabaseFileMB" units="MB" expires_after="2023-11-05"> <owner>sophiechang@chromium.org</owner> <owner>tommycli@chromium.org</owner> <owner>chrome-journeys@google.com</owner> @@ -2262,7 +2262,7 @@ </histogram> <histogram name="History.InMemoryDBItemCount" units="typed URLs" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>sky@chromium.org</owner> <owner>mpearson@chromium.org</owner> <component>UI>Browser>History</component>
diff --git a/tools/metrics/histograms/metadata/input/histograms.xml b/tools/metrics/histograms/metadata/input/histograms.xml index d0e8d3a2..f5e1a6f 100644 --- a/tools/metrics/histograms/metadata/input/histograms.xml +++ b/tools/metrics/histograms/metadata/input/histograms.xml
@@ -1333,7 +1333,7 @@ </histogram> <histogram name="InputMethod.SystemEmojiPicker.TriggerType" - enum="VirtualKeyboardEmojiTriggerType" expires_after="2023-09-03"> + enum="VirtualKeyboardEmojiTriggerType" expires_after="2023-11-05"> <owner>jopalmer@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary>How emojis were inserted.</summary>
diff --git a/tools/metrics/histograms/metadata/ios/histograms.xml b/tools/metrics/histograms/metadata/ios/histograms.xml index 4db9eb18..c806613 100644 --- a/tools/metrics/histograms/metadata/ios/histograms.xml +++ b/tools/metrics/histograms/metadata/ios/histograms.xml
@@ -672,7 +672,7 @@ </histogram> <histogram name="IOS.ExperienceKitCalendar.Present" - enum="ExperienceKitCalendarTypes" expires_after="2023-09-03"> + enum="ExperienceKitCalendarTypes" expires_after="2023-11-05"> <owner>djean@chromium.org</owner> <owner>erahmaoui@google.com</owner> <summary> @@ -1483,7 +1483,7 @@ </histogram> <histogram name="IOS.NTP.Impression" enum="IOSNTPImpressionType" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>gambard@chromium.org</owner> <owner>bling-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/language/histograms.xml b/tools/metrics/histograms/metadata/language/histograms.xml index b951e22..e6578d50 100644 --- a/tools/metrics/histograms/metadata/language/histograms.xml +++ b/tools/metrics/histograms/metadata/language/histograms.xml
@@ -33,7 +33,7 @@ </histogram> <histogram name="LanguageDetection.TFLiteModel.WasModelAvailableForDetection" - enum="BooleanAvailable" expires_after="2023-09-03"> + enum="BooleanAvailable" expires_after="2023-11-05"> <owner>mcrouse@chromium.org</owner> <owner>chrome-language@google.com</owner> <summary> @@ -67,7 +67,7 @@ </histogram> <histogram name="LanguageSettings.Actions" enum="LanguageSettingsActionType" - expires_after="2023-08-31"> + expires_after="2023-11-05"> <owner>perrier@chromium.org</owner> <owner>chrome-language@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index a38e623c0..41da1a5 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -339,7 +339,7 @@ </histogram> <histogram name="Media.Audio.Capture.LowLatencyCallbackError" - enum="BooleanError" expires_after="2023-09-03"> + enum="BooleanError" expires_after="2023-11-05"> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -466,7 +466,7 @@ </histogram> <histogram name="Media.Audio.Capture.Win.Glitches2" units="glitches" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>olka@chromium.org</owner> <owner>henrika@chromium.org</owner> <owner>media-dev@chromium.org</owner> @@ -507,7 +507,7 @@ </histogram> <histogram name="Media.Audio.Capture.Win.Open" enum="AudioStreamOpenResult" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>gudiou@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -1009,7 +1009,7 @@ </histogram> <histogram name="Media.Audio.Render.OutputDeviceStatus" - enum="OutputDeviceStatus" expires_after="2023-09-03"> + enum="OutputDeviceStatus" expires_after="2023-11-05"> <owner>dalecurtis@chromium.org</owner> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> @@ -3395,7 +3395,7 @@ </histogram> <histogram name="Media.LowLatencyAudioCaptureStartupSuccess" - enum="AudioCaptureStartupResult" expires_after="2023-08-27"> + enum="AudioCaptureStartupResult" expires_after="2023-11-05"> <owner>armax@chromium.org</owner> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> @@ -5191,7 +5191,7 @@ </histogram> <histogram name="Media.VideoCapture.DelayUntilFirstFrame" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>armax@chromium.org</owner> <owner>video-cmi-mpp@google.com</owner> <summary> @@ -5228,7 +5228,7 @@ </histogram> <histogram name="Media.VideoCapture.Error" enum="VideoCaptureError" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>mcasas@chromium.org</owner> <owner>guidou@chromium.org</owner> <owner>armax@chromium.org</owner> @@ -5416,7 +5416,7 @@ </histogram> <histogram name="Media.VideoCapture.Start" enum="Boolean" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>toprice@chromium.org</owner> <owner>guidou@chromium.org</owner> <summary> @@ -5439,7 +5439,7 @@ </histogram> <histogram name="Media.VideoCapture.StartOutcome" - enum="VideoCaptureStartOutcome" expires_after="2023-09-03"> + enum="VideoCaptureStartOutcome" expires_after="2023-11-05"> <owner>toprice@chromium.org</owner> <owner>guidou@chromium.org</owner> <summary> @@ -5510,7 +5510,7 @@ </histogram> <histogram name="Media.VideoCapture.Win.ErrorEvent" enum="Hresult" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>toprice@chromium.org</owner> <owner>hta@chromium.org</owner> <summary> @@ -6593,7 +6593,7 @@ </histogram> <histogram name="MediaRouter.Provider.TerminateRoute.Result" - enum="MediaRouteProviderResult" expires_after="2023-06-18"> + enum="MediaRouteProviderResult" expires_after="2024-05-01"> <!-- Name completed by histogram_suffixes name="MediaRouteProvider" --> <owner>takumif@chromium.org</owner> @@ -6762,7 +6762,7 @@ </histogram> <histogram name="MediaRouter.Ui.Android.DialogAction" - enum="MediaRouterAndroidDialogAction" expires_after="2023-06-18"> + enum="MediaRouterAndroidDialogAction" expires_after="2024-05-01"> <owner>muyaoxu@google.com</owner> <owner>openscreen-eng@google.com</owner> <summary> @@ -6774,7 +6774,7 @@ </histogram> <histogram name="MediaRouter.Ui.Android.DialogType" - enum="MediaRouterAndroidDialogType" expires_after="2023-06-18"> + enum="MediaRouterAndroidDialogType" expires_after="2024-05-01"> <owner>muyaoxu@google.com</owner> <owner>openscreen-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 56ac379..e418089 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -1047,7 +1047,7 @@ </histogram> <histogram name="Navigation.OnBeforeUnloadOverheadTime" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>clamy@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> @@ -1426,7 +1426,7 @@ </histogram> <histogram name="Navigation.UserAgentStringType" enum="UserAgentStringType" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>miketaylr@chromium.org</owner> <owner>potassium-katabolism@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index 7d3042e..f536681 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -736,50 +736,6 @@ </summary> </histogram> -<histogram name="Net.Cors.AccessCheckResult" enum="CorsAccessCheckResult" - expires_after="2023-06-04"> - <owner>toyoshim@chromium.org</owner> - <owner>src/services/network/OWNERS</owner> - <summary> - The distribution of CORS access check results. This reports whenever CORS - AccessCheck runs. This is recorded when a CORS enabled request receives a - response and completes CORS checks. - </summary> -</histogram> - -<histogram name="Net.Cors.AccessCheckResult.NotSecureRequestor" - enum="CorsAccessCheckResult" expires_after="2023-06-04"> - <owner>carlosil@chromium.org</owner> - <owner>estark@chromium.org</owner> - <owner>toyoshim@chromium.org</owner> - <owner>src/services/network/OWNERS</owner> - <summary> - The distribution of CORS access check results for not potentially - trustworthy requestors. This reports whenever CORS AccessCheck runs and the - requesting site origin is not potentially trustworthy. - </summary> -</histogram> - -<histogram name="Net.Cors.PreflightCacheKeySize" units="bytes" - expires_after="2023-06-04"> - <owner>toyoshim@chromium.org</owner> - <owner>src/services/network/OWNERS</owner> - <summary> - The distribution of the key size in the CORS preflight cache. This counts - each key size when a new entry is added to the cache. - </summary> -</histogram> - -<histogram name="Net.Cors.PreflightCacheResult" enum="CorsPreflightCacheResult" - expires_after="2023-06-04"> - <owner>toyoshim@chromium.org</owner> - <owner>src/services/network/OWNERS</owner> - <summary> - The distribution of the CORS preflight cache query results. This counts on - each cache query. - </summary> -</histogram> - <histogram name="Net.Cors.PreflightCheckError2" enum="CorsAccessCheckError" expires_after="2023-10-08"> <owner>toyoshim@chromium.org</owner> @@ -1610,7 +1566,7 @@ </histogram> <histogram name="Net.DNS.SystemTask.FailureTime" units="ms" - expires_after="2023-08-28"> + expires_after="2023-11-05"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1621,7 +1577,7 @@ </histogram> <histogram name="Net.DNS.SystemTask.SuccessTime" units="ms" - expires_after="2023-08-28"> + expires_after="2023-11-05"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/network/histograms.xml b/tools/metrics/histograms/metadata/network/histograms.xml index 2b7b576..78df7fd2 100644 --- a/tools/metrics/histograms/metadata/network/histograms.xml +++ b/tools/metrics/histograms/metadata/network/histograms.xml
@@ -1874,28 +1874,6 @@ </summary> </histogram> -<histogram name="Network.Radio.SimpleURLLoaderIsThrottled" enum="Boolean" - expires_after="2023-08-27"> - <owner>bashi@chromium.org</owner> - <owner>blink-network-stack@google.com</owner> - <summary> - Records whether a SimpleURLLoader is throttled due to the default network - state (e.g. in low power state). Recorded when a SimpleURLLoader is going to - start. - </summary> -</histogram> - -<histogram name="Network.Radio.SimpleURLLoaderThrottledTime" units="ms" - expires_after="2023-08-27"> - <owner>bashi@chromium.org</owner> - <owner>blink-network-stack@google.com</owner> - <summary> - Records the time between a SimpleURLLoader request is made to the request - actually starts. Recorded only when the request is throttled due to the - default network state (e.g. in low power state). - </summary> -</histogram> - <histogram name="Network.RedirectFoundToOnlineTime" units="ms" expires_after="2023-09-18"> <owner>stevenjb@chromium.org</owner> @@ -3722,7 +3700,7 @@ </histogram> <histogram name="Network.Wifi.Synced.Connection.FailureReason" - enum="ConnectionFailureReason" expires_after="2023-08-20"> + enum="ConnectionFailureReason" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3733,7 +3711,7 @@ </histogram> <histogram name="Network.Wifi.Synced.Connection.Result" enum="BooleanSuccess" - expires_after="2023-10-22"> + expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3744,7 +3722,7 @@ </histogram> <histogram name="Network.Wifi.Synced.Hidden.Fixed" units="networks" - expires_after="2023-08-20"> + expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>tnagel@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> @@ -3757,7 +3735,7 @@ </histogram> <histogram name="Network.Wifi.Synced.ManualConnection.FailureReason" - enum="ConnectionFailureReason" expires_after="2023-06-18"> + enum="ConnectionFailureReason" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3768,7 +3746,7 @@ </histogram> <histogram name="Network.Wifi.Synced.ManualConnection.Result" - enum="BooleanSuccess" expires_after="2023-06-18"> + enum="BooleanSuccess" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3779,7 +3757,7 @@ </histogram> <histogram name="Network.Wifi.Synced.TotalCount" units="units" - expires_after="2023-10-22"> + expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3790,7 +3768,7 @@ </histogram> <histogram name="Network.Wifi.Synced.UpdateOperation.FailureReason" - enum="ConnectionFailureReason" expires_after="2023-06-18"> + enum="ConnectionFailureReason" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3803,7 +3781,7 @@ <histogram name="Network.Wifi.Synced.UpdateOperation.GenerateLocalNetworkConfig.Result" - enum="BooleanSuccess" expires_after="2023-06-18"> + enum="BooleanSuccess" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3814,7 +3792,7 @@ </histogram> <histogram name="Network.Wifi.Synced.UpdateOperation.Result" - enum="BooleanSuccess" expires_after="2023-06-18"> + enum="BooleanSuccess" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner> @@ -3826,7 +3804,7 @@ </histogram> <histogram name="Network.Wifi.Synced.ZeroNetworksEligibleForSync.Reason" - enum="NetworkEligibilityStatus" expires_after="2023-06-18"> + enum="NetworkEligibilityStatus" expires_after="2024-06-01"> <owner>jonmann@chromium.org</owner> <owner>crisrael@google.com</owner> <owner>chromeos-cross-device-eng@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index f8fefd87..c14c4bf 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -3317,7 +3317,7 @@ </histogram> <histogram name="ContextMenu.TimeToTakeAction.SelectedItem" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> @@ -6818,7 +6818,7 @@ </histogram> <histogram name="Hwsec.Attestation.PrepareDuration" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>chingkang@chromium.org</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary>The duration of preparation for enrollment in attestation.</summary> @@ -7127,7 +7127,7 @@ </histogram> <histogram name="InstanceID.GetToken.RequestStatus.SyncInvalidations" - enum="GCMRegistrationRequestStatus" expires_after="2023-09-03"> + enum="GCMRegistrationRequestStatus" expires_after="2023-11-05"> <owner>peter@chromium.org</owner> <owner>rushans@chromium.org</owner> <owner>treib@chromium.org</owner> @@ -9837,7 +9837,7 @@ </histogram> <histogram name="PushMessaging.DeliveryStatus" enum="PushEventStatus" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>peter@chromium.org</owner> <owner>knollr@chromium.org</owner> <summary> @@ -10163,7 +10163,7 @@ </histogram> <histogram name="ReadingList.WebUI.LoadCompletedTime" units="ms" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>corising@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index 26e3d73f..dadb384 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -1247,7 +1247,7 @@ <histogram name="PageLoad.Clients.ThirdParty.Frames.NavigationToFirstContentfulPaint3" - units="ms" expires_after="2023-09-03"> + units="ms" expires_after="2023-11-05"> <owner>jkarlin@chromium.org</owner> <owner>johnidel@chromium.org</owner> <summary> @@ -1494,7 +1494,7 @@ </histogram> <histogram name="PageLoad.DocumentTiming.NavigationToLoadEventFired" units="ms" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>bmcquade@chromium.org</owner> <owner>csharrison@chromium.org</owner> <improvement direction="LOWER_IS_BETTER"/> @@ -2867,7 +2867,7 @@ </histogram> <histogram name="PageLoad.PaintTiming.NavigationToFirstPaint" units="ms" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>ksakamoto@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -3044,7 +3044,7 @@ </histogram> <histogram name="PageLoad.ParseTiming.NavigationToParseStart" units="ms" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>bmcquade@chromium.org</owner> <owner>csharrison@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index 4d66705..5fdf6f555 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -117,7 +117,7 @@ </variants> <histogram name="KeyboardAccessory.AccessoryActionImpression" - enum="AccessoryAction" expires_after="2023-09-03"> + enum="AccessoryAction" expires_after="2023-11-05"> <owner>fhorschig@chromium.org</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -127,7 +127,7 @@ </histogram> <histogram name="KeyboardAccessory.AccessoryActionSelected" - enum="AccessoryAction" expires_after="2023-09-03"> + enum="AccessoryAction" expires_after="2023-11-05"> <owner>fhorschig@chromium.org</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -710,7 +710,7 @@ </histogram> <histogram name="PasswordManager.AffiliationBackend.FetchSize" units="facets" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -792,7 +792,7 @@ </histogram> <histogram name="PasswordManager.AffiliationFetcher.FetchResult" - enum="AffiliationFetchResult" expires_after="2023-09-03"> + enum="AffiliationFetchResult" expires_after="2023-11-05"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -888,7 +888,7 @@ </histogram> <histogram name="PasswordManager.AutomaticChange.AcceptanceWithoutAutoButton" - enum="PasswordCheckResolutionAction" expires_after="2023-09-03"> + enum="PasswordCheckResolutionAction" expires_after="2023-11-05"> <owner>kolos@chromium.org</owner> <owner>battre@chromium.org</owner> <summary> @@ -1464,7 +1464,7 @@ </histogram> <histogram name="PasswordManager.EditsInSaveBubble" - enum="PasswordManagerEditsInSaveBubbleEnum" expires_after="2023-09-03"> + enum="PasswordManagerEditsInSaveBubbleEnum" expires_after="2023-11-05"> <owner>vasilii@chromium.org</owner> <owner>kazinova@google.com</owner> <summary> @@ -1556,7 +1556,7 @@ </histogram> <histogram name="PasswordManager.FillingAssistance" - enum="PasswordManagerFillingAssistance" expires_after="2023-09-03"> + enum="PasswordManagerFillingAssistance" expires_after="2023-11-05"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -2061,7 +2061,7 @@ </histogram> <histogram name="PasswordManager.LeakDetection.LookupSingleLeakResponseResult" - enum="PasswordLeakLookupResponseResult" expires_after="2023-08-27"> + enum="PasswordLeakLookupResponseResult" expires_after="2023-11-05"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2256,7 +2256,7 @@ </histogram> <histogram name="PasswordManager.NewlySavedPasswordIsGenerated" - enum="BooleanNewlySavedPasswordIsGenerated" expires_after="2023-09-03"> + enum="BooleanNewlySavedPasswordIsGenerated" expires_after="2023-11-05"> <owner>nepper@chromium.org</owner> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -4412,7 +4412,7 @@ </histogram> <histogram base="true" name="PasswordProtection.RequestOutcome" - enum="PasswordProtectionRequestOutcome" expires_after="2023-09-03"> + enum="PasswordProtectionRequestOutcome" expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -4457,7 +4457,7 @@ </histogram> <histogram name="PasswordProtection.Verdict" enum="PasswordProtectionVerdict" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/pdf/histograms.xml b/tools/metrics/histograms/metadata/pdf/histograms.xml index e318d1ca..d6375199 100644 --- a/tools/metrics/histograms/metadata/pdf/histograms.xml +++ b/tools/metrics/histograms/metadata/pdf/histograms.xml
@@ -86,7 +86,7 @@ </histogram> <histogram name="PDF.LoadStatus" enum="ChromePDFViewerLoadStatus" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>kmoon@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index 83ef79e..df49461 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -127,7 +127,7 @@ </histogram> <histogram name="Platform.Chaps.ReinitializingToken" - enum="ChapsReinitializingToken" expires_after="2023-08-27"> + enum="ChapsReinitializingToken" expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -136,7 +136,7 @@ </histogram> <histogram name="Platform.Chaps.Session.Decrypt" enum="ChapsSessionStatus" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -169,7 +169,7 @@ </histogram> <histogram name="Platform.Chaps.Session.Sign" enum="ChapsSessionStatus" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -191,7 +191,7 @@ </histogram> <histogram name="Platform.Chaps.TokenManager.LoadToken" - enum="TokenManagerStatus" expires_after="2023-08-27"> + enum="TokenManagerStatus" expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -213,7 +213,7 @@ </histogram> <histogram name="Platform.Chaps.TPMAvailability" enum="ChapsTPMAvailability" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary>Each sample is the TPM Availability status.</summary> @@ -1842,7 +1842,7 @@ </histogram> <histogram name="Platform.TPM.DictionaryAttackResetStatus" - enum="CrosTPMDictionaryAttackResetStatusEnum" expires_after="2023-08-27"> + enum="CrosTPMDictionaryAttackResetStatusEnum" expires_after="2023-11-05"> <owner>cylai@chromium.org</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -1927,7 +1927,7 @@ </histogram> <histogram name="Platform.TPM.PowerWashResult" enum="TPMPowerWashResult" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>chenyian@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -2034,7 +2034,7 @@ </histogram> <histogram name="Platform.Trunks.FirstTimeoutWritingCommand" - enum="TPMCommandCode" expires_after="2023-08-27"> + enum="TPMCommandCode" expires_after="2023-11-05"> <owner>chingkang@chromium.org</owner> <owner>cros-hwsec+uma@chromium.org</owner> <summary>Command code of the first timeout writing TPM command</summary>
diff --git a/tools/metrics/histograms/metadata/power/histograms.xml b/tools/metrics/histograms/metadata/power/histograms.xml index 5cbb282f..e51cbcd1 100644 --- a/tools/metrics/histograms/metadata/power/histograms.xml +++ b/tools/metrics/histograms/metadata/power/histograms.xml
@@ -2428,7 +2428,7 @@ </histogram> <histogram name="PowerML.DimImminent.Action" enum="PowerMLDimImminentAction" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>napper@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -2438,7 +2438,7 @@ </histogram> <histogram name="PowerML.ModelDim.Result" enum="PowerMLFinalResult" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>napper@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/prefetch/histograms.xml b/tools/metrics/histograms/metadata/prefetch/histograms.xml index 3cefa25..d8bd94a7 100644 --- a/tools/metrics/histograms/metadata/prefetch/histograms.xml +++ b/tools/metrics/histograms/metadata/prefetch/histograms.xml
@@ -339,7 +339,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.CookiesToCopy" units="count" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>curranmax@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>spelchat@chromium.org</owner> @@ -362,7 +362,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.RespCode" - enum="HttpResponseCode" expires_after="2023-08-27"> + enum="HttpResponseCode" expires_after="2023-11-05"> <owner>curranmax@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>spelchat@chromium.org</owner> @@ -397,7 +397,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.TotalTime" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>curranmax@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>spelchat@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/print/histograms.xml b/tools/metrics/histograms/metadata/print/histograms.xml index eb20415d..fff2f0a 100644 --- a/tools/metrics/histograms/metadata/print/histograms.xml +++ b/tools/metrics/histograms/metadata/print/histograms.xml
@@ -36,7 +36,7 @@ </histogram> <histogram name="PrintPreview.InitialDisplayTime" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>thestig@chromium.org</owner> <owner>dhoss@chromium.org</owner> <summary> @@ -258,7 +258,7 @@ </histogram> <histogram name="PrintPreview.UserAction" enum="PrintPreviewUserActionType" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>thestig@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/renderer/histograms.xml b/tools/metrics/histograms/metadata/renderer/histograms.xml index 9a61827..15f452b4 100644 --- a/tools/metrics/histograms/metadata/renderer/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer/histograms.xml
@@ -576,7 +576,7 @@ </histogram> <histogram name="RendererScheduler.RendererMainThreadLoad5" units="%" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>altimin@chromium.org</owner> <summary> Renderer main thread load (percentage of time spent in tasks), reported in
diff --git a/tools/metrics/histograms/metadata/renderer4/histograms.xml b/tools/metrics/histograms/metadata/renderer4/histograms.xml index 40145ce2..c04c012 100644 --- a/tools/metrics/histograms/metadata/renderer4/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer4/histograms.xml
@@ -267,7 +267,7 @@ </histogram> <histogram name="Renderer4.Renderer.RasterTaskTotalDuration" - units="microseconds" expires_after="2023-08-27"> + units="microseconds" expires_after="2023-11-05"> <owner>khushalsagar@chromium.org</owner> <owner>chrome-gpu@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index 5440384c..02e11fb 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -412,7 +412,7 @@ </histogram> <histogram name="SafeBrowsing.CheckUrl.Timeout" enum="BooleanTimedOut" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -931,7 +931,7 @@ </histogram> <histogram name="SafeBrowsing.FileTypeUpdate.DynamicUpdateResult" - enum="SBFileTypeUpdateResult" expires_after="2023-08-27"> + enum="SBFileTypeUpdateResult" expires_after="2023-11-05"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1688,7 +1688,7 @@ </histogram> <histogram name="SafeBrowsing.RendererThrottle.TotalDelay" units="ms" - expires_after="2023-10-22"> + expires_after="2023-11-05"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1991,7 +1991,7 @@ </histogram> <histogram name="SafeBrowsing.RT.Network.Time" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2299,7 +2299,7 @@ </histogram> <histogram name="SafeBrowsing.Triggers.AdSampler.Action" - enum="AdSamplerTriggerAction" expires_after="2023-08-27"> + enum="AdSamplerTriggerAction" expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2392,7 +2392,7 @@ </histogram> <histogram name="SafeBrowsing.V4GetHash.CacheHit.Result" - enum="SafeBrowsingV4FullHashCacheResult" expires_after="2023-09-03"> + enum="SafeBrowsingV4FullHashCacheResult" expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>Track cache hits for V4 full hashes.</summary> @@ -2447,7 +2447,7 @@ </histogram> <histogram name="SafeBrowsing.V4GetHash.Network.Time" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2471,7 +2471,7 @@ </histogram> <histogram name="SafeBrowsing.V4GetHash.Result" - enum="SafeBrowsingV4OperationResult" expires_after="2023-08-27"> + enum="SafeBrowsingV4OperationResult" expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2586,7 +2586,7 @@ </histogram> <histogram name="SafeBrowsing.V4ProcessPartialUpdate.ApplyUpdate.Result" - enum="SafeBrowsingV4ApplyUpdateResult" expires_after="2023-09-03"> + enum="SafeBrowsingV4ApplyUpdateResult" expires_after="2023-11-05"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/security/histograms.xml b/tools/metrics/histograms/metadata/security/histograms.xml index b941bca..c23755e 100644 --- a/tools/metrics/histograms/metadata/security/histograms.xml +++ b/tools/metrics/histograms/metadata/security/histograms.xml
@@ -304,7 +304,7 @@ </histogram> <histogram name="Security.PageInfo.AboutThisSiteStatus" - enum="AboutThisSiteStatus" expires_after="2023-08-27"> + enum="AboutThisSiteStatus" expires_after="2023-11-05"> <owner>dullweber@chromium.org</owner> <owner>olesiamarukhno@chromium.org</owner> <summary> @@ -669,7 +669,7 @@ </histogram> <histogram name="Security.SecurityLevel.OnComplete" enum="SecurityLevel" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>cthomp@chromium.org</owner> <owner>security-enamel@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index 671ae95..249971c 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -314,7 +314,7 @@ </histogram> <histogram name="Signin.AndroidGetAccountIdsTime" units="ms" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>alexilin@chromium.org</owner> <owner>bsazonov@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index e2dddea..05557c6 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -1111,7 +1111,7 @@ </histogram> <histogram name="Sync.PostedClientToServerMessage" - enum="SyncClientToServerMessageContents" expires_after="2023-09-03"> + enum="SyncClientToServerMessageContents" expires_after="2023-11-05"> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> <summary> @@ -1121,7 +1121,7 @@ </histogram> <histogram name="Sync.PostedClientToServerMessageError2" enum="SyncErrorType" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index b401f06..d48128c 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -922,7 +922,7 @@ </histogram> <histogram name="TabManager.Discarding.DiscardCount" units="Discards" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>chrisha@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary> @@ -981,7 +981,7 @@ </histogram> <histogram name="TabManager.Discarding.ReloadCount" units="Reloads" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>chrisha@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/translate/histograms.xml b/tools/metrics/histograms/metadata/translate/histograms.xml index 038f369..db8880ef 100644 --- a/tools/metrics/histograms/metadata/translate/histograms.xml +++ b/tools/metrics/histograms/metadata/translate/histograms.xml
@@ -494,7 +494,7 @@ </histogram> <histogram name="Translate.PageLoad.InitialSourceLanguage" - enum="LocaleCodeISO639" expires_after="2023-08-31"> + enum="LocaleCodeISO639" expires_after="2023-11-05"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ukm/histograms.xml b/tools/metrics/histograms/metadata/ukm/histograms.xml index 803e357..f6180f2 100644 --- a/tools/metrics/histograms/metadata/ukm/histograms.xml +++ b/tools/metrics/histograms/metadata/ukm/histograms.xml
@@ -81,7 +81,7 @@ </histogram> <histogram name="UKM.Entries.Dropped" enum="UkmDataDroppedReason" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -140,7 +140,7 @@ </histogram> <histogram name="UKM.Entries.Recorded.ByEntryHash" enum="UkmEventNameHash" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>yrsun@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -152,7 +152,7 @@ </histogram> <histogram name="UKM.Entries.SerializedCount2" units="entries" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary>Number of serialized UKM entries when storing a UKM log.</summary> @@ -199,7 +199,7 @@ </summary> </histogram> -<histogram name="UKM.LogSize.OnSuccess" units="KB" expires_after="2023-09-03"> +<histogram name="UKM.LogSize.OnSuccess" units="KB" expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -222,7 +222,7 @@ </histogram> <histogram name="UKM.LogUpload.ResponseOrErrorCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-09-03"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -312,7 +312,7 @@ </histogram> <histogram name="UKM.Sources.KeptSourcesCount" units="sources" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="UKM.Sources.UnsentSourcesCount" units="sources" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -371,7 +371,7 @@ </histogram> <histogram name="UKM.UnsentLogs.NumDropped" units="units" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index f2ab3f5fc..d734cb3 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -151,7 +151,7 @@ </histogram> <histogram name="V8.CompileScriptMicroSeconds" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>leszeks@chromium.org</owner> <owner>v8-runtime@google.com</owner> <summary> @@ -1167,7 +1167,7 @@ </histogram> <histogram name="V8.LiftoffBailoutReasons" enum="LiftoffBailoutReason" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>ecmziegler@chromium.org</owner> <owner>adamk@chromium.org</owner> <owner>clemensb@chromium.org</owner> @@ -1495,7 +1495,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeTotalBackground" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1507,7 +1507,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeTotalForeground" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1519,7 +1519,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeTotalTime" units="microseconds" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/web_apk/histograms.xml b/tools/metrics/histograms/metadata/web_apk/histograms.xml index 6124b147..082633a 100644 --- a/tools/metrics/histograms/metadata/web_apk/histograms.xml +++ b/tools/metrics/histograms/metadata/web_apk/histograms.xml
@@ -251,7 +251,7 @@ </histogram> <histogram name="WebApk.Update.DidGetInstallableData" - enum="WebApkUpdateManifestResult" expires_after="2023-09-03"> + enum="WebApkUpdateManifestResult" expires_after="2023-11-05"> <owner>eirage@chromium.org</owner> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index 02f7b353..c27cc5c 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -834,7 +834,7 @@ </histogram> <histogram name="WebRTC.Call.EstimatedSendBitrateInKbps" units="kbps" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>holmer@chromium.org</owner> <summary> Average estimated send bitrate during a call, counted from first packet sent @@ -872,7 +872,7 @@ </histogram> <histogram name="WebRTC.Call.TimeReceivingAudioRtpPacketsInSeconds" units="s" - expires_after="2023-08-27"> + expires_after="2023-11-05"> <owner>saza@chromium.org</owner> <summary> The amount of time between the arrival of the first and last audio RTP @@ -884,7 +884,7 @@ </histogram> <histogram name="WebRTC.Call.TimeReceivingVideoRtpPacketsInSeconds" units="s" - expires_after="2023-09-03"> + expires_after="2023-11-05"> <owner>saza@chromium.org</owner> <summary> The amount of time between the arrival of the first and last video RTP @@ -1259,7 +1259,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Duration.Network" units="microseconds" - expires_after="2023-09-01"> + expires_after="2023-11-05"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary> @@ -1291,7 +1291,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Duration.Worker" units="microseconds" - expires_after="2023-09-01"> + expires_after="2023-11-05"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary> @@ -1387,7 +1387,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Latency.Network" units="microseconds" - expires_after="2023-09-01"> + expires_after="2023-11-05"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary> @@ -1403,7 +1403,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Latency.Signaling" units="microseconds" - expires_after="2023-09-01"> + expires_after="2023-11-05"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary>
diff --git a/ui/android/java/res/values/color_palette.xml b/ui/android/java/res/values/color_palette.xml index 67c27fe0..df7da0c 100644 --- a/ui/android/java/res/values/color_palette.xml +++ b/ui/android/java/res/values/color_palette.xml
@@ -161,7 +161,9 @@ <!-- GM3 dynamic colors that point to the baseline palette for below Android S.--> <color name="material_primary_50">@color/baseline_primary_50</color> + <color name="material_primary_100">@color/baseline_primary_100</color> <color name="material_primary_200">@color/baseline_primary_200</color> <color name="material_primary_600">@color/baseline_primary_600</color> <color name="material_primary_800">@color/baseline_primary_800</color> + <color name="material_primary_900">@color/baseline_primary_900</color> </resources>
diff --git a/ui/file_manager/file_manager/common/js/api.js b/ui/file_manager/file_manager/common/js/api.js index ace2766..8b165fc 100644 --- a/ui/file_manager/file_manager/common/js/api.js +++ b/ui/file_manager/file_manager/common/js/api.js
@@ -346,3 +346,12 @@ export async function getBulkPinProgress() { return promisify(chrome.fileManagerPrivate.getBulkPinProgress); } + +/** + * Starts calculating the required space to pin all the users items on their My + * drive. + * @returns {!Promise<void>} + */ +export async function calculateBulkPinRequiredSpace() { + return promisify(chrome.fileManagerPrivate.calculateBulkPinRequiredSpace); +}
diff --git a/ui/file_manager/file_manager/containers/search_container.ts b/ui/file_manager/file_manager/containers/search_container.ts index dc7da23..6b3f2ab 100644 --- a/ui/file_manager/file_manager/containers/search_container.ts +++ b/ui/file_manager/file_manager/containers/search_container.ts
@@ -366,8 +366,8 @@ } if (util.isSearchV2Enabled()) { if (search.status === PropStatus.STARTED && query) { - this.showOptions_(state); - this.showPathDisplay_(); + this.showOptionsElement_(state); + this.showPathDisplayElement_(); } } } @@ -377,16 +377,20 @@ * to set the path of the currently selected element. */ private handleSelectionState_(state: State) { - if (!this.pathDisplay_) { + const search = state.search; + if (!search || !search.query) { return; } + if (!this.pathDisplay_) { + this.showPathDisplayElement_(); + } const path = this.getSelectedPath_(state); if (path) { - this.pathDisplay_.removeAttribute('hidden'); - this.pathDisplay_.path = path; + this.pathDisplay_!.removeAttribute('hidden'); + this.pathDisplay_!.path = path; } else { - this.pathDisplay_.path = ''; - this.pathDisplay_.setAttribute('hidden', ''); + this.pathDisplay_!.path = ''; + this.pathDisplay_!.setAttribute('hidden', ''); } } @@ -412,7 +416,7 @@ /** * Hides the element that allows users to manipulate search options. */ - private hideOptions_() { + private hideOptionsElement_() { if (this.searchOptions_) { this.searchOptions_.remove(); this.searchOptions_ = null; @@ -423,7 +427,7 @@ * Shows or creates the element that allows the user to manipulate search * options. */ - private showOptions_(state: State) { + private showOptionsElement_(state: State) { let element = this.getSearchOptionsElement_(); if (!element) { element = this.createSearchOptionsElement_(state); @@ -431,14 +435,14 @@ element.hidden = false; } - private hidePathDisplay_() { + private hidePathDisplayElement_() { const element = this.getPathDisplayElement_(); if (element) { element.hidden = true; } } - private showPathDisplay_() { + private showPathDisplayElement_() { let element = this.getPathDisplayElement_(); if (!element) { element = this.createPathDisplayElement_(); @@ -652,8 +656,8 @@ // Do not initiate close transition if we are not open. This would leave us // in the CLOSING state, without ever getting to CLOSED state. if (this.inputState_ === SearchInputState.OPEN) { - this.hideOptions_(); - this.hidePathDisplay_(); + this.hideOptionsElement_(); + this.hidePathDisplayElement_(); this.store_.dispatch(clearSearch()); this.inputState_ = SearchInputState.CLOSING; this.inputElement_.tabIndex = -1;
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html index 4e74c656..6822017 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html +++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html
@@ -14,14 +14,22 @@ display: none; } - #box { + :host-context([theme='legacy']) #box { display: block; overflow: auto; padding-top: 16px; width: 320px; } - .category { + :host-context([theme='refresh23']) #box { + display: block; + overflow: auto; + padding-bottom: 16px; + padding-top: 16px; + width: 320px; + } + + :host-context([theme='legacy']) .category { color: var(--cros-text-color-primary); font-family: 'Roboto Medium'; font-size: 14px; @@ -29,7 +37,15 @@ margin-inline-start: 32px; } - hr { + :host-context([theme='refresh23']) .category { + color: var(--cros-sys-on_surface); + font: var(--cros-button-1-font); + padding-bottom: 16px; + padding-inline: 32px 16px; + padding-top: 16px; + } + + :host-context([theme='legacy']) hr { border-color: var(--cros-separator-color); border-top-width: 1px !important; border-width: 0; @@ -37,11 +53,19 @@ margin-top: 16px; } + :host-context([theme='refresh23']) hr { + border-color: var(--cros-sys-separator); + border-top-width: 1px !important; + border-width: 0; + margin-bottom: 16px; + margin-top: 16px; + } + @media only screen and (max-width: 720px) { - #box { + :host-context([theme='legacy']) #box { width: 240px; } - .category { + :host-context([theme='legacy']) .category { margin: 12px 12px; } }
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.html b/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.html index 86e75de0..f495e53 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.html +++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.html
@@ -8,7 +8,7 @@ margin: 0; } - #box { + :host-context([theme='legacy']) #box { display: flex; line-height: 20px; margin: 10px 0; @@ -16,11 +16,22 @@ width: 320px; } + :host-context([theme='refresh23']) #box { + box-sizing: border-box; + color: var(--cros-sys-on_surface); + display: flex; + font: var(--cros-body-2-font); + margin: 10px 0; + min-height: 14px; + padding-inline: 32px 16px; + width: 320px; + } + #box[hidden] { display: none; } - #key { + :host-context([theme='legacy']) #key { color: var(--cros-text-color-primary); font-weight: 500; margin-inline-end: 16px; @@ -30,7 +41,14 @@ width: 96px; } - #value { + :host-context([theme='refresh23']) #key { + margin-inline-end: 24px; + overflow-wrap: break-word; + vertical-align: bottom; + width: 88px; + } + + :host-context([theme='legacy']) #value { color: var(--cros-text-color-primary); opacity: 0.8; overflow-wrap: break-word; @@ -38,6 +56,12 @@ width: 160px; } + :host-context([theme='refresh23']) #value { + overflow-wrap: break-word; + vertical-align: bottom; + width: 160px; + } + #value[loading]::after { animation: ellipsis 1s steps(4,end) 100ms infinite; content: '…'; @@ -61,15 +85,15 @@ } @media only screen and (max-width: 720px) { - #box { + :host-context([theme='legacy']) #box { width: 240px; } - #key { + :host-context([theme='legacy']) #key { margin-inline-end: 8px; margin-inline-start: 12px; width: 80px; } - #value { + :host-context([theme='legacy']) #value { width: 140px; } }
diff --git a/ui/file_manager/file_manager/foreground/elements/files_quick_view_gm3.css b/ui/file_manager/file_manager/foreground/elements/files_quick_view_gm3.css new file mode 100644 index 0000000..2d73a63 --- /dev/null +++ b/ui/file_manager/file_manager/foreground/elements/files_quick_view_gm3.css
@@ -0,0 +1,285 @@ +/* Copyright 2023 The Chromium Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +:host > ::content > * { + margin: 0; + padding: 0; +} + +dialog { + background-color: transparent; + border: none; + font-size: 100%; + height: 100%; + margin: 0; + max-height: initial; + max-width: initial; + opacity: 0; + outline: none; + overflow: hidden; + padding: 0; + width: 100%; +} + +dialog[open] { + opacity: 1; + transition: opacity 200ms; +} + +dialog:focus { + outline: none; +} + +dialog#delete-confirm-dialog::backdrop { + background-color: transparent; +} + +.thumbnail { + flex: none; + height: 100%; + width: 100%; +} + +#video-poster { + max-height: 100%; + max-width: 100%; +} + +#audio-artwork { + height: 100%; + margin: 0 auto; + width: 100%; +} + +#mainPanel { + background-color: transparent; + bottom: 0; + margin: 0; + padding: 0; + position: absolute; + top: 56px; /* toolbar height */ + width: 100%; +} + +#contentPanel { + background-color: transparent; + display: flex; + height: 100%; + justify-content: center; + position: relative; +} + +#contentPanel[metadata-box-active] { + margin-inline-end: 320px; +} + +:host-context(html[dir='rtl']) #contentPanel[metadata-box-active] { + margin-inline-end: 320px; + margin-inline-start: auto; +} + +#innerContentPanel { + background-color: var(--cros-sys-scrim); + color: var(--cros-sys-on_surface); + display: flex; + flex-direction: column; + font: var(--cros-body-1-font); + height: calc(100% - 64px); + justify-content: center; + outline: none; + padding: 32px; + position: relative; + text-align: center; + width: 100%; +} + +#innerContentPanel[type='audio'], +#innerContentPanel[type='image'], +#innerContentPanel[type='video'] { + align-self: center; +} + +.content { + height: 100%; + width: 100%; +} + +#toolbar { + align-items: center; + background-color: var(--cros-sys-app_base); + color: var(--cros-sys-on_surface); + display: flex; + font: var(--cros-title-1-font); + height: 56px; + margin: 0; + opacity: 1; + padding: 0; + z-index: 1; +} + +#file-path { + flex: 1; + margin-inline-end: 8px; + margin-inline-start: 8px; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; +} + +.buttons-group { + display: flex; +} + +cr-button { + --hover-bg-color: var(--cros-sys-hover_on_subtle); + --ink-color: var(--cros-sys-ripple_neutral_on_subtle); + --ripple-opacity: 100%; + --text-color: currentColor; + border: none; + border-radius: 12px; + box-shadow: none; + box-sizing: border-box; + height: 40px; + margin: 4px; + min-width: 40px; + padding: 0; + width: 40px; +} + +:host-context(html.pointer-active) cr-button:not(:active):hover { + --hover-bg-color: none; + cursor: unset; +} + +cr-button::after { + content: ''; + height: 48px; + position: absolute; + width: 48px; +} + +#back-button > .icon, +#open-button > .icon, +#delete-button > .icon, +#info-button > .icon { + -webkit-mask-position: center; + -webkit-mask-repeat: no-repeat; + background-color: currentColor; + background-image: none; + height: 36px; + width: 36px; +} + +iron-icon { + height: 16px; + width: 16px; +} + +#back-button > iron-icon { + display: none; +} + +#back-button > .icon { + -webkit-mask-image: url(../images/files/ui/back.svg); +} + +#open-button > .icon { + -webkit-mask-image: url(../images/files/ui/external_link.svg); +} + +#delete-button > .icon { + -webkit-mask-image: url(../images/files/ui/delete_ng.svg); + height: 16px; + width: 16px; +} + +#info-button { + --ink-color: var(--cros-sys-ripple_primary); +} + +#info-button[aria-pressed=true] { + background-color: var(--cros-sys-primary_container); + color: var(--cros-sys-on_primary_container); +} + +#info-button > .icon { + -webkit-mask-image: url(../images/files/ui/info.svg); +} + +:host-context(html.focus-outline-visible) cr-button:not(:active):focus { + outline: 2px solid var(--cros-sys-focus_ring); +} + +#metadata-box { + background-color: var(--cros-sys-app_base); + bottom: 0; + height: 100%; + margin: 0; + opacity: 1; + overflow-y: auto; + position: absolute; + right: 0; +} + +:host-context(html[dir='rtl']) #metadata-box { + left: 0; + right: auto; +} + +::-webkit-scrollbar { + background-color: var(--cros-sys-scrollbar); + width: 10px; +} + +::-webkit-scrollbar-thumb { + background-clip: content-box; + background-color: var(--cros-sys-scrollbar_hover); + border: 2.5px solid transparent; + width: 5px; +} + +[hidden] { + display: none; +} + +.no-preview { + margin-top: 16px; +} + +/* Large generic thumbnails, used when a file does not have a thumbnail. */ +[generic-thumbnail] { + -webkit-mask-image: url(../images/filetype/filetype_generic.svg); + -webkit-mask-position: center; + -webkit-mask-repeat: no-repeat; + -webkit-mask-size: auto 88px; + background-color: currentColor; + background-position: center; + background-repeat: no-repeat; + background-size: auto 88px; + height: 88px; +} + +[generic-thumbnail='.folder'] { + -webkit-mask-image: url(../images/filetype/filetype_folder.svg); + -webkit-mask-size: auto 72px; +} + +[generic-thumbnail='audio'] { + -webkit-mask-image: none; + background-color: transparent; + background-image: url(../images/filetype/filetype_audio.svg); +} + +[generic-thumbnail='image'] { + -webkit-mask-image: none; + background-color: transparent; + background-image: url(../images/filetype/filetype_image.svg); +} + +[generic-thumbnail='video'] { + -webkit-mask-image: none; + background-color: transparent; + background-image: url(../images/filetype/filetype_video.svg); + background-size: auto 72px; +}
diff --git a/ui/file_manager/file_manager/foreground/js/actions_model.js b/ui/file_manager/file_manager/foreground/js/actions_model.js index 20dc124..13d31ea 100644 --- a/ui/file_manager/file_manager/foreground/js/actions_model.js +++ b/ui/file_manager/file_manager/foreground/js/actions_model.js
@@ -100,7 +100,7 @@ execute() { // Open the Sharing dialog in a new window. chrome.fileManagerPrivate.getEntryProperties( - [this.entry_], ['shareUrl'], results => { + [util.unwrapEntry(this.entry_)], ['shareUrl'], results => { if (chrome.runtime.lastError) { console.error(chrome.runtime.lastError.message); return; @@ -530,7 +530,7 @@ */ execute() { chrome.fileManagerPrivate.getEntryProperties( - [this.entry_], ['alternateUrl'], results => { + [util.unwrapEntry(this.entry_)], ['alternateUrl'], results => { if (chrome.runtime.lastError) { console.error(chrome.runtime.lastError.message); return;
diff --git a/ui/file_manager/file_manager/foreground/js/metadata_update_controller.js b/ui/file_manager/file_manager/foreground/js/metadata_update_controller.js index 41fcdba..24f5cf9 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata_update_controller.js +++ b/ui/file_manager/file_manager/foreground/js/metadata_update_controller.js
@@ -71,7 +71,7 @@ // changed. const isFakeEntry = util.isFakeEntry(directoryEntry); const changedEntries = - (isFakeEntry ? [] : [directoryEntry]).concat(entries); + (isFakeEntry ? [] : [util.unwrapEntry(directoryEntry)]).concat(entries); this.metadataModel_.notifyEntriesChanged(changedEntries); // We don't pass callback here. When new metadata arrives, we have an
diff --git a/ui/file_manager/file_manager/foreground/js/toolbar_controller.js b/ui/file_manager/file_manager/foreground/js/toolbar_controller.js index 26ed978b..d70fadb 100644 --- a/ui/file_manager/file_manager/foreground/js/toolbar_controller.js +++ b/ui/file_manager/file_manager/foreground/js/toolbar_controller.js
@@ -12,6 +12,7 @@ import {Store} from '../../externs/ts/store.js'; import {VolumeManager} from '../../externs/volume_manager.js'; import {getStore} from '../../state/store.js'; +import {XfCloudPanel} from '../../widgets/xf_cloud_panel.js'; import {constants} from './constants.js'; import {DirectoryModel} from './directory_model.js'; @@ -286,8 +287,15 @@ if (util.isDriveFsBulkPinningEnabled()) { const cloudPanel = queryRequiredElement('xf-cloud-panel'); - this.cloudButton_.addEventListener( - 'click', () => cloudPanel.showAt(this.cloudButton_)); + this.cloudButton_.addEventListener('click', () => { + this.cloudButton_.toggleAttribute('menu-shown', true); + this.cloudButton_.toggleAttribute('aria-expanded', true); + cloudPanel.showAt(this.cloudButton_); + }); + cloudPanel.addEventListener(XfCloudPanel.events.PANEL_CLOSED, () => { + this.cloudButton_.toggleAttribute('menu-shown', false); + this.cloudButton_.toggleAttribute('aria-expanded', false); + }); /** @type {?boolean} */ this.bulkPinningPref_ = null; }
diff --git a/ui/file_manager/file_manager/main.html b/ui/file_manager/file_manager/main.html index fdbea984..128b90c 100644 --- a/ui/file_manager/file_manager/main.html +++ b/ui/file_manager/file_manager/main.html
@@ -402,9 +402,12 @@ </cr-input> </div> </div> - <cr-button id="cloud-button" class="icon-button menu-button" tabindex="0" hidden + <cr-button id="cloud-button" class="icon-button menu-button" + hidden + tabindex="0" + aria-haspopup="true" aria-label="Cloud Placeholder" - command="#cloud" has-tooltip> + has-tooltip> <xf-icon type="cloud" slot="prefix-icon"></xf-icon> <xf-icon slot="suffix-icon"></xf-icon> </cr-button>
diff --git a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts index 819766b..36c762a 100644 --- a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts +++ b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts
@@ -101,6 +101,7 @@ static get events() { return { DRIVE_SETTINGS_CLICKED: 'drive_settings_clicked', + PANEL_CLOSED: 'panel_closed', } as const; } @@ -119,7 +120,7 @@ * Show the element relative to the cloud icon that was clicked. */ showAt(el: HTMLElement) { - this.$panel_!.showAt(el, {top: el.offsetTop + el.offsetHeight + 8}); + this.$panel_!.showAt(el, {top: el.offsetTop + el.offsetHeight + 20}); } /** @@ -132,6 +133,21 @@ } /** + * Refires the close event to ensure it's a known `XfCloudPanel` event to + * subscribe to. + */ + override async connectedCallback() { + super.connectedCallback(); + await this.updateComplete; + this.$panel_!.addEventListener('close', () => { + this.dispatchEvent(new CustomEvent(XfCloudPanel.events.PANEL_CLOSED, { + bubbles: true, + composed: true, + })); + }); + } + + /** * Handles click events for the Google Drive settings button. This emits the * event to be handled by the container. */ @@ -190,10 +206,8 @@ </div> </div> <div class="divider"></div> - <div class="menu"> - <button class="action" @click=${this.onSettingsClicked_}>${ + <button class="action" @click=${this.onSettingsClicked_}>${ str('GOOGLE_DRIVE_SETTINGS_LINK')}</button> - </div> </div> </cr-action-menu>`; } @@ -228,6 +242,7 @@ } .body { + background-color: var(--cros-sys-base_elevated); display: flex; flex-direction: column; margin: -8px 0; @@ -241,7 +256,7 @@ } xf-icon { - padding: 27px 0px 20px; + padding: 27px 0px 8px; } xf-icon[type="bulk_pinning_done"] { @@ -258,7 +273,7 @@ .status-description { color: var(--cros-text-color-secondary); - font-size: 13px; + font: var(--cros-annotation-1-font); line-height: 20px; padding: 0px 16px 20px; text-align: center; @@ -266,8 +281,7 @@ .progress { color: var(--cros-text-color-primary); - font-size: 13px; - font-weight: 500; + font: var(--cros-button-2-font); line-height: 20px; margin-inline: 16px; padding-top: 20px; @@ -275,12 +289,12 @@ .progress-description { color: var(--cros-text-color-secondary); + font: var(--cros-annotation-1-font); padding-bottom: 20px; padding-inline: 16px; } .progress-bar { - background-color: var(--cros-sys-primary_container); border-radius: 10px; height: 4px; margin: 8px 0 8px; @@ -289,6 +303,7 @@ } progress::-webkit-progress-bar { + background-color: var(--cros-sys-primary_container); border-radius: 10px; } @@ -306,6 +321,11 @@ button.action { background-color: var(--cros-sys-base_elevated); border: 0; + font: var(--cros-button-2-font); + height: 52px; + padding-bottom: 8px; + padding-inline: 16px; + padding-top: 8px; text-align: left; } @@ -314,29 +334,23 @@ } .action { - font-size: 13px; - font-weight: 500; - line-height: 8px; - padding: 20px 0 20px; - padding-inline: 16px; width: 100%; } .action:hover { background: var(--cros-sys-hover_on_subtle); } - - .menu { - height: 48px; - } `; } export type CloudPanelSettingsClickEvent = CustomEvent; +export type CloudPanelCloseEvent = CustomEvent; + declare global { interface HTMLElementEventMap { [XfCloudPanel.events.DRIVE_SETTINGS_CLICKED]: CloudPanelSettingsClickEvent; + [XfCloudPanel.events.PANEL_CLOSED]: CloudPanelCloseEvent; } interface HTMLElementTagNameMap {
diff --git a/ui/file_manager/file_manager_resources.grd b/ui/file_manager/file_manager_resources.grd index 422d873..7ef727a 100644 --- a/ui/file_manager/file_manager_resources.grd +++ b/ui/file_manager/file_manager_resources.grd
@@ -13,6 +13,7 @@ <includes> <!-- Polymer elements --> <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_QUICK_PREVIEW_CSS" file="file_manager/foreground/elements/files_quick_view.css" type="BINDATA" /> + <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_QUICK_PREVIEW_GM3_CSS" file="file_manager/foreground/elements/files_quick_view_gm3.css" type="BINDATA" /> <!-- Images referenced from the manifest or the code --> <include name="IDR_FILE_MANAGER_ICON_16" file="file_manager/common/images/icon16.png" type="BINDATA" />
diff --git a/ui/file_manager/integration_tests/file_manager/drive_specific.js b/ui/file_manager/integration_tests/file_manager/drive_specific.js index cdbf1639..da0ae65f 100644 --- a/ui/file_manager/integration_tests/file_manager/drive_specific.js +++ b/ui/file_manager/integration_tests/file_manager/drive_specific.js
@@ -1329,3 +1329,60 @@ await remoteCall.waitForElement( appId, '[command="#toggle-pinned"]:not([hidden][disabled])'); }; + +/** + * Tests that when bulk pinning is enabled, the "Available offline" toggle + * should not be visible. When the preference is updated, the toggle should + * reappear. + */ +testcase.driveFolderShouldShowOfflineTickWhenBulkPinningEnabled = async () => { + const appId = await setupAndWaitUntilReady( + RootPath.DRIVE, [], + [ENTRIES.directoryA, ENTRIES.directoryB, ENTRIES.linkGtoB]); + + // Wait for the directory "A" to not have the pinned class attached. + await remoteCall.waitForElement( + appId, '#file-list [file-name="A"]:not(.pinned)'); + + // Mock the free space returned by spaced to be 1 GB and enable the bulk + // pinning preference + await sendTestMessage({name: 'setSpacedFreeSpace', freeSpace: 1 << 30}); + await sendTestMessage({name: 'setBulkPinningEnabledPref', enabled: true}); + + // Wait for the folder to show up as pinned (the underlying folder will not + // actually get pinned but the class should still be added). + await remoteCall.waitForElement(appId, '#file-list [file-name="A"].pinned'); + + // Shortcuts should get excluded from the above logic and should remain the + // same as they were initially (in this case unpinned). + await remoteCall.waitForElement( + appId, '#file-list [file-name="G"]:not(.pinned)'); + + // Disable the bulk pinning preference and wait for the folder to lose the + // pinned class. + await sendTestMessage({name: 'setBulkPinningEnabledPref', enabled: false}); + await remoteCall.waitForElement( + appId, '#file-list [file-name="A"]:not(.pinned)'); + + // Show the context menu for the "A" directory and click the pinning command. + await remoteCall.showContextMenuFor(appId, 'A'); + await remoteCall.waitAndClickElement( + appId, + '#file-context-menu:not([hidden]) ' + + '[command="#toggle-pinned"]:not([checked])'); + + // Wait for the element to receive the pinned class from the explicit pinning + // action then enable the bulk pinning feature. + await remoteCall.waitForElement(appId, '#file-list [file-name="A"].pinned'); + await sendTestMessage({name: 'setBulkPinningEnabledPref', enabled: true}); + + // The folder should not lose it's pinning status when the pinning manager + // enters the Syncing state. + await remoteCall.waitForBulkPinningStage('Syncing'); + await remoteCall.waitForElement(appId, '#file-list [file-name="A"].pinned'); + + // Disable the bulk pinning preference and ensure the folder retains its + // pinned state. + await sendTestMessage({name: 'setBulkPinningEnabledPref', enabled: false}); + await remoteCall.waitForElement(appId, '#file-list [file-name="A"].pinned'); +};
diff --git a/ui/file_manager/integration_tests/file_manager/search.js b/ui/file_manager/integration_tests/file_manager/search.js index f6158fe..233d870 100644 --- a/ui/file_manager/integration_tests/file_manager/search.js +++ b/ui/file_manager/integration_tests/file_manager/search.js
@@ -743,6 +743,15 @@ ]); chrome.test.assertTrue(threeFilesSelectedPath.hidden); chrome.test.assertEq('', threeFilesSelectedPath.attributes.path); + + // Close search. Select any file. Confirm that the path display is not shown, + // now that the search is inactive. + await remoteCall.waitAndClickElement(appId, '#search-box .clear'); + await remoteCall.waitUntilSelected(appId, ENTRIES.hello.nameText); + const pathDisplayWhileNotSearching = await remoteCall.waitForElement(appId, [ + 'xf-path-display', + ]); + chrome.test.assertTrue(pathDisplayWhileNotSearching.hidden); }; /**
diff --git a/ui/file_manager/integration_tests/file_manager/toolbar.js b/ui/file_manager/integration_tests/file_manager/toolbar.js index 8d572172..92f226d 100644 --- a/ui/file_manager/integration_tests/file_manager/toolbar.js +++ b/ui/file_manager/integration_tests/file_manager/toolbar.js
@@ -562,15 +562,17 @@ // Mock the free space returned by spaced to be 1 GB. await sendTestMessage( {name: 'setSpacedFreeSpace', freeSpace: 1024 * 1024 * 1024}); + await sendTestMessage({name: 'setBulkPinningEnabledPref', enabled: true}); // Set the bulk pinning manager to enter offline mode. This will surface a - // `PAUSED` state which has a UI representation iff the pref is enabled. This - // is done to ensure the bulk pinning doesn't finish before our assertions are - // able to run (small amount of test files make this finish super quick). + // `PAUSED` state which has a UI representation iff the pref is enabled. + // This is done to ensure the bulk pinning doesn't finish before our + // assertions are able to run (small amount of test files make this finish + // super quick). await sendTestMessage({name: 'setBulkPinningOnline', enabled: false}); - // Force the bulk pinning to calculate required space which will kick it into - // a `PAUSED` state from a `STOPPED` state. + // Force the bulk pinning to calculate required space which will kick it + // into a `PAUSED` state from a `STOPPED` state. await sendTestMessage({name: 'forceBulkPinningCalculateRequiredSpace'}); // Assert the stage is `PAUSED` and the cloud button is still hidden.
diff --git a/ui/webui/resources/mojo/bindings.d.ts b/ui/webui/resources/mojo/bindings.d.ts index bb2d3a3..1d844ce 100644 --- a/ui/webui/resources/mojo/bindings.d.ts +++ b/ui/webui/resources/mojo/bindings.d.ts
@@ -164,6 +164,12 @@ valueNullable: boolean): MojomType; function Enum(): MojomType; + interface NullableValueKindProperties { + isPrimaryNullableValueKindField: boolean; + linkedValueFieldName?: string; + originalFieldName: string; + } + interface StructFieldSpec { name: string; packedOffset: number; @@ -172,12 +178,15 @@ defaultValue: any; nullable: boolean; minVersion: number; + nullableValueKindProperties?: NullableValueKindProperties; } function StructField( name: string, packedOffset: number, packedBitOffset: number, type: MojomType, defaultValue: any, nullable: boolean, - minVersion?: number): StructFieldSpec; + minVersion?: number, + nullableValueKindProperites?: NullableValueKindProperties): + StructFieldSpec; function Struct( objectToBlessAsType: object, name: string, fields: StructFieldSpec[],