diff --git a/DEPS b/DEPS index 08627639..9c1acc73 100644 --- a/DEPS +++ b/DEPS
@@ -276,7 +276,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '7a7ac80a328065cac1905dae0f019dee50e2ca76', + 'src_internal_revision': '72be70e45c7b591f2804381c1ec404d5438e255f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. @@ -284,11 +284,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': 'd0992c4954f47858b3996d9cd34e0f948be36a1e', + 'v8_revision': '74791e7b7c09202a9104057e21f96f871d697c51', # 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': 'bc40362b76d834549424022530a5e11933ff4862', + 'angle_revision': 'f102ef023fcb279daa667c7ab80d72c533869c98', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -356,7 +356,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. - 'crossbench_revision': 'c93bea889b459f2b52c7c50dd1b4256364eededf', + 'crossbench_revision': '83b2874726e75c60c99970ed87e862ca05302b28', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -372,7 +372,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'ee8f643d9a460e41a2e2d480f2e502c17c86fb00', + 'devtools_frontend_revision': 'f9f582e701a85326159c113c22d3a3e4a5f20e1d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -396,7 +396,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': '18f45d0373057395c9875b455035ef19ca6a655c', + 'dawn_revision': 'c77cb9bbcd295604893576d3f3377d61ca916243', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -496,11 +496,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling llvm-libc # and whatever else without interference from each other. - 'llvm_libc_revision': 'd499ef8787d8b9183a3a715c9073b366344fba47', + 'llvm_libc_revision': '99782c3117bf68302f6d9080d70ac5bd86fa72f6', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. - 'libcxx_revision': 'd3d825f7b3bb685545dcfa6c9d797631a49ade61', + 'libcxx_revision': 'e36be6784f33c592ecc89da2a829807920d374ef', # GN CIPD package version. 'gn_version': 'git_revision:ed1abc107815210dc66ec439542bee2f6cbabc00', @@ -1123,7 +1123,7 @@ }, 'src/chrome/release_scripts': { - 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + 'e54cd72a13e2b29fc1ddeee1e1b0553bfd034594', + 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + '3786319b49d5388118898d6ef740f9d73239f7c3', 'condition': 'checkout_chrome_release_scripts', }, @@ -1452,7 +1452,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '5ba3a0efeedf8dfa0fd609ba309bcd7206ba69e3', + '8ce502b458bbec661860869adc2fe1dd18decfc8', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1611,7 +1611,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '8Lvm0dWvOzqAyYTrr0ZeIV3XNDBWvOfZ0V9t-sQPAmkC', + 'version': 'WQP_3VSZIlHutyvh9iEePkeKRMt8HhX4s8kh6W2249QC', }, ], 'condition': 'checkout_android and non_git_source', @@ -1917,7 +1917,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'ac866df70cfddf7ff80b63533a30748532e5f8bf', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '12ceb773ef2dd7811e99028fcae74b162abe78c3', 'condition': 'checkout_chromeos', }, @@ -1947,7 +1947,7 @@ 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'e69b086c0f3764fe1211435b297f793e02ecd13e', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'ee429f3694c51421c8b2f2af52049102ef43bca9', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -2449,7 +2449,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '26425fcdd18c91a10f59740765c53c5079cf61e3', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'dfcfdc9c283446ef3ad6036398790c842d458bb0', 'src/base/tracing/test/data': { 'bucket': 'perfetto', @@ -2817,7 +2817,7 @@ Var('chromium_git') + '/webpagereplay.git' + '@' + Var('webpagereplay_revision'), 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '4aaaa6848bc2521f0ab75a46c4bfeaf68b8b9ffb', + Var('webrtc_git') + '/src.git' + '@' + '69dc7f7576d5d26252124dde2b762af4dd22d7db', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2936,7 +2936,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/boca_app/app', - 'version': 'zzByR0ogjBlDBFS98KJrLILiAbm4KJpZuicB7T2Jh3gC', + 'version': 'QjgXlUuFORCUw_8p0nx2Hw1O7T3ZYOzDDN3CkKOsrw0C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2991,7 +2991,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'Y-81cTkmUdGf69exuMxTcIA8WQc3mSFxOg-bBm2TyNcC', + 'version': 'mCFtIekQ0WhXGtdK4QEsplxjH9zNNw13eT3tkC74pbUC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4479,7 +4479,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '89e7fca303aaea70284cc77d91f03c69c3883f3e', + '4e185f6350b47d631b33b5c5fcb8bc359e402990', 'condition': 'checkout_src_internal', }, @@ -4545,7 +4545,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '6444bdf131517e4efff8b82981cdc601b2e92e47', + 'd2f432ee9ef21f7d2fe9702faa2b390d90ebc370', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 4931b2a..9db81f35 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -438,6 +438,15 @@ // Controls enabling/disabling the coral feature. BASE_FEATURE(kCoralFeature, "CoralFeature", base::FEATURE_DISABLED_BY_DEFAULT); +// Since kCoralFeature is also controlled by login_manager, finch kill switch +// could not effectively control it. The kCoralFeatureAllowed is designed to be +// always enabled by default, but can be disabled by the finch kill switch. When +// disabled, this overrides kCoralFeature's status and force disables the +// feature. +BASE_FEATURE(kCoralFeatureAllowed, + "CoralFeatureAllowed", + base::FEATURE_ENABLED_BY_DEFAULT); + // Enables execution of routine for copying client keys and certs from NSS DB to // software backed Chaps slot. It's only respected if the // EnableNssDbClientCertsRollback feature flag is disabled. @@ -3421,7 +3430,8 @@ } bool IsCoralFeatureEnabled() { - return base::FeatureList::IsEnabled(kCoralFeature); + return base::FeatureList::IsEnabled(kCoralFeature) && + base::FeatureList::IsEnabled(kCoralFeatureAllowed); } bool IsCryptauthAttestationSyncingEnabled() {
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 1e5112ac..bb495f0f 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -139,6 +139,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kCopyClientKeysCertsToChaps); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kCoralFeature); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kCoralFeatureAllowed); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kCrosPrivacyHub); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kCrosPrivacyHubAppPermissionsV2); @@ -1065,7 +1066,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsContinuousOverviewScrollAnimationEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCoralFeatureEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCoralFeatureEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCopyClientKeysCertsToChapsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCrosPrivacyHubAppPermissionsV2Enabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCrosPrivacyHubLocationEnabled();
diff --git a/ash/constants/generative_ai_country_restrictions.cc b/ash/constants/generative_ai_country_restrictions.cc index f0a33206..db0f4f3 100644 --- a/ash/constants/generative_ai_country_restrictions.cc +++ b/ash/constants/generative_ai_country_restrictions.cc
@@ -8,28 +8,34 @@ namespace ash { -bool IsGenerativeAiAllowedForCountry(std::string_view country_code) { - constexpr auto kCountryAllowlist = base::MakeFixedFlatSet<std::string_view>( - {"ae", "ag", "ai", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "az", - "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", - "bq", "br", "bs", "bt", "bw", "bz", "ca", "cc", "cd", "cf", "cg", "ch", - "ci", "ck", "cl", "cm", "co", "cr", "cv", "cw", "cx", "cy", "cz", "de", - "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", - "fi", "fj", "fk", "fm", "fr", "ga", "gb", "gd", "ge", "gg", "gh", "gi", - "gm", "gn", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hm", "hn", "hr", - "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "is", "it", "je", - "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kr", "kw", "ky", - "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", - "ma", "mg", "mh", "ml", "mn", "mp", "mr", "ms", "mt", "mu", "mv", "mw", - "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", - "nr", "nu", "nz", "om", "pa", "pe", "pg", "ph", "pk", "pl", "pm", "pn", - "pr", "ps", "pt", "pw", "py", "qa", "ro", "rw", "sa", "sb", "sc", "sd", - "se", "sg", "sh", "si", "sk", "sl", "sn", "so", "sr", "ss", "st", "sv", - "sz", "tc", "td", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", - "tt", "tv", "tw", "tz", "ug", "um", "us", "uy", "uz", "vc", "ve", "vg", - "vi", "vn", "vu", "wf", "ws", "ye", "za", "zm", "zw"}); +namespace { +constexpr auto kCountryAllowlist = base::MakeFixedFlatSet<std::string_view>( + {"ae", "ag", "ai", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "az", + "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", + "bq", "br", "bs", "bt", "bw", "bz", "ca", "cc", "cd", "cf", "cg", "ch", + "ci", "ck", "cl", "cm", "co", "cr", "cv", "cw", "cx", "cy", "cz", "de", + "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", + "fi", "fj", "fk", "fm", "fr", "ga", "gb", "gd", "ge", "gg", "gh", "gi", + "gm", "gn", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hm", "hn", "hr", + "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "is", "it", "je", + "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kr", "kw", "ky", + "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", + "ma", "mg", "mh", "ml", "mn", "mp", "mr", "ms", "mt", "mu", "mv", "mw", + "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", + "nr", "nu", "nz", "om", "pa", "pe", "pg", "ph", "pk", "pl", "pm", "pn", + "pr", "ps", "pt", "pw", "py", "qa", "ro", "rw", "sa", "sb", "sc", "sd", + "se", "sg", "sh", "si", "sk", "sl", "sn", "so", "sr", "ss", "st", "sv", + "sz", "tc", "td", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", + "tt", "tv", "tw", "tz", "ug", "um", "us", "uy", "uz", "vc", "ve", "vg", + "vi", "vn", "vu", "wf", "ws", "ye", "za", "zm", "zw"}); +} +bool IsGenerativeAiAllowedForCountry(std::string_view country_code) { return kCountryAllowlist.contains(country_code); } +std::vector<std::string> GetGenerativeAiCountryAllowlist() { + return {kCountryAllowlist.begin(), kCountryAllowlist.end()}; +} + } // namespace ash
diff --git a/ash/constants/generative_ai_country_restrictions.h b/ash/constants/generative_ai_country_restrictions.h index 8593562..fcf4e0e9 100644 --- a/ash/constants/generative_ai_country_restrictions.h +++ b/ash/constants/generative_ai_country_restrictions.h
@@ -6,6 +6,7 @@ #define ASH_CONSTANTS_GENERATIVE_AI_COUNTRY_RESTRICTIONS_H_ #include <string> +#include <vector> #include "base/component_export.h" @@ -15,6 +16,9 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsGenerativeAiAllowedForCountry(std::string_view country_code); +COMPONENT_EXPORT(ASH_CONSTANTS) +std::vector<std::string> GetGenerativeAiCountryAllowlist(); + } // namespace ash #endif // ASH_CONSTANTS_GENERATIVE_AI_COUNTRY_RESTRICTIONS_H_
diff --git a/ash/fast_ink/fast_ink_host.cc b/ash/fast_ink/fast_ink_host.cc index d011435..50e81ae 100644 --- a/ash/fast_ink/fast_ink_host.cc +++ b/ash/fast_ink/fast_ink_host.cc
@@ -23,7 +23,6 @@ #include "gpu/command_buffer/client/client_shared_image.h" #include "gpu/command_buffer/common/shared_image_capabilities.h" #include "gpu/command_buffer/common/shared_image_usage.h" -#include "gpu/config/gpu_finch_features.h" #include "ui/aura/window_tree_host.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" @@ -140,18 +139,7 @@ gpu::SHARED_IMAGE_USAGE_DISPLAY_READ | gpu::SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE; - bool add_scanout_usage = true; - - // Scanout usage should be added only if scanout of SharedImages is supported. - // However, historically this was not checked. - // TODO(crbug.com/330865436): Remove killswitch post-safe rollout. - if (base::FeatureList::IsEnabled( - ::features:: - kFastInkHostAddScanoutUsageOnlyIfSupportedBySharedImage)) { - add_scanout_usage &= sii->GetCapabilities().supports_scanout_shared_images; - } - - if (add_scanout_usage) { + if (sii->GetCapabilities().supports_scanout_shared_images) { usage |= gpu::SHARED_IMAGE_USAGE_SCANOUT; }
diff --git a/ash/rounded_display/rounded_display_frame_factory.cc b/ash/rounded_display/rounded_display_frame_factory.cc index 7001577..824d8d5 100644 --- a/ash/rounded_display/rounded_display_frame_factory.cc +++ b/ash/rounded_display/rounded_display_frame_factory.cc
@@ -26,7 +26,6 @@ #include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/common/shared_image_capabilities.h" #include "gpu/command_buffer/common/shared_image_usage.h" -#include "gpu/config/gpu_finch_features.h" #include "ipc/common/surface_handle.h" #include "ui/aura/env.h" #include "ui/aura/window.h" @@ -139,18 +138,7 @@ gpu::SharedImageUsageSet usage = gpu::SHARED_IMAGE_USAGE_DISPLAY_READ; - bool add_scanout_usage = is_overlay; - - // Scanout usage should be added only if scanout of SharedImages is supported. - // However, historically this was not checked. - // TODO(crbug.com/330865436): Remove killswitch post-safe rollout. - if (base::FeatureList::IsEnabled( - features:: - kRoundedDisplayAddScanoutUsageOnlyIfSupportedBySharedImage)) { - add_scanout_usage &= sii->GetCapabilities().supports_scanout_shared_images; - } - - if (add_scanout_usage) { + if (is_overlay && sii->GetCapabilities().supports_scanout_shared_images) { usage |= gpu::SHARED_IMAGE_USAGE_SCANOUT; }
diff --git a/ash/system/notification_center/session_state_notification_blocker.cc b/ash/system/notification_center/session_state_notification_blocker.cc index 9b01959..95066d11 100644 --- a/ash/system/notification_center/session_state_notification_blocker.cc +++ b/ash/system/notification_center/session_state_notification_blocker.cc
@@ -10,6 +10,7 @@ #include "ash/system/do_not_disturb_notification_controller.h" #include "ash/system/lock_screen_notification_controller.h" #include "ash/system/power/battery_notification.h" +#include "ash/system/privacy/screen_security_controller.h" #include "base/containers/contains.h" #include "chromeos/ash/components/policy/restriction_schedule/device_restriction_schedule_controller_delegate_impl.h" #include "ui/message_center/message_center.h" @@ -129,6 +130,13 @@ return false; } + // Always show remote activity notification (which also acts as a privacy + // indicator) irrespective of the session state (except when running in + // app mode). + if (notification.id() == ash::kRemotingScreenShareNotificationId) { + return true; + } + const SessionState session_state = Shell::Get()->session_controller()->GetSessionState(); // Do not show the "Do not disturb" notification if there is no active @@ -179,6 +187,13 @@ return false; } + // Always show remote activity notification (which also acts as a privacy + // indicator) irrespective of the session state (except when running in + // app mode). + if (notification.id() == ash::kRemotingScreenShareNotificationId) { + return true; + } + if (IsAllowedDuringOOBE(notification.id())) { return true; }
diff --git a/ash/system/notification_center/session_state_notification_blocker_unittest.cc b/ash/system/notification_center/session_state_notification_blocker_unittest.cc index c64d50c..1acc94f 100644 --- a/ash/system/notification_center/session_state_notification_blocker_unittest.cc +++ b/ash/system/notification_center/session_state_notification_blocker_unittest.cc
@@ -14,10 +14,12 @@ #include "ash/system/do_not_disturb_notification_controller.h" #include "ash/system/lock_screen_notification_controller.h" #include "ash/system/power/battery_notification.h" +#include "ash/system/privacy/screen_security_controller.h" #include "ash/system/system_notification_controller.h" #include "ash/test/ash_test_base.h" #include "base/strings/utf_string_conversions.h" #include "chromeos/ash/components/policy/restriction_schedule/device_restriction_schedule_controller_delegate_impl.h" +#include "components/session_manager/session_manager_types.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -123,6 +125,16 @@ CreateDummyNotification(notification_id)); } + bool ShouldShowRemoteScreenSharingNotification() { + return blocker_->ShouldShowNotification( + CreateDummyNotification(ash::kRemotingScreenShareNotificationId)); + } + + bool ShouldShowRemoteScreenSharingNotificationAsPopup() { + return blocker_->ShouldShowNotificationAsPopup( + CreateDummyNotification(ash::kRemotingScreenShareNotificationId)); + } + void SetLockedState(bool locked) { GetSessionControllerClient()->SetSessionState( locked ? SessionState::LOCKED : SessionState::ACTIVE); @@ -344,4 +356,18 @@ } } +TEST_F(SessionStateNotificationBlockerTest, + AlwaysAllowRemoteScreenShareNotification) { + EXPECT_TRUE(ShouldShowRemoteScreenSharingNotification()); + EXPECT_TRUE(ShouldShowRemoteScreenSharingNotificationAsPopup()); +} + +TEST_F(SessionStateNotificationBlockerTest, + ShouldNotAllowRemoteScreenShareNotificationDuringKioskSession) { + SimulateKioskMode(user_manager::UserType::kKioskApp); + + EXPECT_FALSE(ShouldShowRemoteScreenSharingNotification()); + EXPECT_FALSE(ShouldShowRemoteScreenSharingNotificationAsPopup()); +} + } // namespace ash
diff --git a/ash/webui/recorder_app_ui/resources.h b/ash/webui/recorder_app_ui/resources.h index ce90633..bb228d77 100644 --- a/ash/webui/recorder_app_ui/resources.h +++ b/ash/webui/recorder_app_ui/resources.h
@@ -65,6 +65,12 @@ IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_BUTTON_ARIA_LABEL}, {"languagePickerLanguageDownloadErrorAriaLabel", IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_ARIA_LABEL}, + {"languagePickerLanguageDownloadErrorStatusMessage", + IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_STATUS_MESSAGE}, + {"languagePickerLanguageDownloadFinishedStatusMessage", + IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_FINISHED_STATUS_MESSAGE}, + {"languagePickerLanguageDownloadStartedStatusMessage", + IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_STARTED_STATUS_MESSAGE}, {"languagePickerLanguageDownloadingAriaLabel", IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOADING_ARIA_LABEL}, {"languagePickerLanguageDownloadingButton",
diff --git a/ash/webui/recorder_app_ui/resources/components/language-list-item.ts b/ash/webui/recorder_app_ui/resources/components/language-list-item.ts index b621ec86..f509509 100644 --- a/ash/webui/recorder_app_ui/resources/components/language-list-item.ts +++ b/ash/webui/recorder_app_ui/resources/components/language-list-item.ts
@@ -7,17 +7,20 @@ import './cra/cra-button.js'; import './cra/cra-icon.js'; import './settings-row.js'; +import './spoken-message.js'; import { css, html, nothing, PropertyDeclarations, + PropertyValues, } from 'chrome://resources/mwc/lit/index.js'; import {i18n} from '../core/i18n.js'; import {ModelState} from '../core/on_device_model/types.js'; import {ReactiveLitElement} from '../core/reactive/lit.js'; +import {signal} from '../core/reactive/signal.js'; import {LangPackInfo} from '../core/soda/language_info.js'; import { assertExhaustive, @@ -77,6 +80,18 @@ sodaState: ModelState = {kind: 'unavailable'}; + private readonly stateChanged = signal(false); + + // Announces status in the next render cycle. + override updated(changedProperties: PropertyValues<this>): void { + const state = changedProperties.get('sodaState'); + if (state === undefined || state.kind === 'unavailable') { + this.stateChanged.value = false; + } else { + this.stateChanged.value = true; + } + } + private onDownload() { if (this.langPackInfo === null) { return; @@ -121,6 +136,40 @@ } } + private renderStatusMessage(): RenderResult { + if (!this.stateChanged.value) { + return nothing; + } + const kind = this.sodaState.kind; + const name = assertExists(this.langPackInfo).displayName; + switch (kind) { + case 'error': + return html` + <spoken-message slot="status" role="status" aria-live="polite"> + ${i18n.languagePickerLanguageDownloadErrorStatusMessage(name)} + </spoken-message> + `; + case 'installing': + return html` + <spoken-message slot="status" role="status" aria-live="polite"> + ${i18n.languagePickerLanguageDownloadStartedStatusMessage(name)} + </spoken-message> + `; + case 'installed': + return html` + <spoken-message slot="status" role="status" aria-live="polite"> + ${i18n.languagePickerLanguageDownloadFinishedStatusMessage(name)} + </spoken-message> + `; + case 'notInstalled': + return nothing; + case 'unavailable': + return assertNotReached('SODA unavailable but the row is rendered'); + default: + return assertExhaustive(kind); + } + } + private renderDescriptionAndAction(): RenderResult { const name = assertExists(this.langPackInfo).displayName; const downloadButtonAriaLabel = @@ -241,6 +290,7 @@ ${this.langPackInfo.displayName} </span> ${this.renderDescriptionAndAction()} + ${this.renderStatusMessage()} </settings-row> ${this.isFocusable() ? html`<md-focus-ring></md-focus-ring>` : nothing} </div>
diff --git a/ash/webui/recorder_app_ui/resources/components/settings-menu.ts b/ash/webui/recorder_app_ui/resources/components/settings-menu.ts index bd37e410..fd743cf 100644 --- a/ash/webui/recorder_app_ui/resources/components/settings-menu.ts +++ b/ash/webui/recorder_app_ui/resources/components/settings-menu.ts
@@ -215,6 +215,42 @@ }); } + private renderSummaryModelDownloadStatus() { + const state = this.platformHandler.summaryModelLoader.state.value.kind; + switch (state) { + case 'unavailable': + return assertNotReached( + 'Summary model unavailable but the setting is rendered.', + ); + case 'notInstalled': + return nothing; + case 'error': + // TODO: b/395788668 - Render error state. + return nothing; + case 'installed': + if (!this.summaryDownloadRequested.value) { + return nothing; + } + return html` + <spoken-message + slot="status" + role="status" + aria-live="polite" + > + ${i18n.summaryDownloadFinishedStatusMessage} + </spoken-message> + `; + case 'installing': + return html` + <spoken-message slot="status" role="status" aria-live="polite"> + ${i18n.summaryDownloadStartedStatusMessage} + </spoken-message> + `; + default: + return assertExhaustive(state); + } + } + private renderSummaryModelDescriptionAndAction() { const state = this.platformHandler.summaryModelLoader.state.value; if (state.kind === 'notInstalled') { @@ -255,13 +291,6 @@ if (!this.summaryEnabled) { return summaryToggle; } - const downloadedStatus = html`<spoken-message - slot="status" - role="status" - aria-live="polite" - > - ${i18n.summaryDownloadFinishedStatusMessage} - </spoken-message>`; switch (state.kind) { case 'unavailable': @@ -269,7 +298,7 @@ 'Summary model unavailable but the setting is rendered.', ); case 'error': - // TODO: b/344784638 - Render error state. + // TODO: b/395788668 - Render error state. return nothing; case 'installing': { const progressDescription = @@ -287,16 +316,10 @@ <md-circular-progress indeterminate slot="leading-icon"> </md-circular-progress> </cra-button> - <spoken-message slot="status" role="status" aria-live="polite"> - ${i18n.summaryDownloadStartedStatusMessage} - </spoken-message> `; } case 'installed': - return [ - summaryToggle, - this.summaryDownloadRequested.value ? downloadedStatus : nothing, - ]; + return summaryToggle; default: assertExhaustive(state.kind); } @@ -311,6 +334,7 @@ <settings-row> <span slot="label">${i18n.settingsOptionsSummaryLabel}</span> ${this.renderSummaryModelDescriptionAndAction()} + ${this.renderSummaryModelDownloadStatus()}} </settings-row> `; }
diff --git a/ash/webui/recorder_app_ui/resources/core/i18n.ts b/ash/webui/recorder_app_ui/resources/core/i18n.ts index 3227177..89d36327 100644 --- a/ash/webui/recorder_app_ui/resources/core/i18n.ts +++ b/ash/webui/recorder_app_ui/resources/core/i18n.ts
@@ -228,6 +228,9 @@ // then `i18n.fooBar(1, '2')` works. languagePickerLanguageDownloadButtonAriaLabel: withArgs<[string]>(), languagePickerLanguageDownloadErrorAriaLabel: withArgs<[string]>(), + languagePickerLanguageDownloadErrorStatusMessage: withArgs<[string]>(), + languagePickerLanguageDownloadFinishedStatusMessage: withArgs<[string]>(), + languagePickerLanguageDownloadStartedStatusMessage: withArgs<[string]>(), languagePickerLanguageDownloadingAriaLabel: withArgs<[string, number]>(), languagePickerLanguageDownloadingProgressDescription: withArgs<[number]>(), languagePickerLanguageNotDownloadedAriaLabel: withArgs<[string]>(),
diff --git a/base/strings/string_util.h b/base/strings/string_util.h index 971fddea..9900d91 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h
@@ -244,9 +244,9 @@ kWhitespaceNoCrLfUTF16[]; // Unicode w/o CR/LF. BASE_EXPORT extern const char kWhitespaceASCII[]; BASE_EXPORT extern const char16_t kWhitespaceASCIIAs16[]; // No unicode. - // + // https://infra.spec.whatwg.org/#ascii-whitespace -BASE_EXPORT extern const char kInfraAsciiWhitespace[]; +inline constexpr char kInfraAsciiWhitespace[] = {0x09, 0x0A, 0x0C, 0x0D, 0x20}; // Null-terminated string representing the UTF-8 byte order mark. BASE_EXPORT extern const char kUtf8ByteOrderMark[];
diff --git a/base/strings/string_util_constants.cc b/base/strings/string_util_constants.cc index 9f1510fd..b570f35d 100644 --- a/base/strings/string_util_constants.cc +++ b/base/strings/string_util_constants.cc
@@ -49,8 +49,6 @@ const char kWhitespaceASCII[] = {WHITESPACE_ASCII, 0}; const char16_t kWhitespaceASCIIAs16[] = {WHITESPACE_ASCII, 0}; -const char kInfraAsciiWhitespace[] = {0x09, 0x0A, 0x0C, 0x0D, 0x20, 0}; - const char kUtf8ByteOrderMark[] = "\xEF\xBB\xBF"; } // namespace base
diff --git a/build/config/siso/ar.star b/build/config/siso/ar.star index 951154e..509f7ad7 100644 --- a/build/config/siso/ar.star +++ b/build/config/siso/ar.star
@@ -37,7 +37,6 @@ return data + "\n" def __ar_create(ctx, wd, ins): - """Creates a thin archive without a symbol table.""" data = "!<thin>\n" offset = {} content = "" @@ -53,30 +52,7 @@ data += __file_header(__ref_fname(offset, fname), size) return bytes(data) -def __ar_entries(ctx, fname, build_dir): - """Read entries from a thin archive. """ - - # TODO: It may take long time to read an entire archive. - # Is it better to read only the first X bytes? - lines = str(ctx.fs.read(fname)).splitlines() - lib_dir = path.rel(build_dir, path.dir(fname)) - ents = [] - if not len(lines): - print("warning: empty archive. `%s`" % fname) - return [] - if not lines[0].startswith("!<thin>"): - print("not thin archive. `%s`" % fname) - return [] - for l in lines: - l.strip() - if l.endswith(".obj/") or l.endswith(".o/"): - ents.append(path.join(lib_dir, l.removesuffix("/"))) - if l.endswith(".lib/") or l.endswith(".a/"): - fail("nested archive is not supported, yet. found `%s` in `%s`" % (l, fname)) - return ents - ar = module( "ar", create = __ar_create, - entries = __ar_entries, )
diff --git a/build/config/siso/clang_all.star b/build/config/siso/clang_all.star index db65945..82005cf 100644 --- a/build/config/siso/clang_all.star +++ b/build/config/siso/clang_all.star
@@ -4,10 +4,7 @@ # found in the LICENSE file. """Siso configuration for clang.""" -load("@builtin//path.star", "path") load("@builtin//struct.star", "module") -load("./ar.star", "ar") -load("./config.star", "config") load("./mac_sdk.star", "mac_sdk") load("./win_sdk.star", "win_sdk") @@ -124,75 +121,8 @@ ], } -def __lld_link(ctx, cmd): - # Replace thin archives with /start-lib ... /end-lib in rsp file. - new_lines = [] - for line in str(cmd.rspfile_content).split("\n"): - new_elems = [] - for elem in line.split(" "): - # Parse only .lib files. - if not elem.endswith(".lib"): - new_elems.append(elem) - continue - - # Parse files under the out dir. - fname = ctx.fs.canonpath(elem) - if not ctx.fs.exists(fname): - new_elems.append(elem) - continue - - # Check if the library is generated or not. - # The source libs are not under the build dir. - build_dir = ctx.fs.canonpath("./") - if path.rel(build_dir, fname).startswith("../../"): - new_elems.append(elem) - continue - - ents = ar.entries(ctx, fname, build_dir) - if not ents: - new_elems.append(elem) - continue - - new_elems.append("-start-lib") - new_elems.extend(ents) - new_elems.append("-end-lib") - new_lines.append(" ".join(new_elems)) - - ctx.actions.fix(rspfile_content = "\n".join(new_lines)) - -def __thin_archive(ctx, cmd): - # TODO: This handler can be used despite remote linking? - if not config.get(ctx, "remote-link"): - return - if "lld-link" in cmd.args[0]: - if not "/llvmlibthin" in cmd.args: - print("not thin archive") - return - else: - # check command line to see "-T" and "-S". - # rm -f obj/third_party/angle/libangle_common.a && "../../third_party/llvm-build/Release+Asserts/bin/llvm-ar" -T -S -r -c -D obj/third_party/angle/libangle_common.a @"obj/third_party/angle/libangle_common.a.rsp" - if not ("-T" in cmd.args[-1] and "-S" in cmd.args[-1]): - print("not thin archive without symbol table") - return - - # create thin archive without symbol table by handler. - rspfile_content = str(cmd.rspfile_content) - inputs = [] - for line in rspfile_content.split("\n"): - for fname in line.split(" "): - inputs.append(ctx.fs.canonpath(fname)) - data = ar.create(ctx, path.dir(cmd.outputs[0]), inputs) - ctx.actions.write(cmd.outputs[0], data) - ctx.actions.exit(exit_status = 0) - -__handlers = { - "lld_link": __lld_link, - "lld_thin_archive": __thin_archive, -} - clang_all = module( "clang_all", filegroups = __filegroups, input_deps = __input_deps, - handlers = __handlers, )
diff --git a/build/config/siso/clang_linux.star b/build/config/siso/clang_linux.star index 4c3b917..42825f1 100644 --- a/build/config/siso/clang_linux.star +++ b/build/config/siso/clang_linux.star
@@ -125,7 +125,6 @@ __handlers = {} __handlers.update(clang_unix.handlers) -__handlers.update(clang_all.handlers) def __step_config(ctx, step_config): step_config["input_deps"].update({
diff --git a/build/config/siso/clang_mac.star b/build/config/siso/clang_mac.star index 6ecff8b..c1836a24 100644 --- a/build/config/siso/clang_mac.star +++ b/build/config/siso/clang_mac.star
@@ -22,7 +22,6 @@ __handlers = {} __handlers.update(clang_unix.handlers) -__handlers.update(clang_all.handlers) def __step_config(ctx, step_config): cfg = "buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_mac.cfg"
diff --git a/build/config/siso/clang_unix.star b/build/config/siso/clang_unix.star index 3e77109..8103a3c4 100644 --- a/build/config/siso/clang_unix.star +++ b/build/config/siso/clang_unix.star
@@ -17,6 +17,25 @@ clang_command = clang_code_coverage_wrapper.run(ctx, list(cmd.args)) ctx.actions.fix(args = clang_command) +def __clang_alink(ctx, cmd): + if not config.get(ctx, "remote-link"): + return + + # check command line to see "-T" and "-S". + # rm -f obj/third_party/angle/libangle_common.a && "../../third_party/llvm-build/Release+Asserts/bin/llvm-ar" -T -S -r -c -D obj/third_party/angle/libangle_common.a @"obj/third_party/angle/libangle_common.a.rsp" + if not ("-T" in cmd.args[-1] and "-S" in cmd.args[-1]): + print("not thin archive without symbol table") + return + + # create thin archive without symbol table by handler. + rspfile_content = str(cmd.rspfile_content) + inputs = [] + for fname in rspfile_content.split(" "): + inputs.append(ctx.fs.canonpath(fname)) + data = ar.create(ctx, path.dir(cmd.outputs[0]), inputs) + ctx.actions.write(cmd.outputs[0], data) + ctx.actions.exit(exit_status = 0) + def __clang_link(ctx, cmd): if not config.get(ctx, "remote-link"): return @@ -76,6 +95,7 @@ __handlers = { "clang_compile_coverage": __clang_compile_coverage, + "clang_alink": __clang_alink, "clang_link": __clang_link, } @@ -87,58 +107,7 @@ canonicalize_dir = not input_root_absolute_path canonicalize_dir_for_objc = not input_root_absolute_path_for_objc - rules = [] - if win_sdk.enabled(ctx): - rules.extend([ - { - "name": "clang-cl/cxx", - "action": "(.*_)?cxx", - "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/clang-cl ", - "inputs": [ - "third_party/llvm-build/Release+Asserts/bin/clang-cl", - ], - "exclude_input_patterns": ["*.stamp"], - "remote": True, - "input_root_absolute_path": input_root_absolute_path, - "canonicalize_dir": canonicalize_dir, - "timeout": "2m", - }, - { - "name": "clang-cl/cc", - "action": "(.*_)?cc", - "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/clang-cl ", - "inputs": [ - "third_party/llvm-build/Release+Asserts/bin/clang-cl", - ], - "exclude_input_patterns": ["*.stamp"], - "remote": True, - "input_root_absolute_path": input_root_absolute_path, - "canonicalize_dir": canonicalize_dir, - "timeout": "2m", - }, - { - "name": "lld-link/alink", - "action": "(.*_)?alink", - "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/lld-link /lib", - "handler": "lld_thin_archive", - "remote": False, - "accumulate": True, - }, - { - "name": "lld-link/solink", - "action": "(.*_)?solink", - "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/lld-link", - "handler": "lld_link", - }, - { - "name": "lld-link/link", - "action": "(.*_)?link", - "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/lld-link", - "handler": "lld_link", - }, - ]) - - rules.extend([ + rules = [ { "name": "clang/cxx", "action": "(.*_)?cxx", @@ -274,7 +243,7 @@ "*.py", "*.stamp", ], - "handler": "lld_thin_archive", + "handler": "clang_alink", "remote": config.get(ctx, "remote-link"), "canonicalize_dir": True, "timeout": "2m", @@ -333,7 +302,36 @@ "platform_ref": "large", "timeout": "10m", }, - ]) + ] + if win_sdk.enabled(ctx): + rules.extend([ + { + "name": "clang-cl/cxx", + "action": "(.*_)?cxx", + "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/clang-cl ", + "inputs": [ + "third_party/llvm-build/Release+Asserts/bin/clang-cl", + ], + "exclude_input_patterns": ["*.stamp"], + "remote": True, + "input_root_absolute_path": input_root_absolute_path, + "canonicalize_dir": canonicalize_dir, + "timeout": "2m", + }, + { + "name": "clang-cl/cc", + "action": "(.*_)?cc", + "command_prefix": "../../third_party/llvm-build/Release+Asserts/bin/clang-cl ", + "inputs": [ + "third_party/llvm-build/Release+Asserts/bin/clang-cl", + ], + "exclude_input_patterns": ["*.stamp"], + "remote": True, + "input_root_absolute_path": input_root_absolute_path, + "canonicalize_dir": canonicalize_dir, + "timeout": "2m", + }, + ]) return rules clang_unix = module(
diff --git a/build/config/siso/clang_windows.star b/build/config/siso/clang_windows.star index ca1f31e..e6c1efe 100644 --- a/build/config/siso/clang_windows.star +++ b/build/config/siso/clang_windows.star
@@ -28,7 +28,6 @@ __handlers = { "clang_compile_coverage": __clang_compile_coverage, } -__handlers.update(clang_all.handlers) def __step_config(ctx, step_config): cfg = "buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_windows.cfg" @@ -138,26 +137,6 @@ "remote_wrapper": remote_wrapper, "timeout": timeout, }, - { - "name": "lld-link/alink", - "action": "(.*_)?alink", - "command_prefix": "..\\..\\third_party\\llvm-build\\Release+Asserts\\bin\\lld-link.exe /lib", - "handler": "lld_thin_archive", - "remote": False, - "accumulate": True, - }, - { - "name": "lld-link/solink", - "action": "(.*_)?solink", - "command_prefix": "..\\..\\third_party\\llvm-build\\Release+Asserts\\bin\\lld-link.exe", - "handler": "lld_link", - }, - { - "name": "lld-link/link", - "action": "(.*_)?link", - "command_prefix": "..\\..\\third_party\\llvm-build\\Release+Asserts\\bin\\lld-link.exe", - "handler": "lld_link", - }, ]) elif gn.args(ctx).get("use_remoteexec") == "true": fail("remoteexec requires rewrapper config")
diff --git a/build/config/siso/cros.star b/build/config/siso/cros.star index 0cfd2a57..0eeabf33 100644 --- a/build/config/siso/cros.star +++ b/build/config/siso/cros.star
@@ -189,7 +189,7 @@ "*.pak", "*.py", ], - "handler": "lld_thin_archive", + "handler": "clang_alink", "remote": config.get(ctx, "remote-link"), "canonicalize_dir": True, "timeout": "5m", @@ -249,7 +249,7 @@ "*.pak", "*.py", ], - "handler": "lld_thin_archive", + "handler": "clang_alink", "remote": config.get(ctx, "remote-link"), "canonicalize_dir": True, "timeout": "5m",
diff --git a/buildtools/deps_revisions.gni b/buildtools/deps_revisions.gni index f7cfcc0..cac7ac42 100644 --- a/buildtools/deps_revisions.gni +++ b/buildtools/deps_revisions.gni
@@ -5,5 +5,5 @@ declare_args() { # Used to cause full rebuilds on libc++ rolls. This should be kept in sync # with the libcxx_revision var in //DEPS. - libcxx_revision = "d3d825f7b3bb685545dcfa6c9d797631a49ade61" + libcxx_revision = "e36be6784f33c592ecc89da2a829807920d374ef" }
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 6a84a37f..576ba8b 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -244,26 +244,14 @@ internal_content_bounds_, raster_caps.tile_format, gfx::ColorSpace()); if (!pool_resource.backing()) { - auto backing = std::make_unique<ResourcePool::Backing>(); auto* sii = raster_context_provider->SharedImageInterface(); - backing->overlay_candidate = raster_caps.tile_overlay_candidate; - gpu::SharedImageUsageSet flags = gpu::SHARED_IMAGE_USAGE_DISPLAY_READ | - gpu::SHARED_IMAGE_USAGE_RASTER_WRITE; - if (raster_caps.use_gpu_rasterization) { - flags |= gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION; - } - if (backing->overlay_candidate) { - flags |= gpu::SHARED_IMAGE_USAGE_SCANOUT; - } - backing->set_shared_image(sii->CreateSharedImage( - {pool_resource.format(), pool_resource.size(), - pool_resource.color_space(), flags, "HeadsUpDisplayLayer"}, - gpu::kNullSurfaceHandle)); - CHECK(backing->shared_image()); + pool_resource.InstallGpuBacking(sii, raster_caps.tile_overlay_candidate, + raster_caps.use_gpu_rasterization, + "HeadsUpDisplayLayer"); + auto* ri = raster_context_provider->RasterInterface(); ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData()); - pool_resource.set_backing(std::move(backing)); needs_clear = true; } else if (pool_resource.backing()->returned_sync_token.HasData()) { auto* ri = raster_context_provider->RasterInterface();
diff --git a/cc/raster/bitmap_raster_buffer_provider.cc b/cc/raster/bitmap_raster_buffer_provider.cc index 637745e..25491f8 100644 --- a/cc/raster/bitmap_raster_buffer_provider.cc +++ b/cc/raster/bitmap_raster_buffer_provider.cc
@@ -97,27 +97,18 @@ bool depends_on_hardware_accelerated_webp_candidates) { DCHECK_EQ(resource.format(), viz::SinglePlaneFormat::kBGRA_8888); - const gfx::Size& size = resource.size(); - const gfx::ColorSpace& color_space = resource.color_space(); if (!resource.backing()) { - auto backing = std::make_unique<ResourcePool::Backing>(); - backing->shared_image_interface = shared_image_interface_; - backing->set_shared_image( - shared_image_interface_->CreateSharedImageForSoftwareCompositor( - {viz::SinglePlaneFormat::kBGRA_8888, size, color_space, - gpu::SHARED_IMAGE_USAGE_CPU_WRITE_ONLY, - "BitmapRasterBufferProvider"})); - CHECK(backing->shared_image()); + resource.InstallSoftwareBacking(shared_image_interface_, + "BitmapRasterBufferProvider"); - backing->mailbox_sync_token = + resource.backing()->mailbox_sync_token = shared_image_interface_->GenVerifiedSyncToken(); - - resource.set_backing(std::move(backing)); } ResourcePool::Backing* backing = resource.backing(); return std::make_unique<BitmapRasterBufferImpl>( - size, color_space, backing, resource_content_id, previous_content_id); + resource.size(), resource.color_space(), backing, resource_content_id, + previous_content_id); } void BitmapRasterBufferProvider::Flush() {}
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index fbec9462..d5cd282 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc
@@ -59,9 +59,32 @@ } } +void ResourcePool::InUsePoolResource::InstallGpuBacking( + gpu::SharedImageInterface* sii, + bool is_overlay_candidate, + bool use_gpu_rasterization, + std::string_view debug_label) const { + auto backing = std::make_unique<ResourcePool::Backing>(); + backing->overlay_candidate = is_overlay_candidate; + + gpu::SharedImageUsageSet flags = gpu::SHARED_IMAGE_USAGE_DISPLAY_READ | + gpu::SHARED_IMAGE_USAGE_RASTER_WRITE; + if (use_gpu_rasterization) { + flags |= gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION; + } + if (backing->overlay_candidate) { + flags |= gpu::SHARED_IMAGE_USAGE_SCANOUT; + } + backing->set_shared_image(sii->CreateSharedImage( + {format(), size(), color_space(), flags, debug_label}, + gpu::kNullSurfaceHandle)); + CHECK(backing->shared_image()); + set_backing(std::move(backing)); +} + void ResourcePool::InUsePoolResource::InstallSoftwareBacking( scoped_refptr<gpu::SharedImageInterface> sii, - std::string_view debug_label) { + std::string_view debug_label) const { CHECK(!backing()); auto backing = std::make_unique<ResourcePool::Backing>(); backing->shared_image_interface = sii;
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h index 97412a1..6b9fcdee 100644 --- a/cc/resources/resource_pool.h +++ b/cc/resources/resource_pool.h
@@ -95,7 +95,7 @@ // Scoped move-only object returned when getting a resource from the pool. // Ownership must be given back to the pool to release the resource. - class InUsePoolResource { + class CC_EXPORT InUsePoolResource { public: InUsePoolResource() = default; ~InUsePoolResource() { @@ -135,11 +135,18 @@ return resource_->set_backing(std::move(backing)); } + // Creates a SharedImage based on the configuration of this resource and + // installs a backing for this resource that is itself backed by that SI. + void InstallGpuBacking(gpu::SharedImageInterface* sii, + bool is_overlay_candidate, + bool use_gpu_rasterization, + std::string_view debug_label) const; + // Creates a software SharedImage based on the configuration of this // resource and installs a backing for this resource that is itself backed // by that SI. void InstallSoftwareBacking(scoped_refptr<gpu::SharedImageInterface> sii, - std::string_view debug_label); + std::string_view debug_label) const; size_t memory_usage() const { DCHECK(resource_);
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 05cf36e..a460207a 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -1784,15 +1784,10 @@ bool depends_on_hardware_accelerated_jpeg_candidates, bool depends_on_hardware_accelerated_webp_candidates) override { if (!resource.backing()) { - auto backing = std::make_unique<ResourcePool::Backing>(); - backing->set_shared_image(sii_->CreateSharedImageForSoftwareCompositor( - {viz::SinglePlaneFormat::kBGRA_8888, resource.size(), - gfx::ColorSpace(), gpu::SHARED_IMAGE_USAGE_CPU_WRITE_ONLY, - "TextureLayerTest"})); + resource.InstallSoftwareBacking(sii_, "TextureLayerTest"); - backing->mailbox_sync_token = sii_->GenVerifiedSyncToken(); + resource.backing()->mailbox_sync_token = sii_->GenVerifiedSyncToken(); - resource.set_backing(std::move(backing)); is_software_ = true; } return std::make_unique<TestRasterBuffer>(resource.size(),
diff --git a/chrome/VERSION b/chrome/VERSION index 5df2ba6..73f6b56d 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=135 MINOR=0 -BUILD=7023 +BUILD=7024 PATCH=0
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni index 86513295..f3d76f23 100644 --- a/chrome/android/chrome_java_resources.gni +++ b/chrome/android/chrome_java_resources.gni
@@ -20,6 +20,8 @@ "java/res/anim/slide_in_up.xml", "java/res/anim/slide_out_down.xml", "java/res/anim/slide_out_left.xml", + "java/res/color-night/widget_searchbox_bg.xml", + "java/res/color/widget_searchbox_bg.xml", "java/res/drawable-hdpi/btn_close_white.png", "java/res/drawable-hdpi/btn_left.png", "java/res/drawable-hdpi/btn_right.png", @@ -611,6 +613,7 @@ "java/res/values-v26/styles.xml", "java/res/values-v27/styles.xml", "java/res/values-v28/styles.xml", + "java/res/values-v31/styles.xml", "java/res/values/attrs.xml", "java/res/values/colors.xml", "java/res/values/dimens.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index 46fc15b..e6786d4 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -1027,7 +1027,6 @@ "java/src/org/chromium/chrome/browser/signin/SigninFirstRunFragment.java", "java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java", "java/src/org/chromium/chrome/browser/signin/SyncConsentActivity.java", - "java/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImpl.java", "java/src/org/chromium/chrome/browser/signin/SyncConsentFragment.java", "java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java", "java/src/org/chromium/chrome/browser/site_settings/CookieControlsServiceBridge.java",
diff --git a/chrome/android/java/res/color-night/widget_searchbox_bg.xml b/chrome/android/java/res/color-night/widget_searchbox_bg.xml new file mode 100644 index 0000000..930712b3b --- /dev/null +++ b/chrome/android/java/res/color-night/widget_searchbox_bg.xml
@@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2025 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="?attr/colorSurfaceContainerHighest" /> +</selector>
diff --git a/chrome/android/java/res/color/widget_searchbox_bg.xml b/chrome/android/java/res/color/widget_searchbox_bg.xml new file mode 100644 index 0000000..e859747 --- /dev/null +++ b/chrome/android/java/res/color/widget_searchbox_bg.xml
@@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2025 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="?attr/colorSurfaceContainerHigh" /> +</selector>
diff --git a/chrome/android/java/res/layout/search_widget_template.xml b/chrome/android/java/res/layout/search_widget_template.xml index 0ae8cce..389c0bc 100644 --- a/chrome/android/java/res/layout/search_widget_template.xml +++ b/chrome/android/java/res/layout/search_widget_template.xml
@@ -19,7 +19,9 @@ android:alpha="0.9" android:background="@drawable/modern_toolbar_text_box_background_with_primary_color" android:gravity="center_vertical" - android:orientation="horizontal" > + android:orientation="horizontal" + android:theme="@style/Theme.Chromium.Widget" + android:backgroundTint="@color/widget_searchbox_bg" > <!-- The 12dp padding on the left comes from the fact that the microphone is 24dp x 24dp, and sits in a 48dp x 48dp box. This means there's an implied 12dp of padding @@ -41,7 +43,7 @@ android:layout_width="48dp" android:layout_height="48dp" android:src="@drawable/ic_mic_white_24dp" - android:tint="@color/default_icon_color_baseline" + android:tint="@macro/default_icon_color_secondary" android:scaleType="centerInside" android:contentDescription="@string/accessibility_toolbar_btn_mic" />
diff --git a/chrome/android/java/res/values-v31/styles.xml b/chrome/android/java/res/values-v31/styles.xml new file mode 100644 index 0000000..903eb104 --- /dev/null +++ b/chrome/android/java/res/values-v31/styles.xml
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2025 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> + +<resources xmlns:tools="http://schemas.android.com/tools"> + <style name="Theme.Chromium.Widget" parent="Theme.Material3.DynamicColors.DayNight" /> +</resources>
diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res/values/styles.xml index f010942..ba98b6c 100644 --- a/chrome/android/java/res/values/styles.xml +++ b/chrome/android/java/res/values/styles.xml
@@ -386,10 +386,8 @@ <item name="android:textColorHint">@macro/ntp_search_box_hint</item> </style> - <!-- Launcher widgets can't use theme attributes, so this should use the baseline colors for - android:textColorHint --> <style name="TextAppearance.SearchBoxText.Widget"> - <item name="android:textColorHint">@color/search_box_hint_baseline</item> + <item name="android:textColorHint">@macro/default_text_color_secondary</item> </style> <!-- Bookmarks --> @@ -498,4 +496,6 @@ <style name="ModernToolbarPopupTheme"> <item name="android:listChoiceIndicatorSingle">@drawable/checkmark_selection_drawable</item> </style> + + <style name="Theme.Chromium.Widget" parent="Theme.BrowserUI.DayNight" /> </resources>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImpl.java deleted file mode 100644 index 4a1676d..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImpl.java +++ /dev/null
@@ -1,118 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -package org.chromium.chrome.browser.signin; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; - -import androidx.annotation.Nullable; - -import org.chromium.base.ResettersForTesting; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; -import org.chromium.chrome.browser.signin.services.SigninManager; -import org.chromium.chrome.browser.ui.signin.SyncConsentActivityLauncher; -import org.chromium.chrome.browser.ui.signin.SyncConsentFragmentBase; -import org.chromium.components.browser_ui.settings.ManagedPreferencesUtils; -import org.chromium.components.signin.metrics.SigninAccessPoint; - -/** - * SyncConsentActivityLauncher creates the proper intent and then launches the {@link - * SyncConsentActivity} in different scenarios. - */ -public final class SyncConsentActivityLauncherImpl implements SyncConsentActivityLauncher { - private static SyncConsentActivityLauncher sLauncherForTest; - private final Profile mProfile; - - /** Get a {@link SyncConsentActivityLauncher} associated with a given profile. */ - public static SyncConsentActivityLauncher getForProfile(Profile profile) { - if (sLauncherForTest != null) { - return sLauncherForTest; - } - return new SyncConsentActivityLauncherImpl(profile); - } - - public static void setLauncherForTest(@Nullable SyncConsentActivityLauncher launcher) { - var oldValue = sLauncherForTest; - sLauncherForTest = launcher; - ResettersForTesting.register(() -> sLauncherForTest = oldValue); - } - - private SyncConsentActivityLauncherImpl(Profile profile) { - assert !profile.isOffTheRecord(); - mProfile = profile; - } - - /** - * Launches the {@link SyncConsentActivity} with default sign-in flow from personalized sign-in - * promo. - * - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @param accountName The account to preselect or null to preselect the default account. - */ - @Override - public void launchActivityForPromoDefaultFlow( - Context context, @SigninAccessPoint int accessPoint, String accountName) { - launchInternal( - context, - SyncConsentFragment.createArgumentsForPromoDefaultFlow(accessPoint, accountName)); - } - - /** - * Launches the {@link SyncConsentActivity} with "Choose account" sign-in flow from personalized - * sign-in promo. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @param accountName The account to preselect or null to preselect the default account. - */ - @Override - public void launchActivityForPromoChooseAccountFlow( - Context context, @SigninAccessPoint int accessPoint, String accountName) { - launchInternal( - context, - SyncConsentFragment.createArgumentsForPromoChooseAccountFlow( - accessPoint, accountName)); - } - - /** - * Launches the {@link SyncConsentActivity} with "New account" sign-in flow from personalized - * sign-in promo. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - */ - @Override - public void launchActivityForPromoAddAccountFlow( - Context context, @SigninAccessPoint int accessPoint) { - launchInternal( - context, SyncConsentFragment.createArgumentsForPromoAddAccountFlow(accessPoint)); - } - - /** - * Launches the {@link SyncConsentActivity} if signin is allowed. - * - * @param context A {@link Context} object. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @return a boolean indicating if the {@link SyncConsentActivity} is launched. - */ - @Override - public boolean launchActivityIfAllowed(Context context, @SigninAccessPoint int accessPoint) { - SigninManager signinManager = IdentityServicesProvider.get().getSigninManager(mProfile); - if (signinManager.isSyncOptInAllowed()) { - launchInternal(context, SyncConsentFragmentBase.createArguments(accessPoint, null)); - return true; - } - if (signinManager.isSigninDisabledByPolicy()) { - RecordHistogram.recordEnumeratedHistogram( - "Signin.SyncDisabledNotificationShown", accessPoint, - SigninAccessPoint.MAX_VALUE); - ManagedPreferencesUtils.showManagedByAdministratorToast(context); - } - return false; - } - - private void launchInternal(Context context, Bundle fragmentArgs) { - Intent intent = SyncConsentActivity.createIntent(context, fragmentArgs); - context.startActivity(intent); - } -}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkPersonalizedSigninPromoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkPersonalizedSigninPromoTest.java index d39fa8b..47ec06e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkPersonalizedSigninPromoTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkPersonalizedSigninPromoTest.java
@@ -40,9 +40,7 @@ import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; -import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; import org.chromium.chrome.browser.sync.SyncServiceFactory; -import org.chromium.chrome.browser.ui.signin.SyncConsentActivityLauncher; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.R; @@ -85,14 +83,11 @@ public final RuleChain chain = RuleChain.outerRule(mAccountManagerTestRule).around(mBookmarkTestRule); - @Mock private SyncConsentActivityLauncher mMockSyncConsentActivityLauncher; - @Mock private SyncService mSyncService; @Before public void setUp() { MockitoAnnotations.initMocks(this); - SyncConsentActivityLauncherImpl.setLauncherForTest(mMockSyncConsentActivityLauncher); } @After
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java index 4328aad..3f20315 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java
@@ -101,7 +101,6 @@ import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings; import org.chromium.chrome.browser.signin.SigninAndHistorySyncActivityLauncherImpl; -import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; import org.chromium.chrome.browser.sync.FakeSyncServiceImpl; import org.chromium.chrome.browser.sync.SyncServiceFactory; import org.chromium.chrome.browser.sync.SyncTestRule; @@ -117,7 +116,6 @@ import org.chromium.chrome.browser.ui.signin.BottomSheetSigninAndHistorySyncConfig.NoAccountSigninMode; import org.chromium.chrome.browser.ui.signin.BottomSheetSigninAndHistorySyncConfig.WithAccountSigninMode; import org.chromium.chrome.browser.ui.signin.SigninAndHistorySyncActivityLauncher; -import org.chromium.chrome.browser.ui.signin.SyncConsentActivityLauncher; import org.chromium.chrome.browser.ui.signin.history_sync.HistorySyncConfig; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.R; @@ -184,7 +182,6 @@ @Mock private PasswordCheck mPasswordCheck; @Mock private PasswordManagerUtilBridge.Natives mPasswordManagerUtilBridgeJniMock; - @Mock private SyncConsentActivityLauncher mSyncConsentActivityLauncher; @Mock private SigninAndHistorySyncActivityLauncher mSigninAndHistorySyncActivityLauncher; @Mock private HomeModulesConfigManager mHomeModulesConfigManager; @@ -201,7 +198,6 @@ InstrumentationRegistry.getInstrumentation().setInTouchMode(true); PasswordCheckFactory.setPasswordCheckForTesting(mPasswordCheck); PasswordManagerUtilBridgeJni.setInstanceForTesting(mPasswordManagerUtilBridgeJniMock); - SyncConsentActivityLauncherImpl.setLauncherForTest(mSyncConsentActivityLauncher); SigninAndHistorySyncActivityLauncherImpl.setLauncherForTest( mSigninAndHistorySyncActivityLauncher); DeveloperSettings.setIsEnabledForTests(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java index 95c36ee..8fcf413 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java
@@ -8,18 +8,20 @@ import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.pressBack; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.contrib.RecyclerViewActions.scrollTo; import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.hasDescendant; import static androidx.test.espresso.matcher.ViewMatchers.isRoot; import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.mockito.ArgumentMatchers.any; +import static org.hamcrest.core.AllOf.allOf; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import androidx.test.filters.LargeTest; -import androidx.test.platform.app.InstrumentationRegistry; import org.junit.After; import org.junit.Assert; @@ -39,21 +41,20 @@ import org.chromium.base.test.util.HistogramWatcher; import org.chromium.chrome.browser.bookmarks.BookmarkModel; import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.settings.MainSettings; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; import org.chromium.chrome.browser.signin.services.SigninManager; import org.chromium.chrome.browser.signin.services.SigninMetricsUtils; import org.chromium.chrome.browser.signin.services.SigninMetricsUtilsJni; import org.chromium.chrome.browser.sync.settings.AccountManagementFragment; +import org.chromium.chrome.browser.ui.signin.history_sync.HistorySyncHelper; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.R; -import org.chromium.chrome.test.util.ActivityTestUtils; import org.chromium.chrome.test.util.BookmarkTestUtil; -import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule; import org.chromium.chrome.test.util.browser.signin.SigninTestRule; import org.chromium.components.externalauth.ExternalAuthUtils; -import org.chromium.components.signin.base.CoreAccountInfo; import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.signin.metrics.SigninAccessPoint; import org.chromium.components.signin.test.util.TestAccounts; @@ -68,6 +69,9 @@ public final SettingsActivityTestRule<AccountManagementFragment> mSettingsActivityTestRule = new SettingsActivityTestRule<>(AccountManagementFragment.class); + private final SettingsActivityTestRule<MainSettings> mMainSettingsActivityTestRule = + new SettingsActivityTestRule<>(MainSettings.class); + private final ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -77,7 +81,9 @@ // observers registered in the AccountManagerFacade mock. @Rule public final RuleChain mRuleChain = - RuleChain.outerRule(mSigninTestRule).around(mActivityTestRule); + RuleChain.outerRule(mSigninTestRule) + .around(mActivityTestRule) + .around(mMainSettingsActivityTestRule); @Rule public final MockitoRule mMockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); @@ -88,6 +94,8 @@ @Mock private SigninManager.SignInStateObserver mSignInStateObserverMock; + @Mock private HistorySyncHelper mHistorySyncHelper; + private SigninManager mSigninManager; private BookmarkModel mBookmarkModel; @@ -114,53 +122,40 @@ @Test @LargeTest public void testSignIn() { - when(mExternalAuthUtilsMock.canUseGooglePlayServices(any())).thenReturn(true); var signinHistogram = HistogramWatcher.newSingleRecordWatcher( "Signin.SignIn.Completed", SigninAccessPoint.SETTINGS); - var syncHistogram = - HistogramWatcher.newSingleRecordWatcher( - "Signin.SyncOptIn.Completed", SigninAccessPoint.SETTINGS); ExternalAuthUtils.setInstanceForTesting(mExternalAuthUtilsMock); - CoreAccountInfo coreAccountInfo = - mSigninTestRule.addAccount(AccountManagerTestRule.TEST_ACCOUNT_EMAIL); + HistorySyncHelper.setInstanceForTesting(mHistorySyncHelper); + doReturn(true).when(mHistorySyncHelper).shouldSuppressHistorySync(); + mSigninTestRule.addAccount(TestAccounts.ACCOUNT1); + mMainSettingsActivityTestRule.startSettingsActivity(); - SyncConsentActivity syncConsentActivity = - ActivityTestUtils.waitForActivity( - InstrumentationRegistry.getInstrumentation(), - SyncConsentActivity.class, - () -> { - SyncConsentActivityLauncherImpl.getForProfile( - mActivityTestRule.getProfile(false)) - .launchActivityForPromoDefaultFlow( - mActivityTestRule.getActivity(), - SigninAccessPoint.SETTINGS, - AccountManagerTestRule.TEST_ACCOUNT_EMAIL); - }); - assertSignedOut(); - ThreadUtils.runOnUiThreadBlocking( - () -> { - syncConsentActivity.findViewById(R.id.button_primary).performClick(); - }); + onView(withId(R.id.recycler_view)) + .perform(scrollTo(hasDescendant(withText(R.string.signin_settings_title)))); + onView(withText(R.string.signin_settings_title)).perform(click()); + onView( + allOf( + withId(R.id.account_picker_continue_as_button), + withParent(withId(R.id.account_picker_state_collapsed)))) + .perform(click()); CriteriaHelper.pollUiThread( - () -> mSigninManager.getIdentityManager().hasPrimaryAccount(ConsentLevel.SYNC)); + () -> mSigninManager.getIdentityManager().hasPrimaryAccount(ConsentLevel.SIGNIN)); verify(mSignInStateObserverMock).onSignedIn(); verify(mSignInStateObserverMock, never()).onSignedOut(); ThreadUtils.runOnUiThreadBlocking( () -> { Assert.assertEquals( - coreAccountInfo, + TestAccounts.ACCOUNT1, mSigninManager .getIdentityManager() - .getPrimaryAccountInfo(ConsentLevel.SYNC)); + .getPrimaryAccountInfo(ConsentLevel.SIGNIN)); Assert.assertTrue( mSigninManager.getIdentityManager().isClearPrimaryAccountAllowed()); }); signinHistogram.assertExpected( "Signin should be recorded with the settings page as the access point."); - syncHistogram.assertExpected( - "Sync opt-in should be recorded with the settings page as the access point."); } @Test
diff --git a/chrome/android/junit/BUILD.gn b/chrome/android/junit/BUILD.gn index 02cfc15..fbde436 100644 --- a/chrome/android/junit/BUILD.gn +++ b/chrome/android/junit/BUILD.gn
@@ -992,7 +992,6 @@ "src/org/chromium/chrome/browser/signin/PolicyLoadListenerUnitTest.java", "src/org/chromium/chrome/browser/signin/SigninBridgeTest.java", "src/org/chromium/chrome/browser/signin/SigninManagerImplTest.java", - "src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImplTest.java", ] deps = chrome_junit_tests_deps
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImplTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImplTest.java deleted file mode 100644 index 975fa491..0000000 --- a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImplTest.java +++ /dev/null
@@ -1,97 +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. - -package org.chromium.chrome.browser.signin; - -import static org.mockito.ArgumentMatchers.notNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import android.content.Context; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; -import org.robolectric.shadows.ShadowToast; - -import org.chromium.base.ContextUtils; -import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.base.test.util.DisabledTest; -import org.chromium.base.test.util.HistogramWatcher; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; -import org.chromium.chrome.browser.signin.services.SigninManager; -import org.chromium.components.signin.metrics.SigninAccessPoint; - -/** Tests {@link SyncConsentActivityLauncherImpl}. */ -@RunWith(BaseRobolectricTestRunner.class) -public class SyncConsentActivityLauncherImplTest { - @Rule - public final MockitoRule mMockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); - - @Mock private SigninManager mSigninManagerMock; - - @Mock private Context mContextMock; - - @Mock private Profile mProfile; - - private final Context mContext = ContextUtils.getApplicationContext(); - - @Before - public void setUp() { - IdentityServicesProvider.setInstanceForTests(mock(IdentityServicesProvider.class)); - when(IdentityServicesProvider.get().getSigninManager(mProfile)) - .thenReturn(mSigninManagerMock); - } - - @Test - public void testLaunchActivityIfAllowedWhenSigninIsAllowed() { - when(mSigninManagerMock.isSyncOptInAllowed()).thenReturn(true); - Assert.assertTrue( - SyncConsentActivityLauncherImpl.getForProfile(mProfile) - .launchActivityIfAllowed(mContextMock, SigninAccessPoint.SETTINGS)); - verify(mContextMock).startActivity(notNull()); - } - - @Test - public void testLaunchActivityIfAllowedWhenSigninIsNotAllowed() { - when(mSigninManagerMock.isSyncOptInAllowed()).thenReturn(false); - when(mSigninManagerMock.isSigninDisabledByPolicy()).thenReturn(false); - Object toastBeforeCall = ShadowToast.getLatestToast(); - Assert.assertFalse( - SyncConsentActivityLauncherImpl.getForProfile(mProfile) - .launchActivityIfAllowed(mContext, SigninAccessPoint.SETTINGS)); - Object toastAfterCall = ShadowToast.getLatestToast(); - Assert.assertEquals( - "No new toast should be made during the call!", toastBeforeCall, toastAfterCall); - } - - @Test - @DisabledTest(message = "Flaky - crbug/1457280") - public void testLaunchActivityIfAllowedWhenSigninIsDisabledByPolicy() { - HistogramWatcher watchSigninDisabledToastShownHistogram = - HistogramWatcher.newSingleRecordWatcher( - "Signin.SyncDisabledNotificationShown", - SigninAccessPoint.NTP_FEED_CARD_MENU_PROMO); - when(mSigninManagerMock.isSyncOptInAllowed()).thenReturn(false); - when(mSigninManagerMock.isSigninDisabledByPolicy()).thenReturn(true); - Assert.assertFalse( - SyncConsentActivityLauncherImpl.getForProfile(mProfile) - .launchActivityIfAllowed( - mContext, SigninAccessPoint.NTP_FEED_CARD_MENU_PROMO)); - Assert.assertTrue( - ShadowToast.showedCustomToast( - mContext.getString(R.string.managed_by_your_organization), - R.id.toast_text)); - watchSigninDisabledToastShownHistogram.assertExpected(); - } -}
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 30f82e8..7511e62 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -2056,7 +2056,7 @@ Who's using Chromium? </message> <message name="IDS_PROFILE_PICKER_MAIN_VIEW_SUBTITLE" desc="Profile picker main view subtitle"> - With Chromium profiles you can separate all your Chromium stuff. Create profiles for friends and family, or split between work and fun. + With Chromium profiles, you can separate all your Chromium stuff. Create profiles for friends and family, or split between work and fun. </message> <message name="IDS_PROFILE_PICKER_PROFILE_CREATION_FLOW_PROFILE_TYPE_CHOICE_TITLE" desc="Profile picker profile type choice title"> Set up your new Chromium profile
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 889431bf..607fdf65 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -784,7 +784,7 @@ </message> <!-- Extension/App install prompt --> - <if expr="enable_extensions"> + <if expr="enable_extensions_core"> <!-- Extension installed bubble --> <message name="IDS_EXTENSION_INSTALLED_HEADING" desc="Title of the extension-installed bubble. Instructs that the extension was installed."> <ph name="EXTENSION_NAME">$1<ex>Gmail Checker</ex></ph> has been added to Chrome @@ -2237,7 +2237,7 @@ Who's using Chrome? </message> <message name="IDS_PROFILE_PICKER_MAIN_VIEW_SUBTITLE" desc="Profile picker main view subtitle"> - With Chrome profiles you can separate all your Chrome stuff. Create profiles for friends and family, or split between work and fun. + With Chrome profiles, you can separate all your Chrome stuff. Create profiles for friends and family, or split between work and fun. </message> <message name="IDS_PROFILE_PICKER_PROFILE_CREATION_FLOW_PROFILE_TYPE_CHOICE_TITLE" desc="Profile picker profile type choice title"> Set up your new Chrome profile
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 2645ea4..59a45e3 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3573,6 +3573,10 @@ "component_updater/soda_language_pack_component_installer.h", "component_updater/zxcvbn_data_component_installer.cc", "component_updater/zxcvbn_data_component_installer.h", + "contextual_cueing/contextual_cueing_helper.cc", + "contextual_cueing/contextual_cueing_service.cc", + "contextual_cueing/contextual_cueing_service.h", + "contextual_cueing/contextual_cueing_service_factory.cc", "data_sharing/desktop/data_sharing_conversion_utils.cc", "data_sharing/desktop/data_sharing_conversion_utils.h", "data_sharing/desktop/data_sharing_sdk_delegate_desktop.cc",
diff --git a/chrome/browser/ash/app_list/app_list_client_impl_browsertest.cc b/chrome/browser/ash/app_list/app_list_client_impl_browsertest.cc index abe43fe..69117b9 100644 --- a/chrome/browser/ash/app_list/app_list_client_impl_browsertest.cc +++ b/chrome/browser/ash/app_list/app_list_client_impl_browsertest.cc
@@ -65,7 +65,7 @@ #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/browser/ash/login/login_manager_test.h" #include "chrome/browser/ash/login/test/login_manager_mixin.h" -#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" +#include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_browsertest.h" @@ -101,6 +101,8 @@ #include "components/browser_sync/browser_sync_switches.h" #include "components/prefs/pref_service.h" #include "components/services/app_service/public/cpp/package_id.h" +#include "components/session_manager/core/session_manager.h" +#include "components/user_manager/test_helper.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" #include "components/user_manager/user_type.h" @@ -1273,6 +1275,12 @@ private: // InProcessBrowserTest: + void SetUpCommandLine(base::CommandLine* command_line) override { + InProcessBrowserTest::SetUpCommandLine(command_line); + // Disable automatic login. + command_line->AppendSwitch(ash::switches::kLoginManager); + } + void SetUpOnMainThread() override { SetUpEnvironment(); // Inject the testing profile into the client, since once a user session was @@ -1284,8 +1292,16 @@ // Sets up profile and user manager. Should be called only once on test setup. void SetUpEnvironment() { + ash::ProfileHelper::SetProfileToUserForTestingEnabled(true); account_id_ = AccountId::FromUserEmailGaiaId("test@test-user", GaiaId("gaia-id")); + auto* user = user_manager::TestHelper(*user_manager::UserManager::Get()) + .AddRegularUser(account_id_); + ASSERT_TRUE(user); + session_manager::SessionManager::Get()->CreateSession( + account_id_, user_manager::TestHelper::GetFakeUsernameHash(account_id_), + /*new_user=*/false, + /*has_active_session=*/false); TestingProfile::Builder profile_builder; profile_builder.AddTestingFactory( @@ -1306,23 +1322,20 @@ g_browser_process->profile_manager()->RegisterTestingProfile( std::move(testing_profile), true); - auto user_manager = std::make_unique<ash::FakeChromeUserManager>(); - user_manager->AddUserWithAffiliationAndTypeAndProfile( - account_id_, true, user_manager::UserType::kRegular, profile_); - user_manager->LoginUser(account_id_); - - user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( - std::move(user_manager)); + user_manager::UserManager::Get()->OnUserProfileCreated( + account_id_, profile_->GetPrefs()); + ash::ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, + profile_); } void TearDownOnMainThread() override { + user_manager::UserManager::Get()->OnUserProfileWillBeDestroyed(account_id_); profile_ = nullptr; base::RunLoop().RunUntilIdle(); - user_manager_enabler_.reset(); InProcessBrowserTest::TearDownOnMainThread(); + ash::ProfileHelper::SetProfileToUserForTestingEnabled(false); } - std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_; // The event to signal when the first app list sync in the session has been // completed. base::OneShotEvent on_first_sync_;
diff --git a/chrome/browser/ash/arc/auth/BUILD.gn b/chrome/browser/ash/arc/auth/BUILD.gn index ca6f2db..b93977d 100644 --- a/chrome/browser/ash/arc/auth/BUILD.gn +++ b/chrome/browser/ash/arc/auth/BUILD.gn
@@ -69,10 +69,12 @@ "//chrome/browser/ash/login/demo_mode:test_support", "//chrome/browser/ash/login/users:test_support", "//chrome/browser/ash/policy/core", + "//chrome/browser/ash/test:test_support", "//chrome/browser/profiles:profile", "//chrome/browser/ui", "//chrome/browser/ui/ash/multi_user", "//chrome/test:test_support", + "//chromeos/ash/components/browser_context_helper", "//chromeos/ash/components/cryptohome", "//chromeos/ash/experiences/arc", "//chromeos/ash/experiences/arc:arc_test_support",
diff --git a/chrome/browser/ash/arc/auth/DEPS b/chrome/browser/ash/arc/auth/DEPS index af9e691..19cae164 100644 --- a/chrome/browser/ash/arc/auth/DEPS +++ b/chrome/browser/ash/arc/auth/DEPS
@@ -37,3 +37,9 @@ "+chrome/common/webui_url_constants.h", "+chrome/test/base", ] + +specific_include_rules = { + "arc_robot_auth_code_fetcher_browsertest\.cc": [ + "+chrome/browser/ash/test", + ] +}
diff --git a/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc b/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc index f31489d..fe71eb3c 100644 --- a/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc +++ b/chrome/browser/ash/arc/auth/arc_auth_service_browsertest.cc
@@ -12,6 +12,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/webui/settings/public/constants/routes.mojom-forward.h" +#include "base/check_deref.h" #include "base/command_line.h" #include "base/containers/flat_set.h" #include "base/files/file_path.h" @@ -36,7 +37,6 @@ #include "chrome/browser/ash/arc/test/test_arc_session_manager.h" #include "chrome/browser/ash/login/demo_mode/demo_mode_test_utils.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" -#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" @@ -45,6 +45,7 @@ #include "chrome/browser/certificate_provider/certificate_provider_service_factory.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/chrome_device_id_helper.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_test_environment_profile_adaptor.h" @@ -54,6 +55,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/browser_context_helper/annotated_account_id.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/ash/components/cryptohome/cryptohome_parameters.h" #include "chromeos/ash/experiences/arc/arc_features.h" #include "chromeos/ash/experiences/arc/arc_prefs.h" @@ -74,7 +77,7 @@ #include "components/signin/public/identity_manager/accounts_mutator.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/identity_test_utils.h" -#include "components/user_manager/scoped_user_manager.h" +#include "components/user_manager/test_helper.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" #include "content/public/browser/browser_thread.h" @@ -90,6 +93,8 @@ namespace { constexpr char kFakeUserName[] = "test@example.com"; +constexpr char kFakePubliAccountUserName[] = + "example@public-accounts.device-local.localhost"; constexpr char kSecondaryAccountEmail[] = "email.111@gmail.com"; constexpr char kFakeAuthCode[] = "fake-auth-code"; @@ -300,12 +305,12 @@ void SetUpCommandLine(base::CommandLine* command_line) override { arc::SetArcAvailableCommandLineForTesting(command_line); + // Disable automated login, because ARC requires the Profile to be Primary. + command_line->AppendSwitch(ash::switches::kLoginManager); } void SetUpOnMainThread() override { - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - - fake_user_manager_.Reset(std::make_unique<ash::FakeChromeUserManager>()); + ash::ProfileHelper::SetProfileToUserForTestingEnabled(true); // Init ArcSessionManager for testing. ArcServiceLauncher::Get()->ResetForTesting(); @@ -326,15 +331,6 @@ arc_bridge_service_->auth()->CloseInstance(&auth_instance_); } - // Explicitly removing the user is required; otherwise ProfileHelper keeps - // a dangling pointer to the User. - // TODO(nya): Consider removing all users from ProfileHelper in the - // destructor of ash::FakeChromeUserManager. - auto* user = fake_user_manager_->GetActiveUser(); - if (user) { - fake_user_manager_->RemoveUserFromList( - fake_user_manager_->GetActiveUser()->GetAccountId()); - } // Since ArcServiceLauncher is (re-)set up with profile() in // SetUpOnMainThread() it is necessary to Shutdown() before the profile() // is destroyed. ArcServiceLauncher::Shutdown() will be called again on @@ -344,11 +340,14 @@ ArcServiceLauncher::Get()->Shutdown(); arc_availability_setter_.reset(); identity_test_environment_adaptor_.reset(); - profile_.reset(); - fake_user_manager_.Reset(); + user_manager::UserManager::Get()->OnUserProfileWillBeDestroyed( + CHECK_DEREF(ash::AnnotatedAccountId::Get(profile_))); + + profile_ = nullptr; chrome::SettingsWindowManager::SetInstanceForTesting(nullptr); settings_window_manager_.reset(); + ash::ProfileHelper::SetProfileToUserForTestingEnabled(false); } void EnableRemovalOfExtendedAccountInfo() { @@ -357,43 +356,55 @@ } void SetAccountAndProfile(const user_manager::UserType user_type) { - AccountId account_id = AccountId::FromUserEmailGaiaId( - kFakeUserName, signin::GetTestGaiaIdForEmail(kFakeUserName)); const user_manager::User* user = nullptr; - switch (user_type) { - case user_manager::UserType::kChild: - user = fake_user_manager_->AddChildUser(account_id); - break; - case user_manager::UserType::kRegular: - user = fake_user_manager_->AddUser(account_id); - break; - case user_manager::UserType::kPublicAccount: - user = fake_user_manager_->AddPublicAccountUser(account_id); - break; - default: - ADD_FAILURE() << "Unexpected user type " << user_type; - return; + { + user_manager::TestHelper test_helper(*user_manager::UserManager::Get()); + switch (user_type) { + case user_manager::UserType::kChild: + user = test_helper.AddChildUser(AccountId::FromUserEmailGaiaId( + kFakeUserName, signin::GetTestGaiaIdForEmail(kFakeUserName))); + break; + case user_manager::UserType::kRegular: + user = test_helper.AddRegularUser(AccountId::FromUserEmailGaiaId( + kFakeUserName, signin::GetTestGaiaIdForEmail(kFakeUserName))); + break; + case user_manager::UserType::kPublicAccount: + user = test_helper.AddPublicAccountUser(kFakePubliAccountUserName); + break; + default: + ADD_FAILURE() << "Unexpected user type " << user_type; + return; + } } - - fake_user_manager_->LoginUser(account_id, - /*set_profile_created_flag=*/false); + ASSERT_TRUE(user); + const AccountId account_id = user->GetAccountId(); + session_manager::SessionManager::Get()->CreateSession( + account_id, user_manager::TestHelper::GetFakeUsernameHash(account_id), + /*new_user=*/false, + /*has_active_session=*/false); // Create test profile. TestingProfile::Builder profile_builder; - profile_builder.SetPath(temp_dir_.GetPath().AppendASCII("TestArcProfile")); - profile_builder.SetProfileName(kFakeUserName); + profile_builder.SetPath( + ash::BrowserContextHelper::Get()->GetBrowserContextPathByUserIdHash( + user->username_hash())); + profile_builder.SetProfileName(account_id.GetUserEmail()); if (user_type == user_manager::UserType::kChild) { profile_builder.SetIsSupervisedProfile(); } - profile_ = IdentityTestEnvironmentProfileAdaptor:: + auto testing_profile = IdentityTestEnvironmentProfileAdaptor:: CreateProfileForIdentityTestEnvironment(profile_builder); - identity_test_environment_adaptor_ = - std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile_.get()); - + profile_ = testing_profile.get(); + ash::AnnotatedAccountId::Set(profile_.get(), account_id); ash::ProfileHelper::Get()->SetUserToProfileMappingForTesting( user, profile_.get()); - fake_user_manager_->SimulateUserProfileLoad(account_id); + g_browser_process->profile_manager()->RegisterTestingProfile( + std::move(testing_profile), /*add_to_storage=*/true); + user_manager::UserManager::Get()->OnUserProfileCreated( + account_id, profile_->GetPrefs()); + identity_test_environment_adaptor_ = + std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile_.get()); auto* identity_test_env = identity_test_environment_adaptor_->identity_test_env(); @@ -401,7 +412,7 @@ // Use ConsentLevel::kSignin because ARC doesn't care about browser sync // consent. identity_test_env->MakePrimaryAccountAvailable( - kFakeUserName, signin::ConsentLevel::kSignin); + account_id.GetUserEmail(), signin::ConsentLevel::kSignin); // Wait for all callbacks to complete, so that they are not called during // the test execution. base::RunLoop().RunUntilIdle(); @@ -561,10 +572,7 @@ } private: - user_manager::TypedScopedUserManager<ash::FakeChromeUserManager> - fake_user_manager_; - base::ScopedTempDir temp_dir_; - std::unique_ptr<TestingProfile> profile_; + raw_ptr<TestingProfile> profile_; network::TestURLLoaderFactory test_url_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; FakeAuthInstance auth_instance_;
diff --git a/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc b/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc index 1be6e03..8152676b 100644 --- a/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc +++ b/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -14,17 +15,17 @@ #include "base/test/bind.h" #include "chrome/browser/ash/arc/auth/arc_auth_service.h" #include "chrome/browser/ash/arc/session/arc_session_manager.h" -#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" +#include "chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" -#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/ash/experiences/arc/test/arc_util_test_support.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" #include "components/policy/core/common/policy_switches.h" -#include "components/user_manager/scoped_user_manager.h" +#include "components/user_manager/test_helper.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/browser_test.h" @@ -36,7 +37,6 @@ namespace arc { namespace { -constexpr char kFakeUserName[] = "test@example.com"; constexpr char kFakeAuthCode[] = "fake-auth-code"; void ResponseJob(const network::ResourceRequest& request, @@ -59,7 +59,8 @@ } // namespace -class ArcRobotAuthCodeFetcherBrowserTest : public InProcessBrowserTest { +class ArcRobotAuthCodeFetcherBrowserTest + : public MixinBasedInProcessBrowserTest { public: ArcRobotAuthCodeFetcherBrowserTest( const ArcRobotAuthCodeFetcherBrowserTest&) = delete; @@ -82,18 +83,13 @@ ~ArcRobotAuthCodeFetcherBrowserTest() override = default; void SetUpCommandLine(base::CommandLine* command_line) override { + MixinBasedInProcessBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, "http://localhost"); arc::SetArcAvailableCommandLineForTesting(command_line); } void SetUpOnMainThread() override { - fake_user_manager_.Reset(std::make_unique<ash::FakeChromeUserManager>()); - - const AccountId account_id(AccountId::FromUserEmail(kFakeUserName)); - fake_user_manager_->AddPublicAccountUser(account_id); - fake_user_manager_->LoginUser(account_id); - if (cloud_policy_client_setup_ == CloudPolicyClientSetup::kSkip) return; @@ -113,8 +109,6 @@ cloud_policy_client->client_id_ = "client-id"; } - void TearDownOnMainThread() override { fake_user_manager_.Reset(); } - void FetchAuthCode(ArcRobotAuthCodeFetcher* fetcher, bool* output_fetch_success, std::string* output_auth_code) { @@ -141,12 +135,14 @@ } private: + // Logs in as a public account user. + ash::PublicAccountLoggedInBrowserTestMixin logged_in_mixin_{ + &mixin_host_, "example@public-accounts.device-local.localhost"}; + // Whether to connect the CloudPolicyClient. CloudPolicyClientSetup cloud_policy_client_setup_; network::TestURLLoaderFactory test_url_loader_factory_; - user_manager::TypedScopedUserManager<ash::FakeChromeUserManager> - fake_user_manager_; }; // TODO(crbug.com/41494522): Investigate.
diff --git a/chrome/browser/ash/arc/wallpaper/arc_wallpaper_service_unittest.cc b/chrome/browser/ash/arc/wallpaper/arc_wallpaper_service_unittest.cc index e8e922a..8d01abf 100644 --- a/chrome/browser/ash/arc/wallpaper/arc_wallpaper_service_unittest.cc +++ b/chrome/browser/ash/arc/wallpaper/arc_wallpaper_service_unittest.cc
@@ -11,6 +11,7 @@ #include <utility> #include "ash/constants/ash_pref_names.h" +#include "base/check_deref.h" #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" @@ -90,6 +91,7 @@ // Wallpaper wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(&test_wallpaper_controller_);
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc index 8bd7068..5102898 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
@@ -13,6 +13,7 @@ #include "ash/test/ash_test_helper.h" #include "ash/wm/desks/desk.h" #include "ash/wm/desks/templates/saved_desk_metrics_util.h" +#include "base/check_deref.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" @@ -1757,7 +1758,8 @@ TEST_F(FloatingWorkspaceServiceV2Test, CaptureFloatingWorkspaceTemplateOnLockScreen) { - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); client.Init(); PopulateAppsCache(); CreateFloatingWorkspaceServiceForTesting(profile());
diff --git a/chrome/browser/ash/login/demo_mode/demo_session_unittest.cc b/chrome/browser/ash/login/demo_mode/demo_session_unittest.cc index 2abd558b..0ce8dab1 100644 --- a/chrome/browser/ash/login/demo_mode/demo_session_unittest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_session_unittest.cc
@@ -13,6 +13,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" +#include "base/check_deref.h" #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" @@ -79,6 +80,7 @@ session_manager_ = std::make_unique<session_manager::SessionManager>(); wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(&test_wallpaper_controller_); // TODO(b/321321392): Test loading growth campaigns at session start.
diff --git a/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc b/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc index 319889d0..22334a43 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc
@@ -50,7 +50,6 @@ #include "chrome/browser/ash/login/test/test_predicate_waiter.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_status.h" #include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" @@ -436,13 +435,6 @@ command_line->AppendSwitchASCII(switches::kArcAvailability, "officially-supported"); ASSERT_TRUE(arc::IsArcAvailable()); - - // We want enrollment state determination to return "No enrollment". - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to - // make tests more realistic. - command_line->AppendSwitchASCII( - switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); } void WaitForConsolidatedConsentScreen() {
diff --git a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc index 5ebce17..1bc88123 100644 --- a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc +++ b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc
@@ -285,7 +285,6 @@ base::Overloaded{ [](policy::AutoEnrollmentSafeguardTimeoutError) { return true; }, [](policy::AutoEnrollmentSystemClockSyncError) { return true; }, - [](policy::AutoEnrollmentMachineInfoRetrievalError) { return true; }, [](policy::AutoEnrollmentStateKeysRetrievalError) { return true; }, [this](const policy::AutoEnrollmentDMServerError& error) { return error.network_error.has_value() ? true
diff --git a/chrome/browser/ash/login/lock/screen_locker_unittest.cc b/chrome/browser/ash/login/lock/screen_locker_unittest.cc index ec4f9764..531ef3a2 100644 --- a/chrome/browser/ash/login/lock/screen_locker_unittest.cc +++ b/chrome/browser/ash/login/lock/screen_locker_unittest.cc
@@ -9,6 +9,7 @@ #include "ash/login/test_login_screen.h" #include "ash/public/cpp/login_screen_model.h" #include "ash/public/cpp/login_types.h" +#include "base/check_deref.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/memory/ptr_util.h" @@ -97,8 +98,8 @@ user_profile_ = testing_profile_manager_->CreateTestingProfile( test_account_id_.GetUserEmail()); - session_controller_client_ = - std::make_unique<SessionControllerClientImpl>(); + session_controller_client_ = std::make_unique<SessionControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); session_controller_client_->Init(); login_screen_client_ = std::make_unique<LoginScreenClientImpl>();
diff --git a/chrome/browser/ash/login/oobe_interactive_ui_test.cc b/chrome/browser/ash/login/oobe_interactive_ui_test.cc index 70f28d5..96d625e 100644 --- a/chrome/browser/ash/login/oobe_interactive_ui_test.cc +++ b/chrome/browser/ash/login/oobe_interactive_ui_test.cc
@@ -644,14 +644,6 @@ command_line->AppendSwitchASCII( policy::switches::kPolicyVerificationKey, policy::PolicyBuilder::GetEncodedPolicyVerificationKey()); - - // Most tests actually do not need state determination. - // Exceptions should remove and re-append this switch. - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to - // make tests more realistic. - command_line->AppendSwitchASCII( - switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); } void SetUpInProcessBrowserTestFixture() override { @@ -937,10 +929,7 @@ command_line->AppendSwitchASCII( switches::kEnterpriseEnableInitialEnrollment, policy::AutoEnrollmentTypeChecker::kInitialEnrollmentAlways); - // TODO(crbug.com/353731379): Turn on Unified State Determination when - // removing legacy state determination code. - command_line->RemoveSwitch( - switches::kEnterpriseEnableUnifiedStateDetermination); + // TODO(b/353731379): Remove when removing legacy state determination code. command_line->AppendSwitchASCII( switches::kEnterpriseEnableUnifiedStateDetermination, policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); @@ -1250,13 +1239,6 @@ command_line->AppendSwitchASCII( policy::switches::kPolicyVerificationKey, policy::PolicyBuilder::GetEncodedPolicyVerificationKey()); - - // We want enrollment state determination to return "No enrollment". - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to - // make tests more realistic. - command_line->AppendSwitchASCII( - switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); } test::EnrollmentUIMixin enrollment_ui_{&mixin_host_};
diff --git a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc index e192db8c..15b5ec4a 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" @@ -26,7 +25,6 @@ #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/test/oobe_screens_utils.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ui/ash/login/login_display_host.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" @@ -173,17 +171,6 @@ OobeBaseTest::TearDownOnMainThread(); } - void SetUpCommandLine(base::CommandLine* command_line) override { - OobeBaseTest::SetUpCommandLine(command_line); - - // We want enrollment state determination to return "No enrollment". - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to - // make tests more realistic. - command_line->AppendSwitchASCII( - switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); - } - void SetUpInProcessBrowserTestFixture() override { OobeBaseTest::SetUpInProcessBrowserTestFixture(); quick_start::TargetDeviceConnectionBrokerFactory::SetFactoryForTesting( @@ -1071,7 +1058,9 @@ class QuickStartLoginScreenTest : public QuickStartBrowserTest { public: - QuickStartLoginScreenTest() { login_manager_mixin_.AppendRegularUsers(1); } + QuickStartLoginScreenTest() : QuickStartBrowserTest() { + login_manager_mixin_.AppendRegularUsers(1); + } private: DeviceStateMixin device_state_{
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index 95b0ff4..31474166 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -22,7 +22,6 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/run_until.h" -#include "base/test/scoped_command_line.h" #include "base/test/test_mock_time_task_runner.h" #include "base/time/time.h" #include "base/types/expected.h" @@ -1208,14 +1207,6 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest, ControlFlowNoForcedReEnrollmentOnFirstBoot) { - // We want enrollment state determination to return "No enrollment". - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to make - // tests more realistic. - base::test::ScopedCommandLine command_line; - command_line.GetProcessCommandLine()->AppendSwitchASCII( - ash::switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); - fake_statistics_provider_.ClearMachineStatistic(system::kActivateDateKey); EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state());
diff --git a/chrome/browser/ash/login/wizard_controller_unittest.cc b/chrome/browser/ash/login/wizard_controller_unittest.cc index 3c840b78..2196e4b 100644 --- a/chrome/browser/ash/login/wizard_controller_unittest.cc +++ b/chrome/browser/ash/login/wizard_controller_unittest.cc
@@ -7,10 +7,10 @@ #include <memory> #include <utility> -#include "ash/constants/ash_switches.h" #include "ash/shell.h" #include "ash/test/ash_test_helper.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" +#include "base/check_deref.h" #include "base/functional/callback.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" @@ -23,8 +23,6 @@ #include "chrome/browser/ash/net/network_portal_detector_test_impl.h" #include "chrome/browser/ash/net/rollback_network_config/fake_rollback_network_config.h" #include "chrome/browser/ash/net/rollback_network_config/rollback_network_config_service.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/profiles/signin_profile_handler.h" #include "chrome/browser/ash/settings/device_settings_cache.h" #include "chrome/browser/ash/settings/device_settings_test_helper.h" @@ -226,6 +224,7 @@ auth_events_recorder_ = AuthEventsRecorder::CreateForTesting(); wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(WallpaperController::Get()); } @@ -389,14 +388,6 @@ fake_login_display_host_->GetWizardContext()->is_branded_build = is_branded; } - void SetupUnfiedStateDeterminationDisabled() { - // TODO(crbug.com/375564225) Remove `kUnifiedStateDeterminationNever` to - // make tests more realistic. - command_line_.GetProcessCommandLine()->AppendSwitchASCII( - ash::switches::kEnterpriseEnableUnifiedStateDetermination, - policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); - } - raw_ptr<WizardController> wizard_controller_ = nullptr; private: @@ -407,7 +398,6 @@ std::unique_ptr<content::TestWebContentsFactory> web_contents_factory_; std::unique_ptr<network::TestURLLoaderFactory> test_url_loader_factory_; SigninProfileHandler signing_profile_handler_; - base::test::ScopedCommandLine command_line_; }; // Chromebox For Meetings (CFM) has forced enrollment. Tests that want to do @@ -415,7 +405,6 @@ #if !BUILDFLAG(PLATFORM_CFM) TEST_F(WizardControllerTest, ConsumerOobeFlowShouldContinueToUserCreationOnNonCriticalUpdate) { - SetupUnfiedStateDeterminationDisabled(); wizard_controller_->Init(/*first_screen=*/ash::OOBE_SCREEN_UNKNOWN); ASSERT_TRUE(AwaitScreen(kWelcomeScreen)); @@ -430,7 +419,6 @@ } TEST_F(WizardControllerTest, DemoModeOobeFlowEndsOnGaiaScreenAndCompletesOobe) { - SetupUnfiedStateDeterminationDisabled(); wizard_controller_->Init(kWelcomeScreen); ASSERT_TRUE(AwaitScreen(kWelcomeScreen)); EXPECT_FALSE(DemoSetupController::IsOobeDemoSetupFlowInProgress()); @@ -544,9 +532,7 @@ }; TEST_F(WizardControllerAfterRollbackTest, AdvanceToEnrollmentAfterRollback) { - SetupUnfiedStateDeterminationDisabled(); wizard_controller_->Init(kAutoEnrollmentCheckScreen); - // Advance to enrollment despite FRE not being enabled. ASSERT_TRUE(AwaitScreen(kEnrollmentScreen)); }
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash_unittest.cc b/chrome/browser/ash/policy/core/browser_policy_connector_ash_unittest.cc index 2f35d9f..c4fc3d4 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" +#include "base/check_deref.h" #include "base/test/task_environment.h" #include "chrome/browser/ash/login/users/avatar/user_image_manager_registry.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" @@ -33,6 +34,7 @@ TestWallpaperController test_wallpaper_controller; WallpaperControllerClientImpl wallpaper_controller_client{ + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()}; wallpaper_controller_client.InitForTesting(&test_wallpaper_controller);
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc index 97cdd28..4520333 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc
@@ -35,9 +35,6 @@ [](AutoEnrollmentSystemClockSyncError) { return std::string("System clock sync error"); }, - [](AutoEnrollmentMachineInfoRetrievalError) { - return std::string("Machine info retrieval error"); - }, [](AutoEnrollmentStateKeysRetrievalError) { return std::string("State keys retrieval error"); },
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h index c15f6b3f..7b11c4fb 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h
@@ -40,12 +40,6 @@ default; }; -// Represents an error while retrieving serial number and brand code. -struct AutoEnrollmentMachineInfoRetrievalError { - constexpr bool operator==( - const AutoEnrollmentMachineInfoRetrievalError&) const = default; -}; - // Represents an error while retrieving state keys. struct AutoEnrollmentStateKeysRetrievalError { constexpr bool operator==( @@ -85,7 +79,6 @@ using AutoEnrollmentError = absl::variant<AutoEnrollmentSafeguardTimeoutError, AutoEnrollmentSystemClockSyncError, - AutoEnrollmentMachineInfoRetrievalError, AutoEnrollmentStateKeysRetrievalError, AutoEnrollmentDMServerError, AutoEnrollmentStateAvailabilityResponseError,
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.cc index faa5cf1..b6b077b 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.cc
@@ -131,17 +131,8 @@ } #endif -#if BUILDFLAG(IS_CHROMEOS_DEVICE) // Official Google OSes support unified state determination. return IsOfficialGoogleOS(); -#else - // When running ChromeOS in Chrome (see go/simplerchrome), enrollment - // state determination will fail due to machine info retrieval error, see - // crbug.com/376252857 - // If you really want to run into that, use the command line switch - // `--enterprise-enable-unified-state-determination=always` to turn it on. - return false; -#endif } // static
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker_unittest.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker_unittest.cc index 4b37ae0..885bcab 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker_unittest.cc
@@ -631,17 +631,10 @@ }; TEST_P(AutoEnrollmentTypeCheckerUnifiedStateDeterminationTestP, Default) { -#if BUILDFLAG(IS_CHROMEOS_DEVICE) EXPECT_EQ(AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled(), IsOfficialGoogleOS()); -#else - // No state determination when running ChromeOS in Chrome (unless forced by - // flag). - EXPECT_FALSE(AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled()); -#endif } -#if BUILDFLAG(IS_CHROMEOS_DEVICE) TEST_P(AutoEnrollmentTypeCheckerUnifiedStateDeterminationTestP, OfficialBuild) { command_line_.GetProcessCommandLine()->AppendSwitchASCII( ash::switches::kEnterpriseEnableUnifiedStateDetermination, @@ -650,7 +643,6 @@ EXPECT_EQ(AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled(), IsOfficialGoogleOS()); } -#endif TEST_P(AutoEnrollmentTypeCheckerUnifiedStateDeterminationTestP, Never) { command_line_.GetProcessCommandLine()->AppendSwitchASCII(
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc index 560b577..9c08bc5 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc
@@ -89,9 +89,6 @@ [](AutoEnrollmentSystemClockSyncError) { return kUMASuffixConnectionError; }, - [](AutoEnrollmentMachineInfoRetrievalError) { - return kUMASuffixMachineInfoRetrievalError; - }, [](AutoEnrollmentStateKeysRetrievalError) { return kUMASuffixStateKeysRetrievalError; }, @@ -891,10 +888,9 @@ if (!device_identifiers_.Retrieve(context_.statistics_provider, context_.rlz_brand_code, context_.serial_number)) { - // Block OOBE if the serial number and/or brand code cannot be obtained. - // The device is likely in need of repair at this point. - return ReportResult( - base::unexpected(AutoEnrollmentMachineInfoRetrievalError{})); + // Skip enrollment if serial number or brand code are missing. + // This is expected to happen for prototype devices, for instance. + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } step_started_ = base::TimeTicks::Now();
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc index 72d0e99..388241e0 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc
@@ -378,7 +378,7 @@ const AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, ToState(AutoEnrollmentMachineInfoRetrievalError())); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 2 /*kRlzBrandCodeMissing*/, 1); } @@ -389,7 +389,7 @@ const AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, ToState(AutoEnrollmentMachineInfoRetrievalError())); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 1 /*kRlzBrandCodeMissing*/, 1); } @@ -401,7 +401,7 @@ const AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, ToState(AutoEnrollmentMachineInfoRetrievalError())); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 3 /*kAllMissing*/, 1); }
diff --git a/chrome/browser/ash/scanner/scanner_keyed_service.cc b/chrome/browser/ash/scanner/scanner_keyed_service.cc index 3ba459b..06de28bd 100644 --- a/chrome/browser/ash/scanner/scanner_keyed_service.cc +++ b/chrome/browser/ash/scanner/scanner_keyed_service.cc
@@ -11,6 +11,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" +#include "ash/constants/generative_ai_country_restrictions.h" #include "base/check_deref.h" #include "base/containers/span.h" #include "base/feature_list.h" @@ -96,25 +97,7 @@ base::BindRepeating([](AccountCapabilities capabilities) { return capabilities.can_use_manta_service(); }); - config.country_codes = { - "ae", "ag", "ai", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "az", - "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", - "bq", "br", "bs", "bt", "bw", "bz", "ca", "cc", "cd", "cf", "cg", "ch", - "ci", "ck", "cl", "cm", "co", "cr", "cv", "cw", "cx", "cy", "cz", "de", - "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", - "fi", "fj", "fk", "fm", "fr", "ga", "gb", "gd", "ge", "gg", "gh", "gi", - "gm", "gn", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hm", "hn", "hr", - "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "is", "it", "je", - "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kr", "kw", "ky", - "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", - "ma", "mg", "mh", "ml", "mn", "mp", "mr", "ms", "mt", "mu", "mv", "mw", - "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", - "nr", "nu", "nz", "om", "pa", "pe", "pg", "ph", "pk", "pl", "pm", "pn", - "pr", "ps", "pt", "pw", "py", "qa", "ro", "rw", "sa", "sb", "sc", "sd", - "se", "sg", "sh", "si", "sk", "sl", "sn", "so", "sr", "ss", "st", "sv", - "sz", "tc", "td", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", - "tt", "tv", "tw", "tz", "ug", "um", "us", "uy", "uz", "vc", "ve", "vg", - "vi", "vn", "vu", "wf", "ws", "ye", "za", "zm", "zw"}; + config.country_codes = ash::GetGenerativeAiCountryAllowlist(); return config; }
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc index bcc992d..296eceb 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc
@@ -23,6 +23,7 @@ #include "ash/webui/common/mojom/sea_pen.mojom.h" #include "ash/webui/common/mojom/sea_pen_generated.mojom-shared.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" +#include "base/check_deref.h" #include "base/containers/flat_map.h" #include "base/containers/span.h" #include "base/files/file_util.h" @@ -215,6 +216,7 @@ wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(&test_wallpaper_controller_);
diff --git a/chrome/browser/ash/test/BUILD.gn b/chrome/browser/ash/test/BUILD.gn index 83cb62c..7879a8f 100644 --- a/chrome/browser/ash/test/BUILD.gn +++ b/chrome/browser/ash/test/BUILD.gn
@@ -12,6 +12,8 @@ sources = [ "kiosk_logged_in_browser_test_mixin.cc", "kiosk_logged_in_browser_test_mixin.h", + "public_account_logged_in_browser_test_mixin.cc", + "public_account_logged_in_browser_test_mixin.h", ] deps = [
diff --git a/chrome/browser/ash/test/DEPS b/chrome/browser/ash/test/DEPS index 8e97dbf..092281e9 100644 --- a/chrome/browser/ash/test/DEPS +++ b/chrome/browser/ash/test/DEPS
@@ -21,7 +21,7 @@ "device_restriction_schedule_controller_browsertest\.cc": [ "+ui/message_center", ], - "kiosk_logged_in_browser_test_mixin\.(h|cc)": [ + ".*_browser_test_mixin\.(h|cc)": [ "+chrome/test/base/mixin_based_in_process_browser_test.h", ], }
diff --git a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc new file mode 100644 index 0000000..876ca7e --- /dev/null +++ b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc
@@ -0,0 +1,35 @@ +// Copyright 2025 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/test/public_account_logged_in_browser_test_mixin.h" + +#include "ash/constants/ash_switches.h" +#include "components/account_id/account_id.h" +#include "components/prefs/pref_service.h" +#include "components/user_manager/test_helper.h" + +namespace ash { + +PublicAccountLoggedInBrowserTestMixin::PublicAccountLoggedInBrowserTestMixin( + InProcessBrowserTestMixinHost* host, + std::string user_id) + : InProcessBrowserTestMixin(host), user_id_(std::move(user_id)) {} + +PublicAccountLoggedInBrowserTestMixin:: + ~PublicAccountLoggedInBrowserTestMixin() = default; + +void PublicAccountLoggedInBrowserTestMixin::SetUpCommandLine( + base::CommandLine* command_line) { + command_line->AppendSwitchASCII(ash::switches::kLoginUser, user_id_); + command_line->AppendSwitchASCII(ash::switches::kLoginProfile, + user_manager::TestHelper::GetFakeUsernameHash( + AccountId::FromUserEmail(user_id_))); +} + +void PublicAccountLoggedInBrowserTestMixin::SetUpLocalStatePrefService( + PrefService* local_state) { + user_manager::TestHelper::RegisterPublicAccountUser(*local_state, user_id_); +} + +} // namespace ash
diff --git a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h new file mode 100644 index 0000000..3307b91 --- /dev/null +++ b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h
@@ -0,0 +1,35 @@ +// Copyright 2025 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_TEST_PUBLIC_ACCOUNT_LOGGED_IN_BROWSER_TEST_MIXIN_H_ +#define CHROME_BROWSER_ASH_TEST_PUBLIC_ACCOUNT_LOGGED_IN_BROWSER_TEST_MIXIN_H_ + +#include <string> + +#include "chrome/test/base/mixin_based_in_process_browser_test.h" + +namespace ash { + +// Registers a new PublicAccount User, and then use the user to enter +// into a session. +class PublicAccountLoggedInBrowserTestMixin : public InProcessBrowserTestMixin { + public: + // `user_id` is the ID for the PublicAccount user, which must satisfy + // to be used for a PublicAccount user. + // See policy::GetDeviceLocalAccountType for details. + PublicAccountLoggedInBrowserTestMixin(InProcessBrowserTestMixinHost* host, + std::string user_id); + ~PublicAccountLoggedInBrowserTestMixin() override; + + // InProcessBrowserTestMixin: + void SetUpCommandLine(base::CommandLine* command_line) override; + void SetUpLocalStatePrefService(PrefService* local_state) override; + + private: + const std::string user_id_; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_ASH_TEST_PUBLIC_ACCOUNT_LOGGED_IN_BROWSER_TEST_MIXIN_H_
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h index 8369bf2..77a4596 100644 --- a/chrome/browser/chrome_browser_main.h +++ b/chrome/browser/chrome_browser_main.h
@@ -11,7 +11,6 @@ #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/buildflags.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/policy/messaging_layer/public/report_client.h" @@ -195,7 +194,7 @@ downgrade::DowngradeManager downgrade_manager_; #endif -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) // Android's first run is done in Java instead of native. Chrome OS does not // use master preferences. std::unique_ptr<first_run::MasterPrefs> master_prefs_;
diff --git a/chrome/browser/chrome_browser_main_extra_parts_ozone.cc b/chrome/browser/chrome_browser_main_extra_parts_ozone.cc index 33b426b..669c494 100644 --- a/chrome/browser/chrome_browser_main_extra_parts_ozone.cc +++ b/chrome/browser/chrome_browser_main_extra_parts_ozone.cc
@@ -7,6 +7,7 @@ #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/logging.h" +#include "build/build_config.h" #include "chrome/browser/lifetime/application_lifetime_desktop.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -27,10 +28,7 @@ } void ChromeBrowserMainExtraPartsOzone::PostMainMessageLoopRun() { -#if !BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_LINUX) - // Lacros's `PostMainMessageLoopRun` must be called at the very end of - // `PostMainMessageLoopRun` in - // `ChromeBrowserMainPartsLacros::PostMainMessageLoopRun`. +#if !BUILDFLAG(IS_LINUX) ui::OzonePlatform::GetInstance()->PostMainMessageLoopRun(); #endif }
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index a505d7b3..d06edc3 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -15,7 +15,6 @@ #include "base/task/single_thread_task_runner.h" #include "base/task/thread_pool.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/branded_strings.h" @@ -34,15 +33,11 @@ #include "components/metrics/call_stacks/stack_sampling_recorder.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/lacros/dbus/lacros_dbus_thread_manager.h" -#endif - #if BUILDFLAG(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/dbus_memory_pressure_evaluator_linux.h" #endif -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) #include "base/linux_util.h" #include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_switches.h" @@ -65,8 +60,8 @@ base::MakeRefCounted<metrics::StackSamplingRecorder>(); stack_sampling_recorder_->Start(); } - // Don't initialize DBus here. Ash and Lacros Bluetooth DBusManager - // initialization depend on FeatureList, and is done elsewhere. + // Don't initialize DBus here. Bluetooth DBusManager initialization depends on + // FeatureList, and is done elsewhere. #endif // BUILDFLAG(IS_CHROMEOS) #if !BUILDFLAG(IS_CHROMEOS) @@ -104,7 +99,7 @@ #endif void ChromeBrowserMainPartsLinux::PreProfileInit() { -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) // Needs to be called after we have chrome::DIR_USER_DATA and // g_browser_process. This happens in PreCreateThreads. // base::GetLinuxDistro() will initialize its value if needed.
diff --git a/chrome/browser/chrome_browser_main_linux.h b/chrome/browser/chrome_browser_main_linux.h index 3851e68..fbe925d 100644 --- a/chrome/browser/chrome_browser_main_linux.h +++ b/chrome/browser/chrome_browser_main_linux.h
@@ -44,10 +44,8 @@ private: #if BUILDFLAG(IS_CHROMEOS) - // Used by ChromeOS tast tests. This is used by both Lacros and Ash, which - // is why it's in ChromeBrowserMainPartsLinux, even though it's not used in - // Linux. ChromeBrowserMainPartsLinux is the base class of both - // ChromeBrowserMainPartsAsh and ChromeBrowserMainPartsLacros. + // Used by ChromeOS tast tests. This is in ChromeBrowserMainPartsLinux for + // historical reasons and should be moved to ChromeBrowserMainPartsAsh. scoped_refptr<metrics::StackSamplingRecorder> stack_sampling_recorder_; #endif };
diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index 62d4c7c..1a1a448 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc
@@ -22,7 +22,6 @@ #include "base/functional/bind.h" #include "base/notreached.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/lifetime/application_lifetime_desktop.h" @@ -82,9 +81,7 @@ // ExitHandler takes care of deleting itself. new ExitHandler(); } else { -// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch -// of lacros-chrome is complete. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) switch (signal) { case SIGINT: case SIGHUP: @@ -134,7 +131,7 @@ // static void ExitHandler::Exit() { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // On ChromeOS, exiting on signal should be always clean. chrome::ExitIgnoreUnloadHandlers(); #else @@ -176,7 +173,7 @@ } void ChromeBrowserMainPartsPosix::ShowMissingLocaleMessageBox() { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) NOTREACHED(); // Should not ever happen on ChromeOS. #elif BUILDFLAG(IS_MAC) // Not called on Mac because we load the locale files differently.
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index b8b6b96..bbeb6a0 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -568,6 +568,7 @@ #include "chrome/browser/file_system_access/cloud_identifier/cloud_identifier_util_cros.h" #include "chrome/browser/policy/system_features_disable_list_policy_handler.h" #include "chrome/browser/smart_card/chromeos_smart_card_delegate.h" +#include "chrome/browser/web_applications/chromeos_web_app_experiments.h" #include "chrome/browser/web_applications/web_app_tab_helper.h" #include "chrome/common/chromeos/extensions/chromeos_system_extension_info.h" #include "chromeos/ash/components/quickoffice/quickoffice_prefs.h" @@ -4285,6 +4286,10 @@ void ChromeContentBrowserClient::MaybeOverrideManifest( content::RenderFrameHost* render_frame_host, blink::mojom::ManifestPtr& manifest) { +#if BUILDFLAG(IS_CHROMEOS) + web_app::ChromeOsWebAppExperiments::MaybeOverrideManifest(render_frame_host, + manifest); +#endif #if !BUILDFLAG(IS_ANDROID) Profile* profile = Profile::FromBrowserContext(render_frame_host->GetBrowserContext());
diff --git a/chrome/browser/contextual_cueing/BUILD.gn b/chrome/browser/contextual_cueing/BUILD.gn index 1e806a5c..8962efb 100644 --- a/chrome/browser/contextual_cueing/BUILD.gn +++ b/chrome/browser/contextual_cueing/BUILD.gn
@@ -10,7 +10,6 @@ "contextual_cueing_enums.h", "contextual_cueing_features.h", "contextual_cueing_helper.h", - "contextual_cueing_service.h", "contextual_cueing_service_factory.h", "nudge_cap_tracker.h", ] @@ -25,11 +24,8 @@ source_set("impl") { sources = [ "contextual_cueing_features.cc", - "contextual_cueing_helper.cc", "contextual_cueing_page_data.cc", "contextual_cueing_page_data.h", - "contextual_cueing_service.cc", - "contextual_cueing_service_factory.cc", "nudge_cap_tracker.cc", ] deps = [
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_features.cc b/chrome/browser/contextual_cueing/contextual_cueing_features.cc index b88d51a4..48c5117 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_features.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_features.cc
@@ -51,4 +51,9 @@ "PdfPageCountCaptureDelay", base::Seconds(4)); +const base::FeatureParam<bool> kEnablePageContentExtraction( + &kContextualCueing, + "EnablePageContentExtraction", + true); + } // namespace contextual_cueing
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_features.h b/chrome/browser/contextual_cueing/contextual_cueing_features.h index e24f492e..6a1c1ed 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_features.h +++ b/chrome/browser/contextual_cueing/contextual_cueing_features.h
@@ -41,6 +41,10 @@ // The amount of time to wait for capturing the page count for a PDF document. extern const base::FeatureParam<base::TimeDelta> kPdfPageCountCaptureDelay; +// Whether to enable page content extraction which is needed for processing the +// count of words client signal. +extern const base::FeatureParam<bool> kEnablePageContentExtraction; + } // namespace contextual_cueing #endif // CHROME_BROWSER_CONTEXTUAL_CUEING_CONTEXTUAL_CUEING_FEATURES_H_
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_helper.cc b/chrome/browser/contextual_cueing/contextual_cueing_helper.cc index 84e8088..fe37ae4 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_helper.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_helper.cc
@@ -187,7 +187,7 @@ void ContextualCueingHelper::OnCueingDecision( std::unique_ptr<ScopedNudgeDecisionRecorder> decision_recorder, - const std::string& cue_label) { + std::string cue_label) { CHECK_EQ(NudgeDecision::kUnknown, decision_recorder->nudge_decision()); if (ContextualCueingPageData::GetForPage(web_contents()->GetPrimaryPage())) { ContextualCueingPageData::DeleteForPage(web_contents()->GetPrimaryPage());
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_helper.h b/chrome/browser/contextual_cueing/contextual_cueing_helper.h index 1495309..46f2617 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_helper.h +++ b/chrome/browser/contextual_cueing/contextual_cueing_helper.h
@@ -53,7 +53,7 @@ void OnCueingDecision( std::unique_ptr<ScopedNudgeDecisionRecorder> decision_recorder, - const std::string& cue_label); + std::string cue_label); bool IsBrowserBlockingNudges(ScopedNudgeDecisionRecorder* recorder);
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_helper_interactive_uitest.cc b/chrome/browser/contextual_cueing/contextual_cueing_helper_interactive_uitest.cc index 5dcd140..a9089a3 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_helper_interactive_uitest.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_helper_interactive_uitest.cc
@@ -4,6 +4,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" +#include "base/test/test_future.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/contextual_cueing/contextual_cueing_enums.h" #include "chrome/browser/contextual_cueing/contextual_cueing_features.h" @@ -24,11 +25,13 @@ #include "components/optimization_guide/core/optimization_metadata.h" #include "components/optimization_guide/proto/contextual_cueing_metadata.pb.h" #include "components/optimization_guide/proto/icon_view_metadata.pb.h" +#include "components/page_content_annotations/core/page_content_annotations_features.h" #include "components/signin/public/identity_manager/account_capabilities_test_mutator.h" #include "components/ukm/test_ukm_recorder.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" +#include "net/dns/mock_host_resolver.h" #include "services/metrics/public/cpp/ukm_builders.h" #if BUILDFLAG(ENABLE_GLIC) @@ -37,8 +40,13 @@ public: void OnTriggerGlicNudgeUI(std::string label) override { last_nudge_label_ = label; + if (!last_nudge_label_.empty()) { + future_.SetValue(); + } } + void WaitUntilValidNudge() { future_.Get(); } std::string last_nudge_label_; + base::test::TestFuture<void> future_; }; class ContextualCueingHelperBrowserTest : public InProcessBrowserTest { @@ -52,13 +60,24 @@ {"NudgeCapTime", "0h"}, {"NudgeCapCount", "10"}, {"MinPageCountBetweenNudges", "0"}}}, + {page_content_annotations::features::kAnnotatedPageContentExtraction, + {}}, {features::kGlic, {}}, {features::kTabstripComboButton, {}}}, /*disabled_features=*/{}); } + void SetUp() override { + https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_TEST_NAMES); + https_server_.ServeFilesFromSourceDirectory(GetChromeTestDataDir()); + ASSERT_TRUE(https_server_.Start()); + + InProcessBrowserTest::SetUp(); + } + void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); + host_resolver()->AddRule("*", "127.0.0.1"); identity_test_env_adaptor_ = std::make_unique<IdentityTestEnvironmentProfileAdaptor>( browser()->profile()); @@ -84,9 +103,10 @@ optimization_guide::OptimizationMetadata metadata; metadata.SetAnyMetadataForTesting(cueing_metadata); OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()) - ->AddHintForTesting(GURL("https://enabled.com/"), - optimization_guide::proto::GLIC_CONTEXTUAL_CUEING, - metadata); + ->AddHintForTesting( + https_server_.GetURL("enabled.com", + "/optimization_guide/hello.html"), + optimization_guide::proto::GLIC_CONTEXTUAL_CUEING, metadata); } void EnableSignIn() { @@ -104,7 +124,7 @@ return browser()->browser_window_features()->glic_nudge_controller(); } - private: + protected: void OnWillCreateBrowserContextServices(content::BrowserContext* context) { IdentityTestEnvironmentProfileAdaptor:: SetIdentityTestEnvironmentFactoriesOnBrowserContext(context); @@ -116,6 +136,8 @@ std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> identity_test_env_adaptor_; base::CallbackListSubscription create_services_subscription_; + + net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; }; IN_PROC_BROWSER_TEST_F(ContextualCueingHelperBrowserTest, @@ -130,7 +152,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); EXPECT_EQ("test label", nudge_observer.last_nudge_label_); @@ -162,7 +185,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); EXPECT_EQ("", nudge_observer.last_nudge_label_); @@ -194,15 +218,16 @@ optimization_guide::OptimizationMetadata metadata; metadata.set_any_metadata(optimization_guide::proto::Any()); OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()) - ->AddHintForTesting(GURL("https://enabled.com/"), - optimization_guide::proto::GLIC_CONTEXTUAL_CUEING, - metadata); + ->AddHintForTesting( + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), + optimization_guide::proto::GLIC_CONTEXTUAL_CUEING, metadata); FakeGlicNudgeObserver nudge_observer; glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); EXPECT_EQ("", nudge_observer.last_nudge_label_); @@ -247,7 +272,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); EXPECT_EQ("", nudge_observer.last_nudge_label_); @@ -294,7 +320,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); EXPECT_EQ("test label", nudge_observer.last_nudge_label_); @@ -323,7 +350,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); @@ -343,7 +371,8 @@ glic_nudge_controller()->AddObserver(&nudge_observer); ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL("https://enabled.com/"), + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); @@ -362,4 +391,53 @@ "ContextualCueing.NudgeInteraction", contextual_cueing::NudgeInteraction::kIgnoredTabChange, 1); } -#endif + +IN_PROC_BROWSER_TEST_F(ContextualCueingHelperBrowserTest, + TestCueLabelDisplayedForWordCount) { + base::HistogramTester histogram_tester; + ukm::TestAutoSetUkmRecorder ukm_recorder; + + EnableSignIn(); + optimization_guide::proto::GlicContextualCueingMetadata cueing_metadata; + auto* cueing_config = cueing_metadata.add_cueing_configurations(); + cueing_config->set_cue_label("cue label"); + auto* cond = cueing_config->add_conditions(); + cond->set_signal( + optimization_guide::proto:: + CONTEXTUAL_CUEING_CLIENT_SIGNAL_CONTENT_LENGTH_WORD_COUNT); + cond->set_cueing_operator( + optimization_guide::proto:: + CONTEXTUAL_CUEING_OPERATOR_GREATER_THAN_OR_EQUAL_TO); + cond->set_int64_threshold(3); + + SetUpEnabledHints(cueing_metadata); + + FakeGlicNudgeObserver nudge_observer; + glic_nudge_controller()->AddObserver(&nudge_observer); + + ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( + browser(), + https_server_.GetURL("enabled.com", "/optimization_guide/hello.html"), + WindowOpenDisposition::NEW_FOREGROUND_TAB, + ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); + nudge_observer.WaitUntilValidNudge(); + EXPECT_EQ("cue label", nudge_observer.last_nudge_label_); + + histogram_tester.ExpectUniqueSample( + "ContextualCueing.NudgeDecision.GlicContextualCueing", + contextual_cueing::NudgeDecision::kSuccess, 1); + + auto entries = ukm_recorder.GetEntriesByName( + ukm::builders::ContextualCueing_NudgeDecision::kEntryName); + EXPECT_EQ(1u, entries.size()); + auto* entry = entries[0].get(); + ukm_recorder.ExpectEntryMetric( + entry, + ukm::builders::ContextualCueing_NudgeDecision::kOptimizationTypeName, + static_cast<int64_t>(optimization_guide::proto::GLIC_CONTEXTUAL_CUEING)); + ukm_recorder.ExpectEntryMetric( + entry, ukm::builders::ContextualCueing_NudgeDecision::kNudgeDecisionName, + static_cast<int64_t>(contextual_cueing::NudgeDecision::kSuccess)); +} + +#endif // BUILDFLAG(ENABLE_GLIC)
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_helper_unittest.cc b/chrome/browser/contextual_cueing/contextual_cueing_helper_unittest.cc index 0f55f8254..cd94b872 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_helper_unittest.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_helper_unittest.cc
@@ -8,6 +8,8 @@ #include "chrome/browser/contextual_cueing/contextual_cueing_features.h" #include "chrome/browser/optimization_guide/mock_optimization_guide_keyed_service.h" #include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h" +#include "chrome/browser/page_content_annotations/page_content_extraction_service.h" +#include "chrome/browser/page_content_annotations/page_content_extraction_service_factory.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" @@ -45,6 +47,12 @@ return std::make_unique<FakeOptimizationGuideKeyedService>(); } +std::unique_ptr<KeyedService> CreatePageContentExtractionService( + content::BrowserContext* context) { + return std::make_unique< + page_content_annotations::PageContentExtractionService>(); +} + class ContextualCueingHelperTest : public ChromeRenderViewHostTestHarness { public: ContextualCueingHelperTest() { @@ -95,8 +103,12 @@ TestingProfile::TestingFactories GetTestingFactories() const override { return {TestingProfile::TestingFactory{ - OptimizationGuideKeyedServiceFactory::GetInstance(), - base::BindRepeating(&CreateOptimizationGuideKeyedService)}}; + OptimizationGuideKeyedServiceFactory::GetInstance(), + base::BindRepeating(&CreateOptimizationGuideKeyedService)}, + TestingProfile::TestingFactory{ + page_content_annotations::PageContentExtractionServiceFactory:: + GetInstance(), + base::BindRepeating(&CreatePageContentExtractionService)}}; } private:
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_page_data.cc b/chrome/browser/contextual_cueing/contextual_cueing_page_data.cc index 3a524107..4e02eb36 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_page_data.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_page_data.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/contextual_cueing/contextual_cueing_page_data.h" +#include "base/i18n/char_iterator.h" #include "base/task/single_thread_task_runner.h" #include "chrome/browser/contextual_cueing/contextual_cueing_features.h" #include "content/public/browser/web_contents.h" @@ -38,6 +39,26 @@ } } +void CountWords(const optimization_guide::proto::ContentNode& content_node, + size_t max_word_count_limit, + size_t* word_count) { + bool is_previous_char_whitespace = true; + for (base::i18n::UTF8CharIterator iter( + content_node.content_attributes().text_data().text_content()); + *word_count < max_word_count_limit && !iter.end(); iter.Advance()) { + bool is_current_char_whitespace = base::IsUnicodeWhitespace(iter.get()); + if (is_previous_char_whitespace && !is_current_char_whitespace) { + // Count the start of the word. + ++*word_count; + } + is_previous_char_whitespace = is_current_char_whitespace; + } + + for (const auto& child : content_node.children_nodes()) { + CountWords(child, max_word_count_limit, word_count); + } +} + } // namespace ContextualCueingPageData::ContextualCueingPageData( @@ -45,7 +66,7 @@ optimization_guide::proto::GlicContextualCueingMetadata metadata, CueingDecisionCallback cueing_decision_callback) : content::PageUserData<ContextualCueingPageData>(page), - metadata_(metadata), + metadata_(std::move(metadata)), cueing_decision_callback_(std::move(cueing_decision_callback)) { FindMatchingConfig(); } @@ -58,17 +79,19 @@ void ContextualCueingPageData::FindMatchingConfig() { CHECK(cueing_decision_callback_); bool needs_pdf_page_count = false; + bool needs_page_content = false; for (const auto& config : metadata_.cueing_configurations()) { if (!config.has_cue_label()) { continue; } auto decision = DidMatchCueingConditions(config); if (decision == kAllowed) { - std::move(cueing_decision_callback_).Run(config.cue_label()); + std::move(cueing_decision_callback_).Run(std::move(config.cue_label())); return; - } - if (decision == kNeedsPdfPageCount) { + } else if (decision == kNeedsPdfPageCount) { needs_pdf_page_count = true; + } else if (decision == kNeedsPageContent) { + needs_page_content = true; } } if (needs_pdf_page_count) { @@ -82,6 +105,10 @@ return; #endif // BUILDFLAG(ENABLE_PDF) } + if (needs_page_content) { + // Wait till the page content is returned. + return; + } // None of the config matched, and no client-signals were requested. std::move(cueing_decision_callback_).Run(std::string()); } @@ -107,8 +134,26 @@ : kDisallowed; case optimization_guide::proto:: CONTEXTUAL_CUEING_CLIENT_SIGNAL_CONTENT_LENGTH_WORD_COUNT: - // TODO: crbug.com/389751174 - Implement checking the client signals. - return kDisallowed; + if (page().GetContentsMimeType() == pdf::kPDFMimeType) { + return kDisallowed; + } + if (page_content_word_count_info_ && + page_content_word_count_info_->page_contents_words) { + return DidMatchCueingCondition( + condition, + *page_content_word_count_info_->page_contents_words) + ? kAllowed + : kDisallowed; + } + if (!page_content_word_count_info_) { + page_content_word_count_info_ = {.max_count_needed = 0}; + } + if (page_content_word_count_info_->max_count_needed < + static_cast<size_t>(condition.int64_threshold())) { + page_content_word_count_info_->max_count_needed = + static_cast<size_t>(condition.int64_threshold()) + 1; + } + return kNeedsPageContent; } } return kAllowed; @@ -152,4 +197,19 @@ } #endif // BUILDFLAG(ENABLE_PDF) +void ContextualCueingPageData::OnPageContentExtracted( + const optimization_guide::proto::AnnotatedPageContent& page_content) { + if (!cueing_decision_callback_) { + return; + } + if (!page_content_word_count_info_) { + return; + } + size_t word_count = 0; + CountWords(page_content.root_node(), + page_content_word_count_info_->max_count_needed, &word_count); + page_content_word_count_info_->page_contents_words = word_count; + FindMatchingConfig(); +} + } // namespace contextual_cueing
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_page_data.h b/chrome/browser/contextual_cueing/contextual_cueing_page_data.h index 0f60cb2f..0bc6442 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_page_data.h +++ b/chrome/browser/contextual_cueing/contextual_cueing_page_data.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_CONTEXTUAL_CUEING_CONTEXTUAL_CUEING_PAGE_DATA_H_ #include "components/optimization_guide/proto/contextual_cueing_metadata.pb.h" +#include "components/optimization_guide/proto/features/common_quality_data.pb.h" #include "components/pdf/common/constants.h" #include "content/public/browser/page_user_data.h" #include "pdf/buildflags.h" @@ -17,12 +18,15 @@ class ContextualCueingPageData : public content::PageUserData<ContextualCueingPageData> { public: - using CueingDecisionCallback = base::OnceCallback<void(const std::string&)>; + using CueingDecisionCallback = base::OnceCallback<void(std::string)>; ContextualCueingPageData(const ContextualCueingPageData&) = delete; ContextualCueingPageData& operator=(const ContextualCueingPageData&) = delete; ~ContextualCueingPageData() override; + void OnPageContentExtracted( + const optimization_guide::proto::AnnotatedPageContent& page_content); + private: friend class content::PageUserData<ContextualCueingPageData>; friend class ContextualCueingPageDataTest; @@ -32,6 +36,19 @@ kAllowed, kDisallowed, kNeedsPdfPageCount, + kNeedsPageContent, + }; + + // Holds the info related to word count client signal. + struct WordCountInfo { + // Maximum word count needed for the cueing conditions. This limits + // iterating through the page content more than needed. + size_t max_count_needed = 0; + + // Count of words calculated from the page content. This is always less than + // or equal to `max_count_needed`. When the page count is more than the + // limit, the counting is stopped at the limit. + std::optional<size_t> page_contents_words; }; ContextualCueingPageData( @@ -67,6 +84,10 @@ // it. std::optional<size_t> pdf_page_count_; + // Holds the word count info. Populated only when word count signal is + // required for making the cueing decision. + std::optional<WordCountInfo> page_content_word_count_info_; + CueingDecisionCallback cueing_decision_callback_; base::WeakPtrFactory<ContextualCueingPageData> weak_factory_{this};
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_page_data_unittest.cc b/chrome/browser/contextual_cueing/contextual_cueing_page_data_unittest.cc index 48d0a52..eb6fc39 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_page_data_unittest.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_page_data_unittest.cc
@@ -41,7 +41,7 @@ }; TEST_F(ContextualCueingPageDataTest, Basic) { - base::test::TestFuture<const std::string&> future; + base::test::TestFuture<std::string> future; optimization_guide::proto::GlicContextualCueingMetadata metadata; auto* config = metadata.add_cueing_configurations(); config->set_cue_label("basic label"); @@ -54,7 +54,7 @@ } TEST_F(ContextualCueingPageDataTest, NonPdfPageFails) { - base::test::TestFuture<const std::string&> future; + base::test::TestFuture<std::string> future; optimization_guide::proto::GlicContextualCueingMetadata metadata; auto* config = metadata.add_cueing_configurations(); config->set_cue_label("basic label"); @@ -75,7 +75,7 @@ content::WebContentsTester::For(web_contents_.get()) ->SetMainFrameMimeType(pdf::kPDFMimeType); - base::test::TestFuture<const std::string&> future; + base::test::TestFuture<std::string> future; optimization_guide::proto::GlicContextualCueingMetadata metadata; auto* config = metadata.add_cueing_configurations(); config->set_cue_label("pdf label"); @@ -100,7 +100,7 @@ content::WebContentsTester::For(web_contents_.get()) ->SetMainFrameMimeType(pdf::kPDFMimeType); - base::test::TestFuture<const std::string&> future; + base::test::TestFuture<std::string> future; optimization_guide::proto::GlicContextualCueingMetadata metadata; auto* config = metadata.add_cueing_configurations(); config->set_cue_label("pdf label"); @@ -125,7 +125,7 @@ content::WebContentsTester::For(web_contents_.get()) ->SetMainFrameMimeType(pdf::kPDFMimeType); - base::test::TestFuture<const std::string&> future; + base::test::TestFuture<std::string> future; optimization_guide::proto::GlicContextualCueingMetadata metadata; auto* config = metadata.add_cueing_configurations(); config->set_cue_label("pdf label");
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_service.cc b/chrome/browser/contextual_cueing/contextual_cueing_service.cc index e6a9d99..15da6492 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_service.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_service.cc
@@ -9,6 +9,7 @@ #include "base/metrics/histogram_functions.h" #include "chrome/browser/contextual_cueing/contextual_cueing_enums.h" #include "chrome/browser/contextual_cueing/contextual_cueing_features.h" +#include "chrome/browser/contextual_cueing/contextual_cueing_page_data.h" #include "chrome/browser/ui/tabs/glic_nudge_controller.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_recorder.h" @@ -34,11 +35,22 @@ namespace contextual_cueing { -ContextualCueingService::ContextualCueingService() +ContextualCueingService::ContextualCueingService( + page_content_annotations::PageContentExtractionService* + page_content_extraction_service) : recent_nudge_tracker_(kNudgeCapCount.Get(), kNudgeCapTime.Get()), - recent_visited_origins_(kVisitedDomainsLimit.Get()) {} + recent_visited_origins_(kVisitedDomainsLimit.Get()), + page_content_extraction_service_(page_content_extraction_service) { + if (kEnablePageContentExtraction.Get()) { + page_content_extraction_service_->AddObserver(this); + } +} -ContextualCueingService::~ContextualCueingService() = default; +ContextualCueingService::~ContextualCueingService() { + if (kEnablePageContentExtraction.Get()) { + page_content_extraction_service_->RemoveObserver(this); + } +} void ContextualCueingService::ReportPageLoad() { if (remaining_quiet_loads_) { @@ -129,4 +141,15 @@ // navigation changes. } } + +void ContextualCueingService::OnPageContentExtracted( + content::Page& page, + const optimization_guide::proto::AnnotatedPageContent& page_content) { + auto* cueing_page_data = ContextualCueingPageData::GetForPage(page); + if (!cueing_page_data) { + return; + } + cueing_page_data->OnPageContentExtracted(page_content); +} + } // namespace contextual_cueing
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_service.h b/chrome/browser/contextual_cueing/contextual_cueing_service.h index b77f98d..ebfb113c 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_service.h +++ b/chrome/browser/contextual_cueing/contextual_cueing_service.h
@@ -13,6 +13,7 @@ #include "base/time/time.h" #include "chrome/browser/contextual_cueing/contextual_cueing_enums.h" #include "chrome/browser/contextual_cueing/nudge_cap_tracker.h" +#include "chrome/browser/page_content_annotations/page_content_extraction_service.h" #include "components/keyed_service/core/keyed_service.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "url/origin.h" @@ -25,9 +26,13 @@ namespace contextual_cueing { -class ContextualCueingService : public KeyedService { +class ContextualCueingService + : public KeyedService, + page_content_annotations::PageContentExtractionService::Observer { public: - ContextualCueingService(); + explicit ContextualCueingService( + page_content_annotations::PageContentExtractionService* + page_content_extraction_service); ~ContextualCueingService() override; // Reports a page load happened to `url`, and is used to keep track of quiet @@ -57,6 +62,12 @@ } private: + // page_content_annotations::PageContentExtractionService::Observer: + void OnPageContentExtracted( + content::Page& page, + const optimization_guide::proto::AnnotatedPageContent& page_content) + override; + // Returns true if nudge should not be shown due to the backoff rule. bool IsNudgeBlockedByBackoffRule() const; @@ -78,6 +89,9 @@ // Maintains the recently visited origins along with their nudge cap tracking. base::LRUCache<url::Origin, NudgeCapTracker> recent_visited_origins_; + raw_ptr<page_content_annotations::PageContentExtractionService> + page_content_extraction_service_ = nullptr; + base::WeakPtrFactory<ContextualCueingService> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc b/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc index 60de4e46..42b3beda 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_service_factory.cc
@@ -6,6 +6,7 @@ #include "base/no_destructor.h" #include "chrome/browser/contextual_cueing/contextual_cueing_service.h" +#include "chrome/browser/page_content_annotations/page_content_extraction_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/core/keyed_service.h" @@ -30,14 +31,19 @@ "ContextualCueingService", ProfileSelections::Builder() .WithRegular(ProfileSelection::kOriginalOnly) - .Build()) {} + .Build()) { + DependsOn(page_content_annotations::PageContentExtractionServiceFactory:: + GetInstance()); +} ContextualCueingServiceFactory::~ContextualCueingServiceFactory() = default; std::unique_ptr<KeyedService> ContextualCueingServiceFactory::BuildServiceInstanceForBrowserContext( content::BrowserContext* context) const { - return std::make_unique<ContextualCueingService>(); + return std::make_unique<ContextualCueingService>( + page_content_annotations::PageContentExtractionServiceFactory:: + GetForProfile(Profile::FromBrowserContext(context))); } } // namespace contextual_cueing
diff --git a/chrome/browser/contextual_cueing/contextual_cueing_service_unittest.cc b/chrome/browser/contextual_cueing/contextual_cueing_service_unittest.cc index 28f9de12..7c94b79 100644 --- a/chrome/browser/contextual_cueing/contextual_cueing_service_unittest.cc +++ b/chrome/browser/contextual_cueing/contextual_cueing_service_unittest.cc
@@ -34,7 +34,8 @@ void SetUp() override { InitializeFeatureList(); - service_ = std::make_unique<ContextualCueingService>(); + service_ = std::make_unique<ContextualCueingService>( + &page_content_extraction_service_); } ContextualCueingService* service() { return service_.get(); } @@ -44,6 +45,8 @@ protected: base::test::ScopedFeatureList scoped_feature_list_; + page_content_annotations::PageContentExtractionService + page_content_extraction_service_; std::unique_ptr<ContextualCueingService> service_; };
diff --git a/chrome/browser/gcm/gcm_profile_service_factory.cc b/chrome/browser/gcm/gcm_profile_service_factory.cc index d3e88eb..e6188f2e 100644 --- a/chrome/browser/gcm/gcm_profile_service_factory.cc +++ b/chrome/browser/gcm/gcm_profile_service_factory.cc
@@ -3,11 +3,14 @@ // found in the LICENSE file. #include "chrome/browser/gcm/gcm_profile_service_factory.h" + #include <memory> +#include "base/feature_list.h" #include "base/functional/bind.h" #include "base/no_destructor.h" #include "base/task/sequenced_task_runner.h" +#include "base/task/single_thread_task_runner_thread_mode.h" #include "base/task/thread_pool.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" @@ -39,6 +42,12 @@ namespace { #if !BUILDFLAG(IS_ANDROID) +// When enabled, GCM will use a dedicated thread for network operations instead +// of the IO thread. +BASE_FEATURE(kGCMUseDedicatedNetworkThread, + "GCMUseDedicatedNetworkThread", + base::FEATURE_DISABLED_BY_DEFAULT); + // Requests a ProxyResolvingSocketFactory on the UI thread. Note that a WeakPtr // of GCMProfileService is needed to detect when the KeyedService shuts down, // and avoid calling into |profile| which might have also been destroyed. @@ -47,8 +56,9 @@ base::WeakPtr<GCMProfileService> service, mojo::PendingReceiver<network::mojom::ProxyResolvingSocketFactory> receiver) { - if (!service || !profile) + if (!service || !profile) { return; + } network::mojom::NetworkContext* network_context = profile->GetDefaultStoragePartition()->GetNetworkContext(); network_context->CreateProxyResolvingSocketFactory(std::move(receiver)); @@ -65,7 +75,18 @@ std::move(profile), std::move(service), std::move(receiver))); } -#endif + +scoped_refptr<base::SequencedTaskRunner> GetNetworkThreadTaskRunner() { + if (base::FeatureList::IsEnabled(kGCMUseDedicatedNetworkThread)) { + return base::ThreadPool::CreateSingleThreadTaskRunner( + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::SingleThreadTaskRunnerThreadMode::SHARED); + } + return content::GetIOThreadTaskRunner({}); +} + +#endif // !BUILDFLAG(IS_ANDROID) GCMProfileServiceFactory::GlobalTestingFactory& GetTestingFactory() { static base::NoDestructor<GCMProfileServiceFactory::GlobalTestingFactory> @@ -161,7 +182,7 @@ gcm::GetProductCategoryForSubtypes(profile->GetPrefs()), IdentityManagerFactory::GetForProfile(profile), std::make_unique<GCMClientFactory>(), content::GetUIThreadTaskRunner({}), - content::GetIOThreadTaskRunner({}), blocking_task_runner); + GetNetworkThreadTaskRunner(), blocking_task_runner); #endif #if BUILDFLAG(ENABLE_OFFLINE_PAGES) // TODO(crbug.com/40260641): Removing image fetcher references here breaks
diff --git a/chrome/browser/glic/glic_window_animator.cc b/chrome/browser/glic/glic_window_animator.cc index 4f31b92..06f682fc 100644 --- a/chrome/browser/glic/glic_window_animator.cc +++ b/chrome/browser/glic/glic_window_animator.cc
@@ -27,14 +27,6 @@ GlicWindowAnimator::~GlicWindowAnimator() = default; -void GlicWindowAnimator::CreateNewAnimationAndStart( - gfx::Rect target_bounds, - base::TimeDelta duration, - base::OnceClosure callback) { - window_resize_animation_ = std::make_unique<GlicWindowResizeAnimation>( - window_controller_, this, target_bounds, duration, std::move(callback)); -} - void GlicWindowAnimator::RunOpenAttachedAnimation(GlicButton* glic_button, const gfx::Size& target_size, base::OnceClosure callback) { @@ -77,53 +69,49 @@ base::OnceClosure callback) { CHECK(window_controller_->GetGlicWidget()); - if (window_resize_animation_) { - // TODO(394686499): Do something more graceful than jumping to the end. - // This can cause re-entrancy, which can be problematic. If there are bugs - // check here first. - window_resize_animation_->End(); - } - if (duration < base::Milliseconds(0)) { duration = base::Milliseconds(0); } - CreateNewAnimationAndStart(target_bounds, duration, std::move(callback)); + if (window_resize_animation_) { + // Update the ongoing animation with the new bounds and new duration. + window_resize_animation_->UpdateTargetBounds(target_bounds, + std::move(callback)); + window_resize_animation_->SetDuration( + std::max(window_resize_animation_->duration_left(), duration)); + } else { + window_resize_animation_ = std::make_unique<GlicWindowResizeAnimation>( + window_controller_, this, target_bounds, duration, std::move(callback)); + } } void GlicWindowAnimator::AnimateSize(const gfx::Size& target_size, base::TimeDelta duration, base::OnceClosure callback) { - if (window_resize_animation_) { - // TODO(394686499): refine how running bounds change animations are updated. - // Moves the top-right corner, if we update size we must also update - // position. - window_resize_animation_->UpdateTargetSize(target_size, - std::move(callback)); - } else { - // Maintain the top-right corner. - gfx::Rect current_bounds = - window_controller_->GetGlicWidget()->GetWindowBoundsInScreen(); - int original_top_right = current_bounds.x() + current_bounds.width(); - current_bounds.set_size(target_size); - current_bounds.set_x(original_top_right - target_size.width()); - AnimateBounds(current_bounds, duration, std::move(callback)); - } + // Maintain the top-right corner whether there's an ongoing animation or not. + gfx::Rect target_bounds = GetCurrentTargetBounds(); + int original_right = target_bounds.right(); + target_bounds.set_size(target_size); + target_bounds.set_x(original_right - target_size.width()); + AnimateBounds(target_bounds, duration, std::move(callback)); } void GlicWindowAnimator::AnimatePosition(const gfx::Point& target_position, base::TimeDelta duration, base::OnceClosure callback) { + // Maintain the size whether there's an ongoing animation or not. + + gfx::Rect new_bounds = GetCurrentTargetBounds(); + new_bounds.set_origin(target_position); + AnimateBounds(new_bounds, duration, std::move(callback)); +} + +gfx::Rect GlicWindowAnimator::GetCurrentTargetBounds() { if (window_resize_animation_) { - // TODO(394686499): Refine how running bounds change animations are updated. - window_resize_animation_->UpdateTargetPosition(target_position, - std::move(callback)); + // Get the ongoing animation's target bounds if they exist. + return window_resize_animation_->target_bounds(); } else { - // Maintain the size. - gfx::Rect new_bounds = - window_controller_->GetGlicWidget()->GetWindowBoundsInScreen(); - new_bounds.set_origin(target_position); - AnimateBounds(new_bounds, duration, std::move(callback)); + return window_controller_->GetGlicWidget()->GetWindowBoundsInScreen(); } }
diff --git a/chrome/browser/glic/glic_window_animator.h b/chrome/browser/glic/glic_window_animator.h index 65e8d8e..84ad176f 100644 --- a/chrome/browser/glic/glic_window_animator.h +++ b/chrome/browser/glic/glic_window_animator.h
@@ -27,11 +27,6 @@ GlicWindowAnimator& operator=(const GlicWindowAnimator&) = delete; ~GlicWindowAnimator() override; - // Creates a new GlicWindowResizeAnimation instance and starts animating. - void CreateNewAnimationAndStart(gfx::Rect target_bounds, - base::TimeDelta duration, - base::OnceClosure callback); - // Runs the attached open widget animation for the Glic widget. void RunOpenAttachedAnimation(GlicButton* glic_button, const gfx::Size& target_size, @@ -67,6 +62,11 @@ void ResizeFinished(); private: + // Gets the bounds for the widget's resize animation. If there is an animation + // already ongoing, use the target bounds for that animation. Otherwise, use + // the widget's current bounds. + gfx::Rect GetCurrentTargetBounds(); + // GlicWindowController owns GlicWindowAnimator and will outlive it const raw_ptr<GlicWindowController> window_controller_; std::unique_ptr<GlicWindowResizeAnimation> window_resize_animation_;
diff --git a/chrome/browser/glic/glic_window_resize_animation.cc b/chrome/browser/glic/glic_window_resize_animation.cc index 6e0188c..1ef162d2 100644 --- a/chrome/browser/glic/glic_window_resize_animation.cc +++ b/chrome/browser/glic/glic_window_resize_animation.cc
@@ -64,6 +64,7 @@ window_controller_->GetGlicWidget()->SetBounds(gfx::Tween::RectValueBetween( gfx::Tween::CalculateValue(gfx::Tween::EASE_IN_OUT_EMPHASIZED, state), initial_bounds_, new_bounds_)); + duration_left_ = (1 - GetCurrentValue()) * duration(); } void GlicWindowResizeAnimation::AnimationEnded(const Animation* animation) { @@ -71,16 +72,10 @@ glic_window_animator_->ResizeFinished(); } -void GlicWindowResizeAnimation::UpdateTargetPosition( - const gfx::Point& point, +void GlicWindowResizeAnimation::UpdateTargetBounds( + const gfx::Rect& target_bounds, base::OnceClosure callback) { - new_bounds_.set_origin(point); - destruction_callbacks_->AddUnsafe(std::move(callback)); -} - -void GlicWindowResizeAnimation::UpdateTargetSize(const gfx::Size& size, - base::OnceClosure callback) { - new_bounds_.set_size(size); + new_bounds_ = target_bounds; destruction_callbacks_->AddUnsafe(std::move(callback)); }
diff --git a/chrome/browser/glic/glic_window_resize_animation.h b/chrome/browser/glic/glic_window_resize_animation.h index 0e27ac2b..5afd61f 100644 --- a/chrome/browser/glic/glic_window_resize_animation.h +++ b/chrome/browser/glic/glic_window_resize_animation.h
@@ -37,17 +37,17 @@ delete; ~GlicWindowResizeAnimation() override; + base::TimeDelta duration_left() const { return duration_left_; } + + gfx::Rect target_bounds() const { return new_bounds_; } + void AnimateToState(double state) override; void AnimationEnded(const Animation* animation) override; - // Change the target position only and add `callback` to the list of callbacks + // Change the target bounds only and add `callback` to the list of callbacks // to be run on destruction. - void UpdateTargetPosition(const gfx::Point& point, - base::OnceClosure callback); - - // Change the target size only and add `callback` to the list of callbacks to - // be run on destruction. - void UpdateTargetSize(const gfx::Size& size, base::OnceClosure callback); + void UpdateTargetBounds(const gfx::Rect& target_bounds, + base::OnceClosure callback); private: // GlicWindowAnimator owns GlicWindowResizeAnimation @@ -56,6 +56,7 @@ const raw_ptr<GlicWindowAnimator> glic_window_animator_; const gfx::Rect initial_bounds_; gfx::Rect new_bounds_; + base::TimeDelta duration_left_; std::unique_ptr<base::OnceClosureList> destruction_callbacks_; base::WeakPtrFactory<GlicWindowResizeAnimation> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/glic/glic_window_resize_animation_interactive_uitest.cc b/chrome/browser/glic/glic_window_resize_animation_interactive_uitest.cc index a679f3f5..e06b077a 100644 --- a/chrome/browser/glic/glic_window_resize_animation_interactive_uitest.cc +++ b/chrome/browser/glic/glic_window_resize_animation_interactive_uitest.cc
@@ -155,7 +155,8 @@ // Update position, advance to the end gfx::Point new_target_point(50, 50); - animation->UpdateTargetPosition(new_target_point, base::DoNothing()); + gfx::Rect new_target(new_target_point, target_bounds_1.size()); + animation->UpdateTargetBounds(new_target, base::DoNothing()); test_api->Step(animation_creation_time() + kTestAnimationDuration); // Widget should now have the latest target origin and size. @@ -176,7 +177,8 @@ // Update size, advance to the end gfx::Size new_target_size(50, 50); - animation->UpdateTargetSize(new_target_size, base::DoNothing()); + gfx::Rect new_target(target_bounds_1.origin(), new_target_size); + animation->UpdateTargetBounds(new_target, base::DoNothing()); test_api->Step(animation_creation_time() + kTestAnimationDuration); // Widget should now have the latest target origin and size. @@ -198,10 +200,12 @@ ExpectRectBetween(GetWidgetBounds(), initial_bounds, target_bounds_1); // Make some updates - animation->UpdateTargetSize(gfx::Size(50, 50), BindAppend(&call_log, " 2")); - animation->UpdateTargetSize(gfx::Size(60, 60), BindAppend(&call_log, " 3")); - animation->UpdateTargetPosition(gfx::Point(100, 100), - BindAppend(&call_log, " 4")); + gfx::Rect target_bounds_2(target_bounds_1.origin(), gfx::Size(50, 50)); + animation->UpdateTargetBounds(target_bounds_2, BindAppend(&call_log, " 2")); + gfx::Rect target_bounds_3(target_bounds_2.origin(), gfx::Size(60, 60)); + animation->UpdateTargetBounds(target_bounds_3, BindAppend(&call_log, " 3")); + gfx::Rect target_bounds_4(gfx::Point(100, 100), target_bounds_3.size()); + animation->UpdateTargetBounds(target_bounds_4, BindAppend(&call_log, " 4")); // Advance to the end. Widget should be at its final bounds. test_api->Step(animation_creation_time() + kTestAnimationDuration);
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc index e2f8a5d..6675fa0 100644 --- a/chrome/browser/media/router/media_router_feature.cc +++ b/chrome/browser/media/router/media_router_feature.cc
@@ -72,10 +72,6 @@ base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS) -BASE_FEATURE(kCastSilentlyRemoveVcOnNavigation, - "CastSilentlyRemoveVcOnNavigation", - base::FEATURE_ENABLED_BY_DEFAULT); - #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_MAC)
diff --git a/chrome/browser/media/router/media_router_feature.h b/chrome/browser/media/router/media_router_feature.h index fd5383d..2d1115e3 100644 --- a/chrome/browser/media/router/media_router_feature.h +++ b/chrome/browser/media/router/media_router_feature.h
@@ -59,13 +59,6 @@ // fall back to audio tab mirroring when casting from the Global Media Controls. BASE_DECLARE_FEATURE(kFallbackToAudioTabMirroring); -// When enabled, Cast virtual connections are removed without explicitly sending -// a close connection request to the receiver when the sender webpage navigates -// away. -// TODO(crbug.com/1508704): Remove the flag when confident that the default- -// enabled feature is not causing a regression. -BASE_DECLARE_FEATURE(kCastSilentlyRemoveVcOnNavigation); - // When enabled, messages between websites and Chrome, and Chrome and Cast // receivers will be logged in chrome://media-router-internals. These messages // can be frequent and contain sensitive information, so disabled by default.
diff --git a/chrome/browser/media/router/providers/cast/cast_activity.cc b/chrome/browser/media/router/providers/cast/cast_activity.cc index 6dbbdb05..760b90c 100644 --- a/chrome/browser/media/router/providers/cast/cast_activity.cc +++ b/chrome/browser/media/router/providers/cast/cast_activity.cc
@@ -5,9 +5,7 @@ #include "chrome/browser/media/router/providers/cast/cast_activity.h" #include "base/containers/contains.h" -#include "base/feature_list.h" #include "base/logging.h" -#include "chrome/browser/media/router/media_router_feature.h" #include "chrome/browser/media/router/providers/cast/cast_internal_message_util.h" #include "chrome/browser/media/router/providers/cast/cast_session_client_impl.h" #include "components/media_router/common/discovery/media_sink_internal.h" @@ -177,8 +175,7 @@ if (!session) { return; } - if (reason == blink::mojom::PresentationConnectionCloseReason::CLOSED || - !base::FeatureList::IsEnabled(kCastSilentlyRemoveVcOnNavigation)) { + if (reason == blink::mojom::PresentationConnectionCloseReason::CLOSED) { message_handler_->CloseConnection(cast_channel_id(), client_id, session->destination_id());
diff --git a/chrome/browser/page_content_annotations/page_content_extraction_service.cc b/chrome/browser/page_content_annotations/page_content_extraction_service.cc index df7953dae..1f0d99e 100644 --- a/chrome/browser/page_content_annotations/page_content_extraction_service.cc +++ b/chrome/browser/page_content_annotations/page_content_extraction_service.cc
@@ -29,9 +29,11 @@ } void PageContentExtractionService::OnPageContentExtracted( - const content::Page& page, + content::Page& page, const optimization_guide::proto::AnnotatedPageContent& page_content) { - observers_.Notify(&Observer::OnPageContentExtracted, page, page_content); + for (auto& observer : observers_) { + observer.OnPageContentExtracted(page, page_content); + } } } // namespace page_content_annotations
diff --git a/chrome/browser/page_content_annotations/page_content_extraction_service.h b/chrome/browser/page_content_annotations/page_content_extraction_service.h index 7770682..3ba3b6c4 100644 --- a/chrome/browser/page_content_annotations/page_content_extraction_service.h +++ b/chrome/browser/page_content_annotations/page_content_extraction_service.h
@@ -19,7 +19,7 @@ // Invoked when `page_content` is extracted for `page`. The extraction is // triggered for every page once the page has sufficiently loaded. virtual void OnPageContentExtracted( - const content::Page& page, + content::Page& page, const optimization_guide::proto::AnnotatedPageContent& page_content) {} }; @@ -40,7 +40,7 @@ // Invoked when `page_content` is extracted for `page`, to notify the // observers. void OnPageContentExtracted( - const content::Page& page, + content::Page& page, const optimization_guide::proto::AnnotatedPageContent& page_content); base::ObserverList<Observer> observers_;
diff --git a/chrome/browser/password_manager/password_change_browsertest.cc b/chrome/browser/password_manager/password_change_browsertest.cc index 0916ba9..11f3823 100644 --- a/chrome/browser/password_manager/password_change_browsertest.cc +++ b/chrome/browser/password_manager/password_change_browsertest.cc
@@ -39,6 +39,7 @@ #include "components/ukm/test_ukm_recorder.h" #include "components/url_formatter/elide_url.h" #include "content/public/test/browser_test.h" +#include "net/dns/mock_host_resolver.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -63,6 +64,8 @@ const char kPasswordChangeSubmissionOutcomeHistogram[] = "PasswordManager.PasswordChangeSubmissionOutcome"; +const char kMainHost[] = "example.com"; +const char kChangePasswordURL[] = "https://example.com/password/"; namespace { @@ -139,6 +142,13 @@ void SetUpOnMainThread() override { PasswordManagerBrowserTestBase::SetUpOnMainThread(); + // Redirect all requests to localhost. + host_resolver()->AddRule("*", "127.0.0.1"); + PasswordsNavigationObserver observer(WebContents()); + GURL url = embedded_test_server()->GetURL(kMainHost, + "/password/simple_password.html"); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); + ASSERT_TRUE(observer.Wait()); } void SetPrivacyNoticeAcceptedPref() { @@ -229,6 +239,8 @@ content::WebContents* web_contents) { password_change_service()->OfferPasswordChangeUi(url, username, password, web_contents); + // Close the leak detection bubble and simulate that it was accepted. + PasswordBubbleViewBase::CloseCurrentBubble(); password_change_service() ->GetPasswordChangeDelegate(web_contents) ->StartPasswordChangeFlow(); @@ -248,10 +260,9 @@ ASSERT_FALSE( password_change_service()->GetPasswordChangeDelegate(WebContents())); - GURL main_url("https://example.com/"), - change_pwd_url("https://example.com/password/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) - .WillOnce(testing::Return(change_pwd_url)); + .WillOnce(testing::Return(GURL(kChangePasswordURL))); StartPasswordChange(main_url, u"test", u"password", WebContents()); @@ -260,7 +271,7 @@ EXPECT_EQ(0, tab_strip->active_index()); // Verify a new tab is opened with a change pwd url. - EXPECT_EQ(change_pwd_url, tab_strip->GetWebContentsAt(1)->GetURL()); + EXPECT_EQ(kChangePasswordURL, tab_strip->GetWebContentsAt(1)->GetURL()); // Verify that GetPasswordChangeDelegate() returns delegate for both tabs. EXPECT_TRUE(password_change_service()->GetPasswordChangeDelegate( @@ -281,10 +292,9 @@ ASSERT_FALSE( password_change_service()->GetPasswordChangeDelegate(WebContents())); - GURL main_url("https://example.com/"); - GURL change_pwd_url("https://example.com/password/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) - .WillOnce(testing::Return(change_pwd_url)); + .WillOnce(testing::Return(GURL(kChangePasswordURL))); StartPasswordChange(main_url, u"test", u"password", WebContents()); @@ -301,7 +311,7 @@ // Verify a new tab is added, although the focus remained on the initial tab. ASSERT_EQ(2, tab_strip->count()); // Verify a new tab is opened with a change pwd url. - EXPECT_EQ(change_pwd_url, tab_strip->GetWebContentsAt(1)->GetURL()); + EXPECT_EQ(GURL(kChangePasswordURL), tab_strip->GetWebContentsAt(1)->GetURL()); EXPECT_EQ(delegate->GetCurrentState(), PasswordChangeDelegate::State::kWaitingForChangePasswordForm); } @@ -309,8 +319,8 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, ChangePasswordFormIsFilledAutomatically) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -338,10 +348,11 @@ MockPasswordChangeDelegateObserver observer; SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); + StartPasswordChange(main_url, u"test", u"pa$$word", WebContents()); // Verify the delegate is created and it's currently waiting for change @@ -384,8 +395,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, GeneratedPasswordIsPreSaved) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); - + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -413,8 +423,8 @@ // returned. IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, StopPasswordChange) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return( embedded_test_server()->GetURL("/password/done.html"))); @@ -437,7 +447,7 @@ base::HistogramTester histogram_tester; ukm::TestAutoSetUkmRecorder test_ukm_recorder; SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -500,21 +510,20 @@ ProfilePasswordStoreFactory::GetForProfile( browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) .get(); - GURL origin = embedded_test_server()->GetURL("example.com", "/"); + const GURL url = WebContents()->GetLastCommittedURL(); password_manager::PasswordForm form; - form.signon_realm = origin.spec(); - form.url = origin; + form.signon_realm = url.GetWithEmptyPath().spec(); + form.url = url; form.username_value = u"test"; form.password_value = u"pa$$word"; password_store->AddLogin(form); WaitForPasswordStore(); - GURL main_url("https://example.com/"); - EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) + EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( - "example.com", "/password/update_form_empty_fields.html"))); + kMainHost, "/password/update_form_empty_fields.html"))); - StartPasswordChange(main_url, form.username_value, form.password_value, + StartPasswordChange(url, form.username_value, form.password_value, WebContents()); MockPasswordChangeOutcome( PasswordChangeOutcome:: @@ -551,7 +560,7 @@ ProfilePasswordStoreFactory::GetForProfile( browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) .get(); - GURL origin = embedded_test_server()->GetURL("example.com", "/"); + const GURL origin = embedded_test_server()->GetURL(kMainHost, "/"); password_manager::PasswordForm form; form.signon_realm = origin.spec(); form.url = origin; @@ -562,7 +571,7 @@ EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(origin)) .WillOnce(testing::Return(embedded_test_server()->GetURL( - "example.com", "/password/update_form_empty_fields.html"))); + kMainHost, "/password/update_form_empty_fields.html"))); StartPasswordChange(origin, form.username_value, form.password_value, WebContents()); @@ -619,7 +628,7 @@ ProfilePasswordStoreFactory::GetForProfile( browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) .get(); - GURL origin = embedded_test_server()->GetURL("example.com", "/"); + const GURL origin = embedded_test_server()->GetURL(kMainHost, "/"); password_manager::PasswordForm form; form.signon_realm = origin.spec(); form.url = origin; @@ -630,7 +639,7 @@ EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(origin)) .WillOnce(testing::Return(embedded_test_server()->GetURL( - "example.com", "/password/update_form_empty_fields.html"))); + kMainHost, "/password/update_form_empty_fields.html"))); StartPasswordChange(origin, form.username_value, form.password_value, WebContents()); @@ -685,10 +694,10 @@ } IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, - SignInCheckBubgehbleIsHiddenWhenStateIsUpdated) { + SignInCheckBubbleIsHiddenWhenStateIsUpdated) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); - GURL change_password_url = + const GURL main_url = WebContents()->GetLastCommittedURL(); + const GURL change_password_url = embedded_test_server()->GetURL("/password/update_form_empty_fields.html"); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) @@ -726,8 +735,8 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, OpenTabWithPasswordChange) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); - GURL change_password_url = + const GURL main_url = WebContents()->GetLastCommittedURL(); + const GURL change_password_url = embedded_test_server()->GetURL("/password/update_form_empty_fields.html"); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) @@ -748,7 +757,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, PrivacyNoticeDisplayedAutomatically) { - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -767,7 +776,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, SuccessfulDialogDisplayedAutomatically) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -799,7 +808,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, FailureDialogDisplayedAutomatically) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -828,7 +837,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, LeakCheckBubbleDisplayedAutomatically) { - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -848,7 +857,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, BubbleIsNotDisplayedWhenSwitchedToDifferentTab) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -886,7 +895,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, TabWithPasswordChangeClosedAutomatically) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html"))); @@ -920,7 +929,7 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeBrowserTest, FocusedTabRemainsOpenedAfterSuccessfulChange) { SetPrivacyNoticeAcceptedPref(); - GURL main_url("https://example.com/"); + const GURL main_url = WebContents()->GetLastCommittedURL(); EXPECT_CALL(*affiliation_service(), GetChangePasswordURL(main_url)) .WillOnce(testing::Return(embedded_test_server()->GetURL( "/password/update_form_empty_fields.html")));
diff --git a/chrome/browser/password_manager/password_manager_test_base.cc b/chrome/browser/password_manager/password_manager_test_base.cc index 047f1e60..4356fdf 100644 --- a/chrome/browser/password_manager/password_manager_test_base.cc +++ b/chrome/browser/password_manager/password_manager_test_base.cc
@@ -72,64 +72,17 @@ bool WaitForFallbackForSaving(); - bool was_prompt_automatically_shown() { - return was_prompt_automatically_shown_; - } + bool was_prompt_automatically_shown() { return IsShowingBubble(); } private: - // PasswordsClientUIDelegate: - void OnPasswordSubmitted( - std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager) - override; - void OnUpdatePasswordSubmitted( - std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager) - override; - void OnHideManualFallbackForSaving() override; - bool OnChooseCredentials( - std::vector<std::unique_ptr<password_manager::PasswordForm>> - local_credentials, - const url::Origin& origin, - ManagePasswordsState::CredentialsCallback callback) override; - void OnPasswordAutofilled( - base::span<const password_manager::PasswordForm> password_forms, - const url::Origin& origin, - base::span<const password_manager::PasswordForm> federated_matches) - override; - void DidFinishNavigation( - content::NavigationHandle* navigation_handle) override; - - // ManagePasswordsUIController: - void NotifyUnsyncedCredentialsWillBeDeleted( - std::vector<password_manager::PasswordForm> unsynced_credentials) - override; - void ShowChangePasswordBubble() override; - // Should not be used for manual fallback events. bool IsTargetStateObserved( - const password_manager::ui::State target_state, - const password_manager::ui::State current_state) const; - - void ProcessStateExpectations( - const password_manager::ui::State current_state); - - // Quits |run_loop_| and clears expectations. - void QuitRunLoop(); - - // The loop to be stopped when the target state or fallback is observed. - raw_ptr<base::RunLoop> run_loop_; - - // The state CustomManagePasswordsUIController is currently waiting for. - std::optional<password_manager::ui::State> target_state_; - - // True iff a prompt was automatically shown. - bool was_prompt_automatically_shown_; + const password_manager::ui::State target_state) const; }; CustomManagePasswordsUIController::CustomManagePasswordsUIController( content::WebContents* web_contents) - : ManagePasswordsUIController(web_contents), - run_loop_(nullptr), - was_prompt_automatically_shown_(false) { + : ManagePasswordsUIController(web_contents) { // Attach CustomManagePasswordsUIController to |web_contents| so the default // ManagePasswordsUIController isn't created. // Do not silently replace an existing ManagePasswordsUIController because it @@ -140,14 +93,12 @@ void CustomManagePasswordsUIController::WaitForState( password_manager::ui::State target_state) { - if (IsTargetStateObserved(target_state, GetState())) { + if (IsTargetStateObserved(target_state)) { return; } - base::RunLoop run_loop; - target_state_ = target_state; - run_loop_ = &run_loop; - run_loop_->Run(); + EXPECT_TRUE(base::test::RunUntil( + [this, target_state]() { return IsTargetStateObserved(target_state); })); } bool CustomManagePasswordsUIController::WaitForFallbackForSaving() { @@ -164,95 +115,13 @@ return false; } -void CustomManagePasswordsUIController::OnPasswordSubmitted( - std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager) { - ManagePasswordsUIController::OnPasswordSubmitted(std::move(form_manager)); - was_prompt_automatically_shown_ = IsShowingBubbleForTest(); - ProcessStateExpectations(password_manager::ui::PENDING_PASSWORD_STATE); -} - -void CustomManagePasswordsUIController::OnUpdatePasswordSubmitted( - std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager) { - was_prompt_automatically_shown_ = true; - ProcessStateExpectations(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE); - return ManagePasswordsUIController::OnUpdatePasswordSubmitted( - std::move(form_manager)); -} - -void CustomManagePasswordsUIController::OnHideManualFallbackForSaving() { - ManagePasswordsUIController::OnHideManualFallbackForSaving(); - ProcessStateExpectations(GetState()); -} - -bool CustomManagePasswordsUIController::OnChooseCredentials( - std::vector<std::unique_ptr<password_manager::PasswordForm>> - local_credentials, - const url::Origin& origin, - ManagePasswordsState::CredentialsCallback callback) { - ProcessStateExpectations(password_manager::ui::CREDENTIAL_REQUEST_STATE); - return ManagePasswordsUIController::OnChooseCredentials( - std::move(local_credentials), origin, std::move(callback)); -} - -void CustomManagePasswordsUIController::OnPasswordAutofilled( - base::span<const password_manager::PasswordForm> password_forms, - const url::Origin& origin, - base::span<const password_manager::PasswordForm> federated_matches) { - ProcessStateExpectations(password_manager::ui::MANAGE_STATE); - return ManagePasswordsUIController::OnPasswordAutofilled( - password_forms, origin, federated_matches); -} - -void CustomManagePasswordsUIController::DidFinishNavigation( - content::NavigationHandle* navigation_handle) { - ManagePasswordsUIController::DidFinishNavigation(navigation_handle); - if (GetState() != password_manager::ui::PENDING_PASSWORD_STATE && - GetState() != password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) { - // Navigation cleared the state, an automatic prompt disappears. - was_prompt_automatically_shown_ = false; - } - ProcessStateExpectations(GetState()); -} - -void CustomManagePasswordsUIController::NotifyUnsyncedCredentialsWillBeDeleted( - std::vector<password_manager::PasswordForm> unsynced_credentials) { - ManagePasswordsUIController::NotifyUnsyncedCredentialsWillBeDeleted( - std::move(unsynced_credentials)); - was_prompt_automatically_shown_ = true; - ProcessStateExpectations( - password_manager::ui::WILL_DELETE_UNSYNCED_ACCOUNT_PASSWORDS_STATE); -} - -void CustomManagePasswordsUIController::ShowChangePasswordBubble() { - ManagePasswordsUIController::ShowChangePasswordBubble(); - was_prompt_automatically_shown_ = true; -} - bool CustomManagePasswordsUIController::IsTargetStateObserved( - const password_manager::ui::State target_state, - const password_manager::ui::State current_state) const { + const password_manager::ui::State target_state) const { bool should_wait_for_automatic_prompt = target_state == password_manager::ui::PENDING_PASSWORD_STATE || target_state == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE; - return target_state == current_state && - (!should_wait_for_automatic_prompt || was_prompt_automatically_shown_); -} - -void CustomManagePasswordsUIController::ProcessStateExpectations( - const password_manager::ui::State current_state) { - if (!target_state_) { - return; - } - - if (IsTargetStateObserved(*target_state_, current_state)) { - QuitRunLoop(); - } -} - -void CustomManagePasswordsUIController::QuitRunLoop() { - run_loop_->Quit(); - run_loop_ = nullptr; - target_state_.reset(); + return target_state == GetState() && + (!should_wait_for_automatic_prompt || IsShowingBubble()); } enum ReturnCodes { // Possible results of the JavaScript code.
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc index bbacad9c..0968c44a 100644 --- a/chrome/browser/profiles/profile_manager_unittest.cc +++ b/chrome/browser/profiles/profile_manager_unittest.cc
@@ -73,6 +73,7 @@ #if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" +#include "base/check_deref.h" #include "chrome/browser/ash/login/users/avatar/user_image_manager_impl.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/login/users/user_manager_delegate_impl.h" @@ -202,6 +203,7 @@ ash::UserImageManagerImpl::SkipDefaultUserImageDownloadForTesting(); wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(&test_wallpaper_controller_);
diff --git a/chrome/browser/sync_file_system/OWNERS b/chrome/browser/sync_file_system/OWNERS index 45e8d57..7be83d4 100644 --- a/chrome/browser/sync_file_system/OWNERS +++ b/chrome/browser/sync_file_system/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_medium_layout.xml b/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_medium_layout.xml index 3d192d80a..5b085ed8 100644 --- a/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_medium_layout.xml +++ b/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_medium_layout.xml
@@ -12,7 +12,8 @@ android:background="@drawable/quick_action_search_widget_background" android:clipToOutline="true" android:gravity="center" - android:orientation="vertical"> + android:orientation="vertical" + android:theme="@style/Theme.Chromium.Widget" > <LinearLayout android:id="@+id/quick_action_search_widget_search_bar_container"
diff --git a/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_small_layout.xml b/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_small_layout.xml index 7964e096..79c3f86 100644 --- a/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_small_layout.xml +++ b/chrome/browser/ui/android/quickactionsearchwidget/java/res/layout/quick_action_search_widget_small_layout.xml
@@ -14,7 +14,8 @@ android:baselineAligned="false" android:orientation="horizontal" android:layout_gravity="center" - android:paddingHorizontal="@dimen/quick_action_search_widget_small_margin"> + android:paddingHorizontal="@dimen/quick_action_search_widget_small_margin" + android:theme="@style/Theme.Chromium.Widget" > <LinearLayout android:id="@+id/quick_action_search_widget_search_bar_container"
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SyncConsentActivityLauncher.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SyncConsentActivityLauncher.java index 205bc2b74..49cf4d9 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SyncConsentActivityLauncher.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SyncConsentActivityLauncher.java
@@ -4,8 +4,6 @@ package org.chromium.chrome.browser.ui.signin; -import android.content.Context; - import androidx.annotation.IntDef; import org.chromium.components.signin.metrics.SigninAccessPoint; @@ -26,37 +24,4 @@ }) @Retention(RetentionPolicy.SOURCE) @interface AccessPoint {} - - /** - * Launches the {@link SyncConsentActivity} with default sign-in flow from personalized sign-in - * promo. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @param accountName The account to preselect or null to preselect the default account. - */ - void launchActivityForPromoDefaultFlow( - Context context, @SigninAccessPoint int accessPoint, String accountName); - - /** - * Launches the {@link SyncConsentActivity} with "Choose account" sign-in flow from personalized - * sign-in promo. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @param accountName The account to preselect or null to preselect the default account. - */ - void launchActivityForPromoChooseAccountFlow( - Context context, @SigninAccessPoint int accessPoint, String accountName); - - /** - * Launches the {@link SyncConsentActivity} with "New account" sign-in flow from personalized - * sign-in promo. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - */ - void launchActivityForPromoAddAccountFlow(Context context, @SigninAccessPoint int accessPoint); - - /** - * Launches the {@link SyncConsentActivity} if signin is allowed. - * @param context A {@link Context} object. - * @param accessPoint {@link SigninAccessPoint} for starting sign-in flow. - * @return a boolean indicating if the {@link SyncConsentActivity} is launched. - */ - boolean launchActivityIfAllowed(Context context, @SigninAccessPoint int accessPoint); }
diff --git a/chrome/browser/ui/ash/main_extra_parts/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/main_extra_parts/chrome_browser_main_extra_parts_ash.cc index cec1c10..52f1760 100644 --- a/chrome/browser/ui/ash/main_extra_parts/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/ash/main_extra_parts/chrome_browser_main_extra_parts_ash.cc
@@ -274,10 +274,12 @@ // user_manager::UserManagerImpl. wallpaper_controller_client_ = std::make_unique<WallpaperControllerClientImpl>( + CHECK_DEREF(g_browser_process->local_state()), std::make_unique<wallpaper_handlers::WallpaperFetcherDelegateImpl>()); wallpaper_controller_client_->Init(); - session_controller_client_ = std::make_unique<SessionControllerClientImpl>(); + session_controller_client_ = std::make_unique<SessionControllerClientImpl>( + CHECK_DEREF(g_browser_process->local_state())); session_controller_client_->Init(); // By this point ash shell should have initialized its D-Bus signal // listeners, so inform the session manager that Ash is initialized.
diff --git a/chrome/browser/ui/ash/session/BUILD.gn b/chrome/browser/ui/ash/session/BUILD.gn index ca4d03ce..b04f523 100644 --- a/chrome/browser/ui/ash/session/BUILD.gn +++ b/chrome/browser/ui/ash/session/BUILD.gn
@@ -18,7 +18,6 @@ "//ash/constants", "//ash/public/cpp", "//base", - "//chrome/browser:browser_process", "//chrome/browser/apps/app_service", "//chrome/browser/ash/floating_workspace", "//chrome/browser/ash/floating_workspace:utils",
diff --git a/chrome/browser/ui/ash/session/DEPS b/chrome/browser/ui/ash/session/DEPS index 9adc75c..26c90af9 100644 --- a/chrome/browser/ui/ash/session/DEPS +++ b/chrome/browser/ui/ash/session/DEPS
@@ -20,7 +20,6 @@ "+chrome/browser/ash/profiles", "+chrome/browser/ash/settings", "+chrome/browser/ash/system_web_apps/apps/personalization_app", - "+chrome/browser/browser_process.h", "+chrome/browser/lifetime", "+chrome/browser/policy/networking", "+chrome/browser/policy/profile_policy_connector.h",
diff --git a/chrome/browser/ui/ash/session/session_controller_client_impl.cc b/chrome/browser/ui/ash/session/session_controller_client_impl.cc index 7d032a7..b1516a5 100644 --- a/chrome/browser/ui/ash/session/session_controller_client_impl.cc +++ b/chrome/browser/ui/ash/session/session_controller_client_impl.cc
@@ -26,7 +26,6 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/settings/device_settings_service.h" #include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_utils.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/lifetime/termination_notification.h" #include "chrome/browser/policy/profile_policy_connector.h" @@ -145,7 +144,8 @@ } // namespace -SessionControllerClientImpl::SessionControllerClientImpl() { +SessionControllerClientImpl::SessionControllerClientImpl( + PrefService& local_state) { SessionManager::Get()->AddObserver(this); UserManager::Get()->AddSessionStateObserver(this); UserManager::Get()->AddObserver(this); @@ -154,7 +154,7 @@ &SessionControllerClientImpl::OnAppTerminating, base::Unretained(this))); local_state_registrar_ = std::make_unique<PrefChangeRegistrar>(); - local_state_registrar_->Init(g_browser_process->local_state()); + local_state_registrar_->Init(&local_state); local_state_registrar_->Add( prefs::kSessionStartTime, base::BindRepeating(&SessionControllerClientImpl::SendSessionLengthLimit,
diff --git a/chrome/browser/ui/ash/session/session_controller_client_impl.h b/chrome/browser/ui/ash/session/session_controller_client_impl.h index d3f3c16..0a507f7 100644 --- a/chrome/browser/ui/ash/session/session_controller_client_impl.h +++ b/chrome/browser/ui/ash/session/session_controller_client_impl.h
@@ -23,6 +23,7 @@ class Profile; class PrefChangeRegistrar; +class PrefService; namespace ash { enum class AddUserSessionPolicy; @@ -43,7 +44,7 @@ public SupervisedUserServiceObserver, public policy::off_hours::DeviceOffHoursController::Observer { public: - SessionControllerClientImpl(); + explicit SessionControllerClientImpl(PrefService& local_state); SessionControllerClientImpl(const SessionControllerClientImpl&) = delete; SessionControllerClientImpl& operator=(const SessionControllerClientImpl&) =
diff --git a/chrome/browser/ui/ash/session/session_controller_client_impl_unittest.cc b/chrome/browser/ui/ash/session/session_controller_client_impl_unittest.cc index 1d68530..a0ca43d 100644 --- a/chrome/browser/ui/ash/session/session_controller_client_impl_unittest.cc +++ b/chrome/browser/ui/ash/session/session_controller_client_impl_unittest.cc
@@ -10,6 +10,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" +#include "base/check_deref.h" #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" @@ -198,7 +199,8 @@ // Cycle three users forwards and backwards to see that it works. TEST_F(SessionControllerClientImplTest, CyclingThreeUsers) { // Create an object to test and connect it to our test interface. - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init(); @@ -407,7 +409,8 @@ TEST_F(SessionControllerClientImplTest, SendUserSession) { // Create an object to test and connect it to our test interface. - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init(); @@ -442,7 +445,8 @@ TEST_F(SessionControllerClientImplTest, SetUserSessionOrder) { // Create an object to test and connect it to our test interface. - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init(); @@ -469,7 +473,8 @@ TEST_F(SessionControllerClientImplTest, UserPrefsChange) { // Create an object to test and connect it to our test interface. - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init(); @@ -510,7 +515,8 @@ TEST_F(SessionControllerClientImplTest, SessionLengthLimit) { // Create an object to test and connect it to our test interface. - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init(); @@ -530,7 +536,8 @@ } TEST_F(SessionControllerClientImplTest, FirstSessionReady) { - SessionControllerClientImpl client; + SessionControllerClientImpl client( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state())); TestSessionController session_controller; client.Init();
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc index 4bbcbfb..113b0c5 100644 --- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc +++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
@@ -38,6 +38,7 @@ #include "ash/shelf/shelf_application_menu_model.h" #include "ash/webui/system_apps/public/system_web_app_type.h" #include "base/check.h" +#include "base/check_deref.h" #include "base/check_op.h" #include "base/command_line.h" #include "base/containers/contains.h" @@ -144,6 +145,7 @@ #include "chrome/grit/branded_strings.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/test_browser_window_aura.h" +#include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "chromeos/ash/components/browser_context_helper/annotated_account_id.h" @@ -514,6 +516,7 @@ // after profile creation. wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::WallpaperFetcherDelegateImpl>()); wallpaper_controller_client_->Init();
diff --git a/chrome/browser/ui/ash/wallpaper/BUILD.gn b/chrome/browser/ui/ash/wallpaper/BUILD.gn index 34268596..9e4fd96 100644 --- a/chrome/browser/ui/ash/wallpaper/BUILD.gn +++ b/chrome/browser/ui/ash/wallpaper/BUILD.gn
@@ -24,7 +24,6 @@ "//ash/webui/personalization_app/mojom", "//ash/webui/system_apps/public:system_web_app_type", "//base", - "//chrome/browser:browser_process", "//chrome/browser/apps/app_service", "//chrome/browser/ash/arc/wallpaper", "//chrome/browser/ash/customization",
diff --git a/chrome/browser/ui/ash/wallpaper/DEPS b/chrome/browser/ui/ash/wallpaper/DEPS index 8b311804..f77ea428 100644 --- a/chrome/browser/ui/ash/wallpaper/DEPS +++ b/chrome/browser/ui/ash/wallpaper/DEPS
@@ -19,7 +19,6 @@ "+chrome/browser/ash/settings", "+chrome/browser/ash/wallpaper_handlers", "+chrome/browser/ash/wallpaper", - "+chrome/browser/browser_process.h", "+chrome/browser/profiles/profile_manager.h", "+chrome/browser/signin", "+chrome/browser/sync",
diff --git a/chrome/browser/ui/ash/wallpaper/wallpaper_ash_unittest.cc b/chrome/browser/ui/ash/wallpaper/wallpaper_ash_unittest.cc index 5b11fc3..19b50213 100644 --- a/chrome/browser/ui/ash/wallpaper/wallpaper_ash_unittest.cc +++ b/chrome/browser/ui/ash/wallpaper/wallpaper_ash_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/public/mojom/wallpaper.mojom.h" +#include "base/check_deref.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/test/bind.h" @@ -74,6 +75,7 @@ // Create Wallpaper Controller Client. wallpaper_controller_client_ = std::make_unique< WallpaperControllerClientImpl>( + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()); wallpaper_controller_client_->InitForTesting(&test_wallpaper_controller_);
diff --git a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc index b6ddbf82..fabc5550 100644 --- a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc +++ b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc
@@ -43,7 +43,6 @@ #include "chrome/browser/ash/wallpaper_handlers/google_photos_wallpaper_handlers.h" #include "chrome/browser/ash/wallpaper_handlers/wallpaper_fetcher_delegate.h" #include "chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/sync/sync_service_factory.h" @@ -135,10 +134,11 @@ } void GetFilesIdSaltReady( + PrefService* local_state, const AccountId& account_id, base::OnceCallback<void(const std::string&)> files_id_callback) { DCHECK(CanGetFilesId()); - user_manager::KnownUser known_user(g_browser_process->local_state()); + user_manager::KnownUser known_user(local_state); if (const std::string* stored_value = known_user.FindStringPath(account_id, kWallpaperFilesId)) { std::move(files_id_callback).Run(*stored_value); @@ -181,10 +181,11 @@ } // namespace WallpaperControllerClientImpl::WallpaperControllerClientImpl( + PrefService& local_state, std::unique_ptr<wallpaper_handlers::WallpaperFetcherDelegate> wallpaper_fetcher_delegate) - : wallpaper_fetcher_delegate_(std::move(wallpaper_fetcher_delegate)) { - local_state_ = g_browser_process->local_state(); + : local_state_(local_state), + wallpaper_fetcher_delegate_(std::move(wallpaper_fetcher_delegate)) { show_user_names_on_signin_subscription_ = ash::CrosSettings::Get()->AddSettingsObserver( ash::kAccountsPrefShowUserNamesOnSignIn, @@ -216,7 +217,7 @@ } void WallpaperControllerClientImpl::Init() { - pref_registrar_.Init(local_state_); + pref_registrar_.Init(&local_state_.get()); pref_registrar_.Add( prefs::kDeviceWallpaperImageFilePath, base::BindRepeating( @@ -338,8 +339,9 @@ void WallpaperControllerClientImpl::GetFilesId( const AccountId& account_id, base::OnceCallback<void(const std::string&)> files_id_callback) const { - ash::SystemSaltGetter::Get()->AddOnSystemSaltReady(base::BindOnce( - &GetFilesIdSaltReady, account_id, std::move(files_id_callback))); + ash::SystemSaltGetter::Get()->AddOnSystemSaltReady( + base::BindOnce(&GetFilesIdSaltReady, &local_state_.get(), account_id, + std::move(files_id_callback))); } bool WallpaperControllerClientImpl::IsWallpaperSyncEnabled(
diff --git a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h index 84ac7ef..c0c62ea 100644 --- a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h +++ b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h
@@ -13,6 +13,7 @@ #include "ash/public/cpp/wallpaper/wallpaper_types.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom-forward.h" #include "base/memory/raw_ptr.h" +#include "base/memory/raw_ref.h" #include "base/scoped_multi_source_observation.h" #include "base/scoped_observation.h" #include "chrome/browser/ash/file_manager/volume_manager_observer.h" @@ -44,7 +45,8 @@ public session_manager::SessionManagerObserver, public user_manager::UserManager::Observer { public: - explicit WallpaperControllerClientImpl( + WallpaperControllerClientImpl( + PrefService& local_state, std::unique_ptr<wallpaper_handlers::WallpaperFetcherDelegate> wallpaper_fetcher_delegate); @@ -166,7 +168,7 @@ // WallpaperController interface in ash. raw_ptr<ash::WallpaperController> wallpaper_controller_; - raw_ptr<PrefService> local_state_; + raw_ref<PrefService> local_state_; // The registrar used to watch DeviceWallpaperImageFilePath pref changes. PrefChangeRegistrar pref_registrar_;
diff --git a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl_unittest.cc b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl_unittest.cc index 0d8b5b0..daaba830 100644 --- a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl_unittest.cc +++ b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" +#include "base/check_deref.h" #include "base/containers/contains.h" #include "base/strings/string_number_conversions.h" #include "base/test/bind.h" @@ -68,6 +69,7 @@ std::unique_ptr<user_manager::ScopedUserManager> user_manager_; TestWallpaperController controller_; WallpaperControllerClientImpl client_{ + CHECK_DEREF(TestingBrowserProcess::GetGlobal()->local_state()), std::make_unique<wallpaper_handlers::TestWallpaperFetcherDelegate>()}; }; @@ -88,7 +90,8 @@ TEST_F(WallpaperControllerClientImplTest, GetFilesId) { const AccountId account_id = AccountId::FromUserEmail("test@test.com"); - user_manager::KnownUser known_user(g_browser_process->local_state()); + user_manager::KnownUser known_user( + TestingBrowserProcess::GetGlobal()->local_state()); // Make a fake entry to register `account_id` as existing user. known_user.SetPath(account_id, "test", base::Value("")); EXPECT_TRUE(known_user.UserExists(account_id)); @@ -109,7 +112,8 @@ base::test::TestFuture<const std::string&> future; client()->GetFilesId(account_id, future.GetCallback()); ASSERT_TRUE(future.Wait()); - user_manager::KnownUser known_user(g_browser_process->local_state()); + user_manager::KnownUser known_user( + TestingBrowserProcess::GetGlobal()->local_state()); EXPECT_FALSE(known_user.UserExists(account_id)); }
diff --git a/chrome/browser/ui/passwords/bubble_controllers/password_change/failed_password_change_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/password_change/failed_password_change_bubble_controller.cc index 3eea5a0..b1fde0d 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/password_change/failed_password_change_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/password_change/failed_password_change_bubble_controller.cc
@@ -57,7 +57,9 @@ if (dismissal_reason_ == metrics_util::NO_DIRECT_INTERACTION) { dismissal_reason_ = metrics_util::CLICKED_CANCEL; } - password_change_delegate_->Stop(); + if (password_change_delegate_) { + password_change_delegate_->Stop(); + } } void FailedPasswordChangeBubbleController::NavigateToPasswordChangeSettings() {
diff --git a/chrome/browser/ui/passwords/bubble_controllers/password_change/no_password_change_form_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/password_change/no_password_change_form_bubble_controller.cc index 8306d04..57ddfba 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/password_change/no_password_change_form_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/password_change/no_password_change_form_bubble_controller.cc
@@ -35,7 +35,9 @@ void NoPasswordChangeFormBubbleController::Cancel() { dismissal_reason_ = metrics_util::CLICKED_CANCEL; CHECK(password_change_delegate_); - password_change_delegate_->Stop(); + if (password_change_delegate_) { + password_change_delegate_->Stop(); + } } std::u16string NoPasswordChangeFormBubbleController::GetTitle() const {
diff --git a/chrome/browser/ui/passwords/bubble_controllers/password_change/successful_password_change_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/password_change/successful_password_change_bubble_controller.cc index c1b27182..8f8bbc8 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/password_change/successful_password_change_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/password_change/successful_password_change_bubble_controller.cc
@@ -53,7 +53,9 @@ void SuccessfulPasswordChangeBubbleController::FinishPasswordChange() { dismissal_reason_ = metrics_util::CLICKED_ACCEPT; - password_change_delegate_->Stop(); + if (password_change_delegate_) { + password_change_delegate_->Stop(); + } } void SuccessfulPasswordChangeBubbleController::AuthenticateUser(
diff --git a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_pixel_browsertest.cc b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_pixel_browsertest.cc index de26c65..c092241 100644 --- a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_pixel_browsertest.cc +++ b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view_pixel_browsertest.cc
@@ -392,13 +392,6 @@ IN_PROC_BROWSER_TEST_P(DiceWebSigninInterceptionBubblePixelTest, InvokeUi_default) { -#if BUILDFLAG(IS_WIN) - if (GetParam().test_suffix == "EnterpriseManagedIntercepted") { - // TODO(crbug.com/389737045): Enable for this variation once pixel tests - // are corrected. - GTEST_SKIP(); - } -#endif ShowAndVerifyUi(); }
diff --git a/chrome/browser/ui/webui/ash/settings/pages/people/BUILD.gn b/chrome/browser/ui/webui/ash/settings/pages/people/BUILD.gn index 8baae64..46601f4 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/people/BUILD.gn +++ b/chrome/browser/ui/webui/ash/settings/pages/people/BUILD.gn
@@ -112,6 +112,7 @@ "//chrome/test:test_support", "//chrome/test:test_support_ui", "//chromeos/ash/components/account_manager", + "//chromeos/ash/components/browser_context_helper", "//components/account_manager_core", "//components/signin/public/identity_manager", "//components/signin/public/identity_manager:test_support",
diff --git a/chrome/browser/ui/webui/ash/settings/pages/people/account_manager_ui_handler_browsertest.cc b/chrome/browser/ui/webui/ash/settings/pages/people/account_manager_ui_handler_browsertest.cc index e749b02..5360dcd7 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/people/account_manager_ui_handler_browsertest.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/people/account_manager_ui_handler_browsertest.cc
@@ -14,7 +14,6 @@ #include "base/test/test_future.h" #include "chrome/browser/ash/account_manager/account_apps_availability.h" #include "chrome/browser/ash/account_manager/account_apps_availability_factory.h" -#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" @@ -22,13 +21,16 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/ash/components/account_manager/account_manager_factory.h" +#include "chromeos/ash/components/browser_context_helper/annotated_account_id.h" #include "components/account_manager_core/account_manager_facade.h" #include "components/account_manager_core/chromeos/account_manager.h" #include "components/account_manager_core/chromeos/account_manager_facade_factory.h" +#include "components/session_manager/core/session_manager.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/identity_test_utils.h" #include "components/supervised_user/core/common/supervised_user_constants.h" -#include "components/user_manager/scoped_user_manager.h" +#include "components/user_manager/test_helper.h" +#include "components/user_manager/user_manager.h" #include "components/user_manager/user_type.h" #include "content/public/test/browser_test.h" #include "content/public/test/test_web_ui.h" @@ -143,6 +145,7 @@ delete; void SetUpOnMainThread() override { + ash::ProfileHelper::SetProfileToUserForTestingEnabled(true); // Split the setup so it can be called from the inherited classes. SetUpEnvironment(); @@ -163,15 +166,32 @@ void TearDownOnMainThread() override { account_apps_availability_ = nullptr; handler_.reset(); - GetFakeUserManager()->RemoveUserFromList(primary_account_id_); profile_.reset(); base::RunLoop().RunUntilIdle(); - user_manager_enabler_.reset(); + ash::ProfileHelper::SetProfileToUserForTestingEnabled(false); } // Sets up profile and user manager. Should be called only once on test setup. void SetUpEnvironment() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + + const AccountId account_id = AccountId::FromUserEmailGaiaId( + GetDeviceAccountInfo().email, GaiaId(GetDeviceAccountInfo().id)); + const user_manager::User* user; + { + user_manager::TestHelper test_helper(*user_manager::UserManager::Get()); + if (GetDeviceAccountInfo().user_type == user_manager::UserType::kChild) { + user = test_helper.AddChildUser(account_id); + } else { + user = test_helper.AddRegularUser(account_id); + } + } + ASSERT_TRUE(user); + session_manager::SessionManager::Get()->CreateSession( + account_id, user_manager::TestHelper::GetFakeUsernameHash(account_id), + /*new_user=*/false, + /*has_active_session*/ false); + TestingProfile::Builder profile_builder; profile_builder.SetPath(temp_dir_.GetPath().AppendASCII("TestProfile")); profile_builder.SetProfileName(GetDeviceAccountInfo().email); @@ -179,24 +199,9 @@ profile_builder.SetIsSupervisedProfile(); } profile_ = profile_builder.Build(); - - auto user_manager = std::make_unique<FakeChromeUserManager>(); - const user_manager::User* user; - if (GetDeviceAccountInfo().user_type == user_manager::UserType::kChild) { - user = user_manager->AddChildUser(AccountId::FromUserEmailGaiaId( - GetDeviceAccountInfo().email, GaiaId(GetDeviceAccountInfo().id))); - } else { - user = user_manager->AddUserWithAffiliationAndTypeAndProfile( - AccountId::FromUserEmailGaiaId(GetDeviceAccountInfo().email, - GaiaId(GetDeviceAccountInfo().id)), - true, GetDeviceAccountInfo().user_type, profile_.get()); - } - primary_account_id_ = user->GetAccountId(); - user_manager->LoginUser(primary_account_id_); + ash::AnnotatedAccountId::Set(profile_.get(), account_id); ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, profile_.get()); - user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( - std::move(user_manager)); auto* factory = g_browser_process->platform_part()->GetAccountManagerFactory(); @@ -211,11 +216,6 @@ signin::WaitForRefreshTokensLoaded(identity_manager_); } - FakeChromeUserManager* GetFakeUserManager() const { - return static_cast<FakeChromeUserManager*>( - user_manager::UserManager::Get()); - } - void UpsertAccount(std::string email) { account_manager_->UpsertAccount(::account_manager::AccountKey::FromGaiaId( signin::GetTestGaiaIdForEmail(email)), @@ -244,14 +244,12 @@ AccountManager* account_manager() { return account_manager_; } private: - std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_; base::ScopedTempDir temp_dir_; std::unique_ptr<TestingProfile> profile_; raw_ptr<AccountManager, DanglingUntriaged> account_manager_ = nullptr; raw_ptr<signin::IdentityManager, DanglingUntriaged> identity_manager_ = nullptr; content::TestWebUI web_ui_; - AccountId primary_account_id_; std::unique_ptr<TestingAccountManagerUIHandler> handler_; raw_ptr<AccountAppsAvailability> account_apps_availability_; };
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index bafa171e..08fb499 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -2,7 +2,6 @@ # Copyright 2018 The Chromium Authors # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") import("//chrome/browser/buildflags.gni") import("//extensions/buildflags/buildflags.gni") import("//mojo/public/tools/bindings/mojom.gni") @@ -495,7 +494,6 @@ deps = [ "//base", "//build:branding_buildflags", - "//build:chromeos_buildflags", "//chrome/app/resources:platform_locale_settings", "//chrome/app/theme:chrome_unscaled_resources", "//chrome/browser:browser_process", @@ -972,7 +970,6 @@ ":web_applications", ":web_applications_test_support", "//base/test:test_support", - "//build:chromeos_buildflags", "//chrome/app/theme:theme_resources", "//chrome/browser", "//chrome/browser:browser_process",
diff --git a/chrome/browser/web_applications/app_service/BUILD.gn b/chrome/browser/web_applications/app_service/BUILD.gn index 0b53bf4..00e772c 100644 --- a/chrome/browser/web_applications/app_service/BUILD.gn +++ b/chrome/browser/web_applications/app_service/BUILD.gn
@@ -39,16 +39,12 @@ ] if (is_chromeos) { - deps += [ "//chrome/browser/apps/browser_instance" ] - allow_circular_includes_from += [ "//chrome/browser/apps/browser_instance" ] - } - - if (is_chromeos_ash) { deps += [ "//ash/public/cpp", "//ash/webui/projector_app/public/cpp", "//ash/webui/system_apps/public:system_web_app_type", "//chrome/browser/apps/almanac_api_client", + "//chrome/browser/apps/browser_instance", "//chrome/browser/ash/file_manager", "//chrome/browser/ash/guest_os", "//chrome/browser/ash/login/demo_mode", @@ -60,6 +56,7 @@ "//components/services/app_service/public/cpp:instance_update", "//extensions/browser/api/file_handlers", ] + allow_circular_includes_from += [ "//chrome/browser/apps/browser_instance" ] } } @@ -89,7 +86,7 @@ "//testing/gtest", ] - if (is_chromeos_ash) { + if (is_chromeos) { deps += [ "//chromeos/ash/components/system" ] } }
diff --git a/chrome/browser/web_applications/app_service/README.md b/chrome/browser/web_applications/app_service/README.md index a903749c..9c718ec 100644 --- a/chrome/browser/web_applications/app_service/README.md +++ b/chrome/browser/web_applications/app_service/README.md
@@ -4,14 +4,10 @@ App Service [publishers](../../../../chrome/browser/apps/app_service/public/app_publisher.h) keep the App Service [updates](../../../../components/services/app_service/public/cpp/app_update.h) with the set of installed apps, and implement commands such as launching. -For Ash, Linux, Mac and Windows, the publisher is [WebApps](web_apps.h). (This is currently also used to support the chrome://apps page in the Lacros browser.) - -In Ash with the Lacros flags enabled, this publisher only manages system web apps. - -For Lacros, we have a proxy publisher [WebAppsCrosapi](../../apps/app_service/publishers/web_apps_crosapi.h) in the Ash process, that communicates over [mojom](../../../../chromeos/crosapi/mojom/app_service.mojom) with the Lacros [LacrosWebAppsController](lacros_web_apps_controller.h). (The web app registry for non-system web apps is in the Lacros process, while the App Service controlling the Chrome OS launcher, shelf, etc. is in the Ash process.) +For Ash, Linux, Mac and Windows, the publisher is [WebApps](web_apps.h). # WebAppPublisherHelper Each of the web app publisher classes delegate the majority of their functionality to [WebAppPublisherHelper](web_app_publisher_helper.h). -This class observes updates to the installed set of web apps, and forwards these updates to the publisher that owns it, so the updates can then be forwarded to the App Service. +This class observes updates to the installed set of web apps, and forwards these updates to the publisher that owns it, so the updates can then be forwarded to the App Service.
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc index ec541e98..2e8f46f 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc +++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc
@@ -44,7 +44,6 @@ #include "base/values.h" #include "build/build_config.h" #include "build/buildflag.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" @@ -110,37 +109,30 @@ #include "url/origin.h" #if BUILDFLAG(IS_CHROMEOS) -#include "chrome/browser/apps/browser_instance/browser_app_instance_tracker.h" -#include "chrome/browser/badging/badge_manager.h" -#include "chrome/browser/badging/badge_manager_factory.h" -#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" -#include "chrome/browser/notifications/notification_display_service_factory.h" -#include "chrome/browser/web_applications/chromeos_web_app_experiments.h" -#include "chromeos/constants/chromeos_features.h" -#include "ui/message_center/public/cpp/notification.h" -#include "ui/message_center/public/cpp/notifier_id.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/webui/projector_app/public/cpp/projector_app_constants.h" // nogncheck #include "ash/webui/system_apps/public/system_web_app_type.h" +#include "chrome/browser/apps/browser_instance/browser_app_instance_tracker.h" #include "chrome/browser/ash/guest_os/guest_os_terminal.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" +#include "chrome/browser/badging/badge_manager.h" +#include "chrome/browser/badging/badge_manager_factory.h" #include "chrome/browser/chromeos/arc/arc_web_contents_data.h" // nogncheck +#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" +#include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/web_applications/chromeos_web_app_experiments.h" #include "chromeos/ash/components/file_manager/app_id.h" #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_data.h" #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_delegate.h" +#include "chromeos/constants/chromeos_features.h" #include "components/app_restore/app_launch_info.h" #include "components/app_restore/full_restore_save_handler.h" #include "components/app_restore/full_restore_utils.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" #include "components/sessions/core/session_id.h" #include "extensions/browser/api/file_handlers/mime_util.h" // nogncheck -#endif - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/lacros/lacros_service.h" +#include "ui/message_center/public/cpp/notification.h" +#include "ui/message_center/public/cpp/notifier_id.h" #endif using apps::IconEffects; @@ -555,7 +547,7 @@ bool should_show_app = true; // TODO(b/201422755): Remove Web app specific hiding for demo mode once icon // load fixed. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (ash::DemoSession::Get()) { should_show_app = ash::DemoSession::Get()->ShouldShowWebApp( web_app->start_url().spec()); @@ -664,12 +656,12 @@ CreateIntentFiltersFromFileHandlers(*enabled_file_handlers)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (app.app_id() == ash::kChromeUIUntrustedProjectorSwaAppId) { filters.push_back(apps_util::MakeIntentFilterForUrlScope( GURL(ash::kChromeUIUntrustedProjectorPwaUrl))); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) return filters; } @@ -784,7 +776,7 @@ app->intent_filters.push_back(apps_util::CreateLockScreenFilter()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (web_app->app_id() == guest_os::kTerminalSystemAppId) { app->intent_filters.push_back(apps_util::CreateFileFilter( {apps_util::kIntentActionView}, @@ -1016,7 +1008,7 @@ return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (app_id == guest_os::kTerminalSystemAppId) { int64_t display_id = window_info ? window_info->display_id : display::kInvalidDisplayId; @@ -1041,8 +1033,7 @@ base::BindOnce( [](apps::LaunchCallback callback, apps::LaunchSource launch_source, std::vector<content::WebContents*> web_contentses) { -// TODO(crbug.com/40184120): Set ArcWebContentsData for Lacros. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) for (content::WebContents* web_contents : web_contentses) { if (launch_source == apps::LaunchSource::kFromArc) { // Add a flag to remember this tab originated in the ARC @@ -1075,7 +1066,7 @@ bool is_system_web_app = false; std::optional<GURL> override_url = std::nullopt; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Terminal SWA has custom launch code and manages its own restore data. if (params.app_id == guest_os::kTerminalSystemAppId) { guest_os::LaunchTerminalHome(profile_, params.display_id, @@ -1105,7 +1096,7 @@ // Create the FullRestoreSaveHandler instance before launching the app to // observe the browser window. full_restore::FullRestoreSaveHandler::GetInstance(); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) provider_->scheduler().LaunchAppWithCustomParams( std::move(params), @@ -1707,7 +1698,7 @@ policy_ids.emplace_back(*preinstalled_web_app_policy_id); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) auto* swa_manager = ash::SystemWebAppManager::Get(profile()); if (swa_manager && swa_manager->IsSystemWebApp(app_id)) { const auto& swa_data = web_app.client_data().system_web_app_data; @@ -1724,7 +1715,7 @@ policy_ids.push_back(file_manager::kFileManagerAppId); } } -#endif // BUIDLFLAG(IS_CHROMEOS_ASH) +#endif // BUIDLFLAG(IS_CHROMEOS) for (const auto& [source, external_config] : web_app.management_to_external_config_map()) { @@ -1752,7 +1743,7 @@ apps::PackageId WebAppPublisherHelper::GetPackageId( const WebApp& web_app) const { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (web_app.client_data().system_web_app_data) { const std::optional<std::string_view> policy_id = apps_util::GetPolicyIdForSystemWebAppType( @@ -1777,7 +1768,6 @@ app.show_in_search = true; app.show_in_shelf = true; -#if BUILDFLAG(IS_CHROMEOS_ASH) auto* swa_manager = ash::SystemWebAppManager::Get(profile()); if (!swa_manager) { return; @@ -1790,7 +1780,6 @@ app.show_in_shelf = system_app->ShouldShowInSearchAndShelf(); app.show_in_search = system_app->ShouldShowInSearchAndShelf(); } -#endif } bool WebAppPublisherHelper::MaybeAddNotification( @@ -1855,7 +1844,7 @@ return badge_manager_->GetBadgeValue(app_id).has_value(); } -#endif +#endif // BUILDFLAG(IS_CHROMEOS) void WebAppPublisherHelper::LaunchAppWithFilesCheckingUserPermission( const std::string& app_id, @@ -1949,7 +1938,7 @@ base::WeakPtr<Browser> browser, base::WeakPtr<content::WebContents> web_contents, apps::LaunchContainer container) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Save all launch information for system web apps, because the // browser session restore can't restore system web apps. int session_id = @@ -1972,7 +1961,7 @@ std::move(launch_info)); } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) std::move(on_complete).Run(web_contents.get()); }
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc b/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc index c8460d7..371ac0f 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc +++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc
@@ -16,7 +16,6 @@ #include "base/test/scoped_feature_list.h" #include "base/traits_bag.h" #include "build/buildflag.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/app_service_test.h" @@ -80,9 +79,6 @@ void SetUp() override { TestingProfile::Builder builder; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - builder.SetIsMainProfile(true); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) profile_ = builder.Build(); provider_ = WebAppProvider::GetForWebApps(profile());
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_unittest.cc b/chrome/browser/web_applications/app_service/web_app_publisher_unittest.cc index f5ef6ff..9d5fa0d 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_unittest.cc +++ b/chrome/browser/web_applications/app_service/web_app_publisher_unittest.cc
@@ -6,6 +6,7 @@ #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/test/test_future.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/app_registry_cache_waiter.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" @@ -23,7 +24,7 @@ #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/web_app_id_constants.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chromeos/ash/components/system/fake_statistics_provider.h" @@ -32,23 +33,13 @@ #include "net/base/url_util.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chrome/browser/web_applications/app_service/lacros_web_apps_controller.h" -#include "chrome/browser/web_applications/app_service/test/loopback_crosapi_app_service_proxy.h" -#endif - namespace web_app { -// Test the publishing of web apps in all platforms, will test both -// lacros_web_apps_controller and web_apps. class WebAppPublisherTest : public testing::Test { public: // testing::Test implementation. void SetUp() override { TestingProfile::Builder builder; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - builder.SetIsMainProfile(true); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) profile_ = builder.Build(); test::AwaitStartWebAppProviderAndSubsystems(profile()); } @@ -73,19 +64,6 @@ void InitializeWebAppPublisher() { apps::AppServiceTest app_service_test; app_service_test.SetUp(profile()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // For Lacros, we need the loopback crosapi to publish - // the web app to app service proxy without actually connect to - // crosapi in the test. AppServiceTest::SetUp will resets the - // crosapi connections in the app service proxy, so we have to - // set up the loopback crosapi after the setup. And we need to initialize - // the web app controller after set up the loopback crosapi to publish - // already installed web apps in the web app system. - // TODO(b/307477703): Add the loopback crosapi and init in app service test. - loopback_crosapi_ = - std::make_unique<LoopbackCrosapiAppServiceProxy>(profile()); - proxy()->LacrosWebAppsControllerForTesting()->Init(); -#endif } Profile* profile() { return profile_.get(); } @@ -93,9 +71,6 @@ private: content::BrowserTaskEnvironment task_environment_; std::unique_ptr<TestingProfile> profile_; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - std::unique_ptr<LoopbackCrosapiAppServiceProxy> loopback_crosapi_ = nullptr; -#endif }; } // namespace web_app
diff --git a/chrome/browser/web_applications/app_service/web_apps.cc b/chrome/browser/web_applications/app_service/web_apps.cc index 7f009d7..60604e16 100644 --- a/chrome/browser/web_applications/app_service/web_apps.cc +++ b/chrome/browser/web_applications/app_service/web_apps.cc
@@ -10,7 +10,7 @@ #include "base/feature_list.h" #include "base/memory/weak_ptr.h" #include "base/trace_event/trace_event.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" @@ -24,7 +24,7 @@ #include "components/services/app_service/public/cpp/icon_effects.h" #include "components/services/app_service/public/cpp/intent_util.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "ash/public/cpp/app_menu_constants.h" #include "ash/webui/projector_app/public/cpp/projector_app_constants.h" // nogncheck @@ -51,7 +51,7 @@ : apps::AppPublisher(proxy), profile_(proxy->profile()), provider_(WebAppProvider::GetForLocalAppsUnchecked(profile_)), -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) instance_registry_(&proxy->InstanceRegistry()), #endif publisher_helper_(profile_, provider_, this) { @@ -97,7 +97,7 @@ std::move(callback)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void WebApps::GetCompressedIconData(const std::string& app_id, int32_t size_in_dip, ui::ResourceScaleFactor scale_factor, @@ -167,7 +167,7 @@ report_abuse); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void WebApps::GetMenuModel(const std::string& app_id, apps::MenuType menu_type, int64_t display_id, @@ -264,7 +264,7 @@ if (apps.empty()) { return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // This is for prototyping and testing only. It is to provide an easy way to // simulate web app promise icon behaviour for the UI/ client development of // web app promise icons. @@ -275,25 +275,25 @@ apps::MaybeSimulatePromiseAppInstallationEvents(proxy(), app.get()); } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) apps::AppPublisher::Publish(std::move(apps), apps::AppType::kWeb, /*should_notify_initialized=*/false); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const WebApp* web_app = GetWebApp(ash::kChromeUIUntrustedProjectorSwaAppId); if (web_app) { proxy()->SetSupportedLinksPreference( ash::kChromeUIUntrustedProjectorSwaAppId); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } void WebApps::PublishWebApp(apps::AppPtr app) { if (!is_ready_) { return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool is_projector = app->app_id == ash::kChromeUIUntrustedProjectorSwaAppId; // This is for prototyping and testing only. @@ -302,11 +302,11 @@ if (ash::features::ArePromiseIconsForWebAppsEnabled()) { apps::MaybeSimulatePromiseAppInstallationEvents(proxy(), app.get()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) apps::AppPublisher::Publish(std::move(app)); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (is_projector) { // After OOBE, PublishWebApps() above could execute before the Projector app // has been registered. Since we need to call SetSupportedLinksPreference() @@ -315,7 +315,7 @@ proxy()->SetSupportedLinksPreference( ash::kChromeUIUntrustedProjectorSwaAppId); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } void WebApps::ModifyWebAppCapabilityAccess( @@ -348,8 +348,7 @@ /*should_notify_initialized=*/true); } - -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void WebApps::PauseApp(const std::string& app_id) { publisher_helper().PauseApp(app_id); }
diff --git a/chrome/browser/web_applications/app_service/web_apps.h b/chrome/browser/web_applications/app_service/web_apps.h index 05dcb20..4ab17026 100644 --- a/chrome/browser/web_applications/app_service/web_apps.h +++ b/chrome/browser/web_applications/app_service/web_apps.h
@@ -14,7 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/one_shot_event.h" #include "base/scoped_observation.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/launch_result_type.h" #include "chrome/browser/apps/app_service/publishers/app_publisher.h" #include "chrome/browser/web_applications/app_service/web_app_publisher_helper.h" @@ -29,15 +29,13 @@ #include "ui/base/resource/resource_scale_factor.h" #include "url/gurl.h" -static_assert(!BUILDFLAG(IS_CHROMEOS_LACROS), "For non-Lacros only"); - class Profile; namespace webapps { enum class WebappUninstallSource; } // namespace webapps -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) namespace apps { class InstanceRegistry; struct AppLaunchParams; @@ -78,7 +76,7 @@ int32_t size_hint_in_dip, bool allow_placeholder_icon, apps::LoadIconCallback callback) override; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void GetCompressedIconData(const std::string& app_id, int32_t size_in_dip, ui::ResourceScaleFactor scale_factor, @@ -106,13 +104,13 @@ apps::UninstallSource uninstall_source, bool clear_site_data, bool report_abuse) override; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void GetMenuModel( const std::string& app_id, apps::MenuType menu_type, int64_t display_id, base::OnceCallback<void(apps::MenuItems)> callback) override; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) void UpdateAppSize(const std::string& app_id) override; @@ -132,7 +130,7 @@ std::vector<apps::AppPtr> CreateWebApps(); void InitWebApps(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // apps::AppPublisher overrides. void PauseApp(const std::string& app_id) override; void UnpauseApp(const std::string& app_id) override; @@ -153,7 +151,7 @@ apps::MenuItems menu_items, base::OnceCallback<void(apps::MenuItems)> callback, ShortcutsMenuIconBitmaps shortcuts_menu_icon_bitmaps); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) const raw_ptr<Profile> profile_; @@ -162,7 +160,7 @@ // Specifies whether the web app registry becomes ready. bool is_ready_ = false; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const raw_ptr<apps::InstanceRegistry> instance_registry_; #endif
diff --git a/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc b/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc index d767278..68023aa 100644 --- a/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc +++ b/chrome/browser/web_applications/app_service/web_apps_chromeos_browsertest.cc
@@ -7,6 +7,10 @@ #include <string> #include "ash/constants/web_app_id_constants.h" +#include "ash/public/cpp/app_menu_constants.h" +#include "ash/public/cpp/shelf_item_delegate.h" +#include "ash/public/cpp/shelf_model.h" +#include "ash/public/cpp/system/toast_manager.h" #include "base/run_loop.h" #include "base/test/bind.h" #include "base/test/run_until.h" @@ -23,6 +27,7 @@ #include "chrome/browser/ui/web_applications/web_app_browsertest_base.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_server_mixin.h" +#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" #include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_constants.h" #include "chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h" #include "chrome/browser/web_applications/isolated_web_apps/test/policy_test_utils.h" @@ -51,21 +56,6 @@ #include "url/gurl.h" #include "url/origin.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include "ash/public/cpp/app_menu_constants.h" -#include "ash/public/cpp/shelf_item_delegate.h" -#include "ash/public/cpp/shelf_model.h" -#include "ash/public/cpp/system/toast_manager.h" -#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" -#include "chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/mojom/test_controller.mojom.h" -#include "chromeos/lacros/lacros_service.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - -#if BUILDFLAG(IS_CHROMEOS_ASH) namespace { void CheckShortcut(const ui::SimpleMenuModel& model, @@ -162,8 +152,6 @@ } // namespace -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - namespace { constexpr char kCalculatorAppUrl[] = "https://calculator.apps.chrome/"; @@ -259,16 +247,7 @@ } bool IsToastShown(const std::string& toast_id) { -#if BUILDFLAG(IS_CHROMEOS_ASH) return ash::ToastManager::Get()->IsToastShown(toast_id); -#else - base::test::TestFuture<bool> future; - chromeos::LacrosService::Get() - ->GetRemote<crosapi::mojom::TestController>() - ->IsToastShown(toast_id, future.GetCallback()); - EXPECT_TRUE(future.Wait()); - return future.Get<bool>(); -#endif } protected: @@ -277,8 +256,6 @@ isolated_web_app_update_server_mixin_{&mixin_host_}; }; -#if BUILDFLAG(IS_CHROMEOS_ASH) - IN_PROC_BROWSER_TEST_P(WebAppsPreventCloseChromeOsBrowserTest, CheckMenuModel) { // Set up policy values. InstallApp(); @@ -342,21 +319,8 @@ } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - IN_PROC_BROWSER_TEST_P(WebAppsPreventCloseChromeOsBrowserTest, CloseTabAttemptShowsToast) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // If ash does not contain the relevant test controller functionality, - // then there's nothing to do for this test. - auto* lacros_service = chromeos::LacrosService::Get(); - if (lacros_service->GetInterfaceVersion<crosapi::mojom::TestController>() < - static_cast<int>(crosapi::mojom::TestController::MethodMinVersions:: - kIsToastShownMinVersion)) { - GTEST_SKIP() << "Unsupported ash version for IsToastShown"; - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - const webapps::AppId installed_app_id = GetInstalledAppId(); InstallApp(); @@ -386,17 +350,6 @@ IN_PROC_BROWSER_TEST_P(WebAppsPreventCloseChromeOsBrowserTest, CloseWindowAttemptShowsToast) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // If ash does not contain the relevant test controller functionality, - // then there's nothing to do for this test. - auto* lacros_service = chromeos::LacrosService::Get(); - if (lacros_service->GetInterfaceVersion<crosapi::mojom::TestController>() < - static_cast<int>(crosapi::mojom::TestController::MethodMinVersions:: - kIsToastShownMinVersion)) { - GTEST_SKIP() << "Unsupported ash version for IsToastShown"; - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - const webapps::AppId installed_app_id = GetInstalledAppId(); InstallApp(); @@ -437,7 +390,6 @@ PreventCloseTestParams{.is_prevent_close_enabled = false, .app_type = AppType::kIsolatedWebApp})); -#if BUILDFLAG(IS_CHROMEOS_ASH) class IsolatedWebAppChromeOsBrowserTest : public web_app::IsolatedWebAppBrowserTestHarness { public: @@ -480,4 +432,3 @@ EXPECT_EQ(menu_model->GetTypeAt(0), ui::MenuModel::ItemType::TYPE_COMMAND); EXPECT_EQ(menu_model->GetCommandIdAt(0), ash::LAUNCH_NEW); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/web_applications/ash/migrations/BUILD.gn b/chrome/browser/web_applications/ash/migrations/BUILD.gn index 2515caa..c06f34d0 100644 --- a/chrome/browser/web_applications/ash/migrations/BUILD.gn +++ b/chrome/browser/web_applications/ash/migrations/BUILD.gn
@@ -2,9 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") - -assert(is_chromeos_ash) +assert(is_chromeos) static_library("migrations") { sources = [
diff --git a/chrome/browser/web_applications/chromeos_web_app_experiments.cc b/chrome/browser/web_applications/chromeos_web_app_experiments.cc index c06456b..e35d518 100644 --- a/chrome/browser/web_applications/chromeos_web_app_experiments.cc +++ b/chrome/browser/web_applications/chromeos_web_app_experiments.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/chromeos/upload_office_to_cloud/upload_office_to_cloud.h" #include "chrome/browser/profiles/profile.h" #include "chromeos/constants/chromeos_features.h" +#include "third_party/blink/public/mojom/manifest/manifest.mojom.h" #include "url/gurl.h" #include "url/url_constants.h" @@ -21,6 +22,8 @@ namespace { +constexpr const char* kMicrosoft365ManifestId = "?from=Homescreen"; + bool g_always_enabled_for_testing = false; bool IsExperimentEnabled(const webapps::AppId& app_id) { @@ -156,6 +159,31 @@ return IsExperimentEnabled(target_app_id); } +void ChromeOsWebAppExperiments::MaybeOverrideManifest( + content::RenderFrameHost* frame_host, + blink::mojom::ManifestPtr& manifest) { + if (!::chromeos::features::IsMicrosoft365ManifestOverrideEnabled()) { + return; + } + + const auto pwa_start_url_origin = url::Origin::Create(manifest->start_url); + std::string pwa_start_url_path = + manifest->start_url.GetWithoutFilename().path(); + + const auto microsoft365_manifest_urls = GetListFromFinchParam( + chromeos::features::kMicrosoft365ManifestUrls.Get()); + + for (const auto& url_string : microsoft365_manifest_urls) { + GURL microsoft365_manifest_url = GURL(url_string); + + if (pwa_start_url_origin.IsSameOriginWith(microsoft365_manifest_url) && + pwa_start_url_path == microsoft365_manifest_url.path()) { + manifest->id = + GURL(pwa_start_url_origin.GetURL().spec() + kMicrosoft365ManifestId); + } + } +} + void ChromeOsWebAppExperiments::SetAlwaysEnabledForTesting() { g_always_enabled_for_testing = true; }
diff --git a/chrome/browser/web_applications/chromeos_web_app_experiments.h b/chrome/browser/web_applications/chromeos_web_app_experiments.h index 1d7b379..bbc9e94 100644 --- a/chrome/browser/web_applications/chromeos_web_app_experiments.h +++ b/chrome/browser/web_applications/chromeos_web_app_experiments.h
@@ -12,6 +12,8 @@ #include "base/containers/span.h" #include "chrome/browser/web_applications/scope_extension_info.h" #include "components/webapps/common/web_app_id.h" +#include "content/public/browser/render_frame_host.h" +#include "third_party/blink/public/common/manifest/manifest.h" #include "third_party/skia/include/core/SkColor.h" #include "url/gurl.h" @@ -68,6 +70,11 @@ static bool ShouldLaunchForRedirectedNavigation( const webapps::AppId& target_app_id); + // Override the manifest id with predefined query params if the start URL in + // the manifest matches certain URLs controlled via a finch parameter. + static void MaybeOverrideManifest(content::RenderFrameHost* frame_host, + blink::mojom::ManifestPtr& manifest); + static void SetAlwaysEnabledForTesting(); static void SetScopeExtensionsForTesting( std::vector<const char*> scope_extensions_override);
diff --git a/chrome/browser/web_applications/chromeos_web_app_experiments_browsertest.cc b/chrome/browser/web_applications/chromeos_web_app_experiments_browsertest.cc index 016b044..41853289a 100644 --- a/chrome/browser/web_applications/chromeos_web_app_experiments_browsertest.cc +++ b/chrome/browser/web_applications/chromeos_web_app_experiments_browsertest.cc
@@ -11,6 +11,7 @@ #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/test/scoped_feature_list.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/app_registry_cache_waiter.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" @@ -34,16 +35,18 @@ #include "content/public/test/test_navigation_observer.h" #include "content/public/test/theme_change_waiter.h" #include "third_party/blink/public/common/input/web_input_event.h" +#include "third_party/blink/public/common/manifest/manifest.h" #include "third_party/blink/public/mojom/input/input_event.mojom-shared.h" +#include "third_party/blink/public/mojom/manifest/manifest.mojom.h" #include "url/gurl.h" #include "url/url_constants.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/startup/browser_init_params.h" -#endif - static_assert(BUILDFLAG(IS_CHROMEOS), "For Chrome OS only"); +namespace { +constexpr char kMicrosoft365ManifestUrlsFinchParam[] = "m365-manifest-urls"; +} + namespace web_app { class ChromeOsWebAppExperimentsBrowserTest @@ -80,12 +83,6 @@ browser(), embedded_test_server()->GetURL( "/web_apps/get_manifest.html?theme_color.json")); apps::AppReadinessWaiter(profile(), app_id_).Await(); - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - auto init_params = chromeos::BrowserInitParams::GetForTests()->Clone(); - init_params->is_upload_office_to_cloud_enabled = true; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#endif } void TearDownOnMainThread() override { WebAppNavigationBrowserTest::TearDownOnMainThread(); @@ -96,8 +93,6 @@ webapps::AppId app_id_; GURL extended_scope_; GURL extended_scope_page_; - // This has no effect in Lacros, the feature is enabled via - // `chromeos::BrowserInitParams` instead. base::test::ScopedFeatureList scoped_feature_list_; }; @@ -110,10 +105,6 @@ EXPECT_FALSE(app_browser->app_controller()->ShouldShowCustomTabBar()); } -// TODO(https://issuetracker.google.com/248979304): Deflake these tests on -// Lacros + Ash. -#if !BUILDFLAG(IS_CHROMEOS_LACROS) - IN_PROC_BROWSER_TEST_P(ChromeOsWebAppExperimentsBrowserTest, LinkCaptureScopeExtension) { // Turn on link capturing for the web app. @@ -423,6 +414,199 @@ testing::Values(apps::test::LinkCapturingFeatureVersion::kV1DefaultOff), apps::test::LinkCapturingVersionToString); -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) +class ChromeOsWebAppExperimentsManifestOverrideBrowserTest + : public InProcessBrowserTest { + public: + ChromeOsWebAppExperimentsManifestOverrideBrowserTest() = default; + + void TearDown() override { + InProcessBrowserTest::TearDown(); + scoped_feature_list_.Reset(); + } + + Profile* profile() { return browser()->profile(); } + + content::WebContents* web_contents() const { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + content::RenderFrameHost* RenderFrameHost() const { + return web_contents()->GetPrimaryMainFrame(); + } + + base::test::ScopedFeatureList scoped_feature_list_; +}; + +class ChromeOsWebAppExperimentsManifestOverrideDisabledBrowserTest + : public ChromeOsWebAppExperimentsManifestOverrideBrowserTest { + public: + ChromeOsWebAppExperimentsManifestOverrideDisabledBrowserTest() { + scoped_feature_list_.InitAndDisableFeature( + chromeos::features::kMicrosoft365ManifestOverride); + } +}; + +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideDisabledBrowserTest, + DontOverrideManifestWithFlagDisabled) { + const GURL m365PWAUrl = GURL("https://www.microsoft365.com/"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(m365PWAUrl, manifest->id); +} + +class ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest + : public ChromeOsWebAppExperimentsManifestOverrideBrowserTest { + public: + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest() { + EnableM365ManifestUrls( + "https://www.microsoft365.com/,https://www.example.com/"); + } + + void EnableM365ManifestUrls(const std::string& urls) { + scoped_feature_list_.InitAndEnableFeatureWithParameters( + chromeos::features::kMicrosoft365ManifestOverride, + {{kMicrosoft365ManifestUrlsFinchParam, urls}}); + } +}; + +// The manifest id should not be overridden if the start URL is not contained in +// the Url list of the corresponding finch parameter. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + DontOverrideManifestForNonMatchingUrl) { + const GURL m365PWAUrl = GURL("https://www.example2.com/"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(m365PWAUrl, manifest->id); +} + +// The manifest id should not be overridden if the start URL origin matches but +// the path does not. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + DontOverrideManifestForUrlWithPath) { + const GURL m365PWAUrlWithPath = + GURL("https://www.microsoft365.com/launch/word/"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrlWithPath; + manifest->start_url = m365PWAUrlWithPath; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(m365PWAUrlWithPath, manifest->id); +} + +// The manifest id should be overridden if the start URL matches a URL in the +// corresponding finch flag. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + OverrideManifestIdForMatchingUrl) { + // Override manifest for plain Url. + const GURL m365PWAUrl = GURL("https://www.microsoft365.com/"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(GURL("https://www.microsoft365.com/?from=Homescreen"), + manifest->id); +} + +// The manifest id should be overridden if the start URL matches a URL in the +// corresponding finch flag except for query parameters. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + OverrideManifestIdForMatchingUrlWithQueryParams) { + const GURL m365PWAUrl = GURL("https://www.microsoft365.com/?auth=1"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(GURL("https://www.microsoft365.com/?from=Homescreen"), + manifest->id); +} + +// The manifest id should be overridden if the start URL matches a URL in the +// corresponding finch flag except for a file name. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + OverrideManifestIdForMatchingUrlWithFileName) { + const GURL m365PWAUrl = GURL("https://www.microsoft365.com/index.html"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(GURL("https://www.microsoft365.com/?from=Homescreen"), + manifest->id); +} + +// The manifest id should be overridden if the start URL matches a URL in the +// corresponding finch flag except for a fragment. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + OverrideManifestIdForMatchingUrlWithFragment) { + const GURL m365PWAUrl = GURL("https://www.microsoft365.com/#test"); + + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl; + manifest->start_url = m365PWAUrl; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), manifest); + + EXPECT_EQ(GURL("https://www.microsoft365.com/?from=Homescreen"), + manifest->id); +} + +// The manifest id should be overridden if the start URL matches one of multiple +// URLs in the corresponding finch flag. +IN_PROC_BROWSER_TEST_F( + ChromeOsWebAppExperimentsManifestOverrideEnabledBrowserTest, + OverrideManifestIdForMultipleUrls) { + const GURL m365PWAUrl1 = GURL("https://www.microsoft365.com/"); + const GURL m365PWAUrl2 = GURL("https://www.example.com/?test=a"); + + { + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl1; + manifest->start_url = m365PWAUrl1; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), + manifest); + + EXPECT_EQ(GURL("https://www.microsoft365.com/?from=Homescreen"), + manifest->id); + } + + { + blink::mojom::ManifestPtr manifest = blink::mojom::Manifest::New(); + manifest->id = m365PWAUrl2; + manifest->start_url = m365PWAUrl2; + + ChromeOsWebAppExperiments::MaybeOverrideManifest(RenderFrameHost(), + manifest); + + EXPECT_EQ(GURL("https://www.example.com/?from=Homescreen"), manifest->id); + } +} } // namespace web_app
diff --git a/chrome/browser/web_applications/commands/dedupe_install_urls_command_unittest.cc b/chrome/browser/web_applications/commands/dedupe_install_urls_command_unittest.cc index 84f1492..25ba0ba 100644 --- a/chrome/browser/web_applications/commands/dedupe_install_urls_command_unittest.cc +++ b/chrome/browser/web_applications/commands/dedupe_install_urls_command_unittest.cc
@@ -6,6 +6,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/test_future.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/policy/web_app_policy_manager.h" #include "chrome/browser/web_applications/preinstalled_web_app_manager.h" @@ -22,7 +23,7 @@ #include "chrome/browser/web_applications/web_app_sync_bridge.h" #include "chrome/common/pref_names.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/components/system/fake_statistics_provider.h" #include "chromeos/ash/components/system/statistics_provider.h" #endif @@ -48,7 +49,7 @@ test::AwaitStartWebAppProviderAndSubsystems(profile()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Mocking the StatisticsProvider for testing. ash::system::StatisticsProvider::SetTestProvider(&statistics_provider); statistics_provider.SetMachineStatistic(ash::system::kActivateDateKey, @@ -57,7 +58,7 @@ } void TearDown() override { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ash::system::StatisticsProvider::SetTestProvider(nullptr); #endif WebAppTest::TearDown(); @@ -136,9 +137,9 @@ base::AutoReset<bool> skip_preinstalled_web_app_startup_; base::AutoReset<bool> bypass_offline_manifest_requirement_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ash::system::FakeStatisticsProvider statistics_provider; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) }; TEST_F(DedupeInstallUrlsCommandTest,
diff --git a/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc b/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc index ec70baeb..8113eab 100644 --- a/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc +++ b/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc
@@ -1185,7 +1185,6 @@ } } -#if !BUILDFLAG(IS_CHROMEOS_LACROS) TEST_F(ExternalAppResolutionCommandTest, SuccessWithUninstallAndReplace) { GURL old_app_url("http://old-app.com"); const webapps::AppId old_app = @@ -1225,7 +1224,6 @@ EXPECT_EQ(os_state->run_on_os_login().run_on_os_login_mode(), proto::RunOnOsLoginMode::WINDOWED); } -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) TEST_F(ExternalAppResolutionCommandTest, WriteDataToDiskFailed) { ExternalInstallOptions install_options(
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 076ea6c..5647dbd 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
@@ -17,6 +17,7 @@ #include "base/strings/to_string.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/commands/command_metrics.h" #include "chrome/browser/web_applications/commands/web_app_command.h" @@ -55,35 +56,21 @@ #include "content/public/browser/web_contents_observer.h" #include "url/origin.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "chromeos/ash/experiences/arc/mojom/app.mojom.h" #include "chromeos/ash/experiences/arc/mojom/intent_helper.mojom.h" #include "chromeos/ash/experiences/arc/session/arc_bridge_service.h" #include "chromeos/ash/experiences/arc/session/arc_service_manager.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS) -#include "base/strings/utf_string_conversions.h" #include "net/base/url_util.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/mojom/arc.mojom.h" -#include "chromeos/crosapi/mojom/web_app_service.mojom.h" -#include "chromeos/lacros/lacros_service.h" -#include "chromeos/startup/browser_params_proxy.h" -#endif - namespace web_app { namespace { -#if BUILDFLAG(IS_CHROMEOS_ASH) -constexpr bool kAddAppsToQuickLaunchBarByDefault = false; -#else -constexpr bool kAddAppsToQuickLaunchBarByDefault = true; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +constexpr bool kAddAppsToQuickLaunchBarByDefault = !BUILDFLAG(IS_CHROMEOS); #if BUILDFLAG(IS_CHROMEOS) const char kChromeOsPlayPlatform[] = "chromeos_play"; @@ -128,29 +115,6 @@ } #endif // BUILDFLAG(IS_CHROMEOS) -#if BUILDFLAG(IS_CHROMEOS_LACROS) -bool ShouldInteractWithArc() { - auto* lacros_service = chromeos::LacrosService::Get(); - return lacros_service && - // Only use ARC installation flow if we know that remote ash-chrome is - // capable of installing from Play Store in lacros-chrome, to avoid - // redirecting users to the Play Store if they cannot install - // anything. - lacros_service->IsAvailable<crosapi::mojom::WebAppService>(); -} - -mojo::Remote<crosapi::mojom::Arc>* GetArcRemoteWithMinVersion( - uint32_t minVersion) { - auto* lacros_service = chromeos::LacrosService::Get(); - if (lacros_service && lacros_service->IsAvailable<crosapi::mojom::Arc>() && - lacros_service->GetInterfaceVersion<crosapi::mojom::Arc>() >= - static_cast<int>(minVersion)) { - return &lacros_service->GetRemote<crosapi::mojom::Arc>(); - } - return nullptr; -} -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - void LogInstallInfo(base::Value::Dict& dict, const WebAppInstallInfo& install_info) { dict.Set("manifest_id", install_info.manifest_id().spec()); @@ -543,7 +507,7 @@ bool skip_store = is_create_shortcut || !opt_manifest_; if (!skip_store) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) std::optional<PlayStoreIntent> intent = GetPlayStoreIntentFromManifest(*opt_manifest_); if (intent) { @@ -561,25 +525,7 @@ } } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - if (ShouldInteractWithArc()) { - std::optional<PlayStoreIntent> intent = - GetPlayStoreIntentFromManifest(*opt_manifest_); - mojo::Remote<crosapi::mojom::Arc>* opt_arc = GetArcRemoteWithMinVersion( - crosapi::mojom::Arc::MethodMinVersions::kIsInstallableMinVersion); - if (opt_arc && intent) { - mojo::Remote<crosapi::mojom::Arc>& arc = *opt_arc; - arc->IsInstallable( - intent->app_id, - base::BindOnce(&FetchManifestAndInstallCommand:: - OnDidCheckForIntentToPlayStoreLacros, - weak_ptr_factory_.GetWeakPtr(), intent->intent)); - return; - } - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS) } OnDidCheckForIntentToPlayStore(/*intent=*/"", /*should_intent_to_store=*/false); @@ -592,7 +538,7 @@ Abort(webapps::InstallResultCode::kWebContentsDestroyed); return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (should_intent_to_store && !intent.empty()) { auto* arc_service_manager = arc::ArcServiceManager::Get(); if (arc_service_manager) { @@ -606,20 +552,7 @@ } } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - if (ShouldInteractWithArc() && should_intent_to_store && !intent.empty()) { - mojo::Remote<crosapi::mojom::Arc>* opt_arc = GetArcRemoteWithMinVersion( - crosapi::mojom::Arc::MethodMinVersions::kHandleUrlMinVersion); - if (opt_arc) { - mojo::Remote<crosapi::mojom::Arc>& arc = *opt_arc; - arc->HandleUrl(intent, kPlayStorePackage); - Abort(webapps::InstallResultCode::kIntentToPlayStore); - return; - } - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS) data_retriever_->GetIcons( web_contents_.get(), icons_from_manifest_, @@ -630,15 +563,6 @@ weak_ptr_factory_.GetWeakPtr())); } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -void FetchManifestAndInstallCommand::OnDidCheckForIntentToPlayStoreLacros( - const std::string& intent, - crosapi::mojom::IsInstallableResult result) { - OnDidCheckForIntentToPlayStore( - intent, result == crosapi::mojom::IsInstallableResult::kInstallable); -} -#endif - void FetchManifestAndInstallCommand::OnIconsRetrievedShowDialog( IconsDownloadedResult result, IconsMap icons_map,
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 bf241f7..ea799a8 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
@@ -32,10 +32,6 @@ #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" #include "third_party/skia/include/core/SkBitmap.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/mojom/arc.mojom.h" -#endif - namespace content { class WebContents; class NavigationHandle; @@ -117,15 +113,6 @@ void OnDidCheckForIntentToPlayStore(const std::string& intent, bool should_intent_to_store); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Called when the asynchronous check for whether an intent to the Play Store - // should be made returns (Lacros adapter that calls - // |OnDidCheckForIntentToPlayStore| based on |result|). - void OnDidCheckForIntentToPlayStoreLacros( - const std::string& intent, - crosapi::mojom::IsInstallableResult result); -#endif - void OnIconsRetrievedShowDialog( IconsDownloadedResult result, IconsMap icons_map,
diff --git a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_unittest.cc b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_unittest.cc index 8130d12..b48d9a3 100644 --- a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_unittest.cc +++ b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_unittest.cc
@@ -19,6 +19,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" +#include "build/build_config.h" #include "chrome/browser/shortcuts/shortcut_icon_generator.h" #include "chrome/browser/ui/web_applications/web_app_dialog_utils.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" @@ -68,7 +69,7 @@ #include "ui/gfx/image/image_unittest_util.h" #include "ui/gfx/test/sk_gmock_support.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/ash/app_list/arc/arc_app_test.h" #include "chromeos/ash/experiences/arc/mojom/intent_helper.mojom.h" #include "chromeos/ash/experiences/arc/session/arc_bridge_service.h" @@ -101,7 +102,7 @@ web_contents_manager().SetUrlLoaded(web_contents(), kWebAppUrl); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) arc_test_.SetUp(profile()); auto* arc_bridge_service = @@ -117,7 +118,7 @@ } void TearDown() override { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) arc_test_.arc_service_manager() ->arc_bridge_service() ->intent_helper() @@ -143,7 +144,7 @@ return *fake_provider().file_utils()->AsTestFileUtils(); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ArcAppTest& arc_test() { return arc_test_; } #endif @@ -232,7 +233,7 @@ private: base::HistogramTester histogram_tester_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ArcAppTest arc_test_; std::unique_ptr<arc::FakeIntentHelperHost> fake_intent_helper_host_; std::unique_ptr<arc::FakeIntentHelperInstance> fake_intent_helper_instance_; @@ -738,7 +739,7 @@ EXPECT_FALSE(provider()->registrar_unsafe().IsInRegistrar(kWebAppId)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(FetchManifestAndInstallCommandTest, IntentToPlayStore) { arc_test().app_instance()->set_is_installable(true);
diff --git a/chrome/browser/web_applications/commands/install_app_from_verified_manifest_command.cc b/chrome/browser/web_applications/commands/install_app_from_verified_manifest_command.cc index 378806a..c4db751 100644 --- a/chrome/browser/web_applications/commands/install_app_from_verified_manifest_command.cc +++ b/chrome/browser/web_applications/commands/install_app_from_verified_manifest_command.cc
@@ -44,9 +44,9 @@ namespace { -// TODO(crbug.com/40273612): Find a better way to do Lacros testing so that we -// don't have to pass localhost into the allowlist. Allowlisted host must be -// from a Google server. +// TODO(crbug.com/40273612): Figure out why tests fail when removing +// 127.0.0.1 even though that was added only for Lacros testing and hence +// shouldn't be needed anymore. constexpr auto kHostAllowlist = base::MakeFixedFlatSet<std::string_view>( {"googleusercontent.com", "gstatic.com", "youtube.com", "127.0.0.1" /*FOR TESTING*/});
diff --git a/chrome/browser/web_applications/commands/install_from_info_command_browsertest.cc b/chrome/browser/web_applications/commands/install_from_info_command_browsertest.cc index 7be1d027..4a7cd3d 100644 --- a/chrome/browser/web_applications/commands/install_from_info_command_browsertest.cc +++ b/chrome/browser/web_applications/commands/install_from_info_command_browsertest.cc
@@ -12,6 +12,7 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/test_future.h" +#include "build/build_config.h" #include "chrome/browser/ui/web_applications/web_app_browsertest_base.h" #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" #include "chrome/browser/web_applications/proto/web_app_install_state.pb.h" @@ -62,7 +63,7 @@ info->title = u"Test name"; const webapps::WebappInstallSource install_source = -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) webapps::WebappInstallSource::SYSTEM_DEFAULT; #else webapps::WebappInstallSource::OMNIBOX_INSTALL_ICON;
diff --git a/chrome/browser/web_applications/commands/launch_web_app_command_browsertest.cc b/chrome/browser/web_applications/commands/launch_web_app_command_browsertest.cc index bc14bd1..d1222f6 100644 --- a/chrome/browser/web_applications/commands/launch_web_app_command_browsertest.cc +++ b/chrome/browser/web_applications/commands/launch_web_app_command_browsertest.cc
@@ -13,7 +13,6 @@ #include "base/test/bind.h" #include "base/test/test_future.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_registry_cache_waiter.h" #include "chrome/browser/profiles/profile.h" @@ -47,15 +46,6 @@ #include "ui/base/window_open_disposition.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chrome/browser/signin/identity_manager_factory.h" -#include "chrome/browser/ui/startup/first_run_service.h" -#include "chromeos/crosapi/mojom/crosapi.mojom.h" -#include "chromeos/lacros/lacros_service.h" -#include "chromeos/startup/browser_init_params.h" -#include "components/keyed_service/content/browser_context_dependency_manager.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - using ::testing::_; using ::testing::Invoke; using ::testing::Return; @@ -71,59 +61,6 @@ const base::FilePath::CharType kCurrentDirectory[] = FILE_PATH_LITERAL("/path"); #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_CHROMEOS_LACROS) -class FirstRunServiceMock : public FirstRunService { - public: - FirstRunServiceMock(Profile& profile, - signin::IdentityManager& identity_manager) - : FirstRunService(profile, identity_manager) {} - - MOCK_METHOD(bool, ShouldOpenFirstRun, (), (const, override)); - MOCK_METHOD(void, - OpenFirstRunIfNeeded, - (EntryPoint entry_point, ResumeTaskCallback callback), - (override)); -}; - -std::unique_ptr<KeyedService> BuildTestFirstRunService( - bool create_first_run_service, - content::BrowserContext* context) { - if (!create_first_run_service) { - return nullptr; - } - - Profile* profile = Profile::FromBrowserContext(context); - CHECK(profile); - return std::make_unique<FirstRunServiceMock>( - *profile, *IdentityManagerFactory::GetForProfile(profile)); -} - -class FirstRunServiceOverrideHelper { - public: - explicit FirstRunServiceOverrideHelper(bool create_first_run_service) - : create_first_run_service_(create_first_run_service) { - CHECK(BrowserContextDependencyManager::GetInstance()); - create_services_subscription_ = - BrowserContextDependencyManager::GetInstance() - ->RegisterCreateServicesCallbackForTesting( - base::BindRepeating(&FirstRunServiceOverrideHelper:: - OnWillCreateBrowserContextServices, - base::Unretained(this))); - } - - private: - void OnWillCreateBrowserContextServices(content::BrowserContext* context) { - FirstRunServiceFactory::GetInstance()->SetTestingFactory( - context, base::BindRepeating(BuildTestFirstRunService, - create_first_run_service_)); - } - - bool create_first_run_service_ = false; - - base::CallbackListSubscription create_services_subscription_; -}; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - class LaunchWebAppWithFirstRunServiceBrowserTest : public WebAppBrowserTestBase, public testing::WithParamInterface<bool> { @@ -131,13 +68,6 @@ LaunchWebAppWithFirstRunServiceBrowserTest() = default; ~LaunchWebAppWithFirstRunServiceBrowserTest() override = default; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - void SetUpInProcessBrowserTestFixture() override { - first_run_service_override_helper_ = - std::make_unique<FirstRunServiceOverrideHelper>(GetParam()); - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - protected: WebAppProvider& GetProvider() { return *WebAppProvider::GetForTest(browser()->profile()); @@ -163,12 +93,6 @@ run_loop.Run(); return app_id; } - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - private: - std::unique_ptr<FirstRunServiceOverrideHelper> - first_run_service_override_helper_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) }; IN_PROC_BROWSER_TEST_P( @@ -177,20 +101,6 @@ webapps::AppId app_id = InstallWebApp(https_server()->GetURL("/banners/manifest_test_page.html")); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - FirstRunServiceMock* first_run_service = static_cast<FirstRunServiceMock*>( - FirstRunServiceFactory::GetForBrowserContextIfExists(profile())); - - if (GetParam()) { - EXPECT_CALL(*first_run_service, OpenFirstRunIfNeeded(_, _)) - .WillOnce(WithArg<1>(Invoke([](ResumeTaskCallback callback) { - std::move(callback).Run(/*proceed=*/true); - }))); - } else { - ASSERT_FALSE(first_run_service); - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - ASSERT_EQ(proto::INSTALLED_WITH_OS_INTEGRATION, GetProvider().registrar_unsafe().GetInstallState(app_id)); @@ -203,20 +113,6 @@ webapps::AppId app_id = InstallWebApp(https_server()->GetURL("/banners/manifest_test_page.html")); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - FirstRunServiceMock* first_run_service = static_cast<FirstRunServiceMock*>( - FirstRunServiceFactory::GetForBrowserContextIfExists(profile())); - - if (GetParam()) { - EXPECT_CALL(*first_run_service, OpenFirstRunIfNeeded(_, _)) - .WillOnce(WithArg<1>(Invoke([](ResumeTaskCallback callback) { - std::move(callback).Run(/*proceed=*/true); - }))); - } else { - ASSERT_FALSE(first_run_service); - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - ASSERT_EQ(proto::INSTALLED_WITH_OS_INTEGRATION, GetProvider().registrar_unsafe().GetInstallState(app_id)); @@ -224,55 +120,6 @@ ASSERT_TRUE(browser); } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -IN_PROC_BROWSER_TEST_P(LaunchWebAppWithFirstRunServiceBrowserTest, - LaunchInWindowWithFirstRunServiceRequiredSetupSkipped) { - webapps::AppId app_id = - InstallWebApp(https_server()->GetURL("/banners/manifest_test_page.html")); - - FirstRunServiceMock* first_run_service = static_cast<FirstRunServiceMock*>( - FirstRunServiceFactory::GetForBrowserContextIfExists(profile())); - if (GetParam()) { - EXPECT_CALL(*first_run_service, OpenFirstRunIfNeeded(_, _)) - .WillOnce(WithArg<1>(Invoke([](ResumeTaskCallback callback) { - std::move(callback).Run(/*proceed=*/false); - }))); - } else { - ASSERT_FALSE(first_run_service); - } - - ASSERT_EQ(GetProvider().registrar_unsafe().GetInstallState(app_id), - proto::INSTALLED_WITH_OS_INTEGRATION); - - Browser* browser = LaunchWebAppBrowser(app_id); - ASSERT_EQ(browser == nullptr, GetParam()); -} - -IN_PROC_BROWSER_TEST_P(LaunchWebAppWithFirstRunServiceBrowserTest, - LaunchInTabWithFirstRunServiceRequiredSetupSkipped) { - webapps::AppId app_id = - InstallWebApp(https_server()->GetURL("/banners/manifest_test_page.html")); - - FirstRunServiceMock* first_run_service = static_cast<FirstRunServiceMock*>( - FirstRunServiceFactory::GetForBrowserContextIfExists(profile())); - - if (GetParam()) { - EXPECT_CALL(*first_run_service, OpenFirstRunIfNeeded(_, _)) - .WillOnce(WithArg<1>(Invoke([](ResumeTaskCallback callback) { - std::move(callback).Run(/*proceed=*/true); - }))); - } else { - ASSERT_FALSE(first_run_service); - } - - ASSERT_EQ(GetProvider().registrar_unsafe().GetInstallState( - app_id), proto::INSTALLED_WITH_OS_INTEGRATION)); - - Browser* browser = LaunchBrowserForWebAppInTab(app_id); - ASSERT_TRUE(browser); -} -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - INSTANTIATE_TEST_SUITE_P(All, LaunchWebAppWithFirstRunServiceBrowserTest, ::testing::Values(true, false));
diff --git a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command_browsertest.cc b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command_browsertest.cc index 59ea996..cf7d127 100644 --- a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command_browsertest.cc +++ b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command_browsertest.cc
@@ -6,7 +6,6 @@ #include "base/files/file_util.h" #include "base/test/test_future.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/ui/web_applications/web_app_browsertest_base.h" #include "chrome/browser/web_applications/test/os_integration_test_override_impl.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" @@ -86,13 +85,7 @@ } #endif // BUILDFLAG(IS_MAC) - bool AreProtocolsRegisteredWithOs() { -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - return false; -#else - return true; -#endif - } + bool AreProtocolsRegisteredWithOs() { return !BUILDFLAG(IS_CHROMEOS); } }; IN_PROC_BROWSER_TEST_F(UpdateProtocolHandlerApprovalCommandTest, Install) {
diff --git a/chrome/browser/web_applications/extensions/BUILD.gn b/chrome/browser/web_applications/extensions/BUILD.gn index b8dec58..b7fed69 100644 --- a/chrome/browser/web_applications/extensions/BUILD.gn +++ b/chrome/browser/web_applications/extensions/BUILD.gn
@@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/chromeos/ui_mode.gni") import("//extensions/buildflags/buildflags.gni") assert(enable_extensions) @@ -52,7 +51,6 @@ deps = [ ":extensions", - "//build:chromeos_buildflags", "//chrome/browser/web_applications", "//chrome/browser/web_applications:web_applications_test_support", "//chrome/browser/web_applications:web_applications_unit_tests", @@ -70,15 +68,10 @@ if (is_chromeos) { deps += [ - "//chrome/browser", - "//components/policy/core/common:common_constants", - ] - } - - if (is_chromeos_ash) { - deps += [ "//ash/constants", + "//chrome/browser", "//chrome/browser/ash/system_web_apps/test_support", + "//components/policy/core/common:common_constants", ] } }
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 32b471c..ff28f49 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
@@ -92,9 +92,6 @@ } }; -// `WebAppUninstallAndReplaceJob` uses `AppServiceProxy` to do uninstall, app -// service only lives on chromeos ash not lacros. -#if !BUILDFLAG(IS_CHROMEOS_LACROS) // Regression test for crbug.com/1182030 TEST_F(WebAppUninstallAndReplaceJobTest, WebAppMigrationPreservesShortcutStates) { @@ -159,6 +156,5 @@ future.GetCallback()); EXPECT_FALSE(future.Get()); } -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) } // namespace web_app
diff --git a/chrome/browser/web_applications/external_install_options.cc b/chrome/browser/web_applications/external_install_options.cc index ec0d2ee..5954a15 100644 --- a/chrome/browser/web_applications/external_install_options.cc +++ b/chrome/browser/web_applications/external_install_options.cc
@@ -12,7 +12,7 @@ #include "base/not_fatal_until.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/proto/web_app_install_state.pb.h" #include "chrome/browser/web_applications/user_display_mode.h" @@ -63,10 +63,10 @@ options.user_type_allowlist, options.gate_on_feature, options.gate_on_feature_or_installed, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) options.disable_if_arc_supported, options.disable_if_tablet_form_factor, -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) options.require_manifest, options.install_as_diy, options.is_preferred_app_for_supported_links, @@ -81,7 +81,7 @@ options.uninstall_and_replace, options.additional_search_terms, options.only_use_app_info_factory, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) options.system_app_type, #endif options.oem_installed, @@ -119,10 +119,10 @@ root.Set("additional_search_terms", ConvertStringList(additional_search_terms)); root.Set("app_info_factory", static_cast<bool>(app_info_factory)); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) root.Set("disable_if_arc_supported", disable_if_arc_supported); root.Set("disable_if_tablet_form_factor", disable_if_tablet_form_factor); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) root.Set("disable_if_touchscreen_with_stylus_not_supported", disable_if_touchscreen_with_stylus_not_supported); root.Set("expected_app_id", ConvertOptional(expected_app_id)); @@ -156,7 +156,7 @@ : base::Value()); root.Set("service_worker_registration_timeout_in_seconds", service_worker_registration_timeout.InSecondsF()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) root.Set("system_app_type", system_app_type ? base::Value(static_cast<int>(*system_app_type)) : base::Value()); @@ -203,7 +203,7 @@ params.launch_query_params = install_options.launch_query_params; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) params.system_app_type = install_options.system_app_type; #endif
diff --git a/chrome/browser/web_applications/external_install_options.h b/chrome/browser/web_applications/external_install_options.h index 769b7bc..dd03afe7 100644 --- a/chrome/browser/web_applications/external_install_options.h +++ b/chrome/browser/web_applications/external_install_options.h
@@ -11,7 +11,7 @@ #include "base/time/time.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_install_info.h" @@ -19,7 +19,7 @@ #include "components/webapps/common/web_app_id.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/webui/system_apps/public/system_web_app_type.h" #endif @@ -210,7 +210,7 @@ // as the app's installation metadata. WebAppInstallInfoFactory app_info_factory; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // The type of SystemWebApp, if this app is a System Web App. std::optional<ash::SystemWebAppType> system_app_type = std::nullopt; #endif
diff --git a/chrome/browser/web_applications/external_install_options_unittest.cc b/chrome/browser/web_applications/external_install_options_unittest.cc index 325ef69..2a48042 100644 --- a/chrome/browser/web_applications/external_install_options_unittest.cc +++ b/chrome/browser/web_applications/external_install_options_unittest.cc
@@ -7,6 +7,7 @@ #include <string> #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/web_app_install_params.h" #include "testing/gtest/include/gtest/gtest.h" @@ -45,7 +46,7 @@ install_options.launch_query_params = install_params.launch_query_params; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) install_options.system_app_type = install_params.system_app_type; #endif @@ -99,7 +100,7 @@ install_options.launch_query_params = "param"; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) install_options.system_app_type = ash::SystemWebAppType::SAMPLE; #endif
diff --git a/chrome/browser/web_applications/features.h b/chrome/browser/web_applications/features.h index c259147..20296b9 100644 --- a/chrome/browser/web_applications/features.h +++ b/chrome/browser/web_applications/features.h
@@ -7,13 +7,11 @@ #include "base/feature_list.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" namespace web_app { #if BUILDFLAG(IS_CHROMEOS) BASE_DECLARE_FEATURE(kUserDisplayModeSyncBrowserMitigation); - BASE_DECLARE_FEATURE(kUserDisplayModeSyncStandaloneMitigation); #endif // BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.cc b/chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.cc index 1c1112ec..cee101b 100644 --- a/chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.cc +++ b/chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" #include "base/command_line.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/web_app_utils.h" #include "components/prefs/pref_service.h" @@ -14,7 +15,7 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/components/browser_context_helper/browser_context_types.h" #endif @@ -33,12 +34,12 @@ return false; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // IWAs should be enabled for ShimlessRMA app profile. if (ash::IsShimlessRmaAppBrowserContext(browser_context)) { return true; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) if (base::FeatureList::IsEnabled(features::kIsolatedWebApps)) { return true;
diff --git a/chrome/browser/web_applications/isolated_web_apps/commands/isolated_web_app_install_command_helper_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/commands/isolated_web_app_install_command_helper_unittest.cc index 0eb1a0d7..ae099f7b 100644 --- a/chrome/browser/web_applications/isolated_web_apps/commands/isolated_web_app_install_command_helper_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/commands/isolated_web_app_install_command_helper_unittest.cc
@@ -172,11 +172,6 @@ std::unique_ptr<TestingProfile> profile_ = []() { TestingProfile::Builder builder; - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - builder.SetIsMainProfile(true); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - return builder.Build(); }(); std::unique_ptr<content::WebContents> web_contents_;
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc index ff22391..45cc72d4 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc
@@ -436,8 +436,7 @@ IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); - const GURL app_url = - url_info.origin().GetURL().Resolve("/does_not_exist.html"); + const GURL app_url = url_info.origin().GetURL().Resolve("/non-existing"); auto* app_frame = NavigateToURLInNewTab(browser(), app_url, WindowOpenDisposition::UNKNOWN); @@ -453,10 +452,10 @@ // window with error message instead of the actual IWA EXPECT_NE(content::WebExposedIsolationLevel::kIsolatedApplication, app_frame->GetWebExposedIsolationLevel()); - EXPECT_TRUE(EvalJs(app_frame, - "document.body.textContent.includes(" - "'No webpage was found for the web address')") - .ExtractBool()); + EXPECT_THAT( + EvalJs(app_frame, "document.body.innerText").ExtractString(), + HasSubstr( + "The page you requested could not be found in the application")); } // Tests that the app menu doesn't have an 'Open in Chrome' option.
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_error_page.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_error_page.cc index 1cf29ed7..ac664b7 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_error_page.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_error_page.cc
@@ -46,6 +46,9 @@ const GURL& url, net::Error error_code) { switch (error_code) { + case net::ERR_HTTP_RESPONSE_CODE_FAILURE: + return l10n_util::GetStringUTF16( + IDS_ERRORPAGES_MESSAGE_IWA_PAGE_NOT_FOUND); case net::ERR_INVALID_WEB_BUNDLE: return l10n_util::GetStringUTF16( IDS_ERRORPAGES_MESSAGE_IWA_INVALID_WEB_BUNDLE);
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h index 74f14c5..3c56023d 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h
@@ -42,11 +42,7 @@ // On ChromeOS only, the command line will be parsed whenever a new manager is // started, which occurs on `Profile` initialization. This is done this way // because the browser does not go through the "normal" startup flow on -// ChromeOS, and has different startup behaviors depending on whether or not Ash -// or Lacros is used. -// -// TODO(cmfcmf): Revisit this behavior once using Ash instead of Lacros is no -// longer possible. +// ChromeOS. class IsolatedWebAppInstallationManager { public: using MaybeInstallIsolatedWebAppCommandSuccess =
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc index b6a25f74..ce3c91a8 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc
@@ -76,7 +76,6 @@ return {.status = Result::Status::kTrusted}; } - // TODO(crbug.com/292227137): Migrate Shimless RMA app to LaCrOS. if (ash::IsShimlessRmaAppBrowserContext(&*profile_) && chromeos::Is3pDiagnosticsIwaId(web_bundle_id)) { return {.status = Result::Status::kTrusted};
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc index 84e05dd..02b927df 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker_unittest.cc
@@ -12,6 +12,7 @@ #include "base/strings/strcat.h" #include "base/test/scoped_feature_list.h" #include "base/types/cxx23_to_underlying.h" +#include "build/build_config.h" #include "chrome/browser/policy/developer_tools_policy_handler.h" #include "chrome/browser/web_applications/test/web_app_test.h" #include "chrome/common/chrome_features.h" @@ -28,15 +29,12 @@ #include "url/url_constants.h" #if BUILDFLAG(IS_CHROMEOS) +#include "ash/constants/ash_features.h" #include "base/values.h" #include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_constants.h" -#endif // BUILDFLAG(IS_CHROMEOS) - -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include "ash/constants/ash_features.h" #include "chrome/common/chromeos/extensions/chromeos_system_extension_info.h" // nogncheck #include "chromeos/ash/components/browser_context_helper/browser_context_types.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) namespace web_app { @@ -52,12 +50,12 @@ 0xb6, 0xc2, 0xd9, 0xf2, 0x02, 0x03, 0x42, 0x18, 0x10, 0x12, 0x26, 0x62, 0x88, 0xf6, 0xa3, 0xa5, 0x47, 0x14, 0x69, 0x00, 0x73}; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) constexpr std::array<uint8_t, 32> kShimless3pDiagnosticsDevPublicKeyBytes = { 0x7c, 0xf4, 0x9c, 0x48, 0x1f, 0xc5, 0x37, 0xaf, 0x33, 0x42, 0x0d, 0x3a, 0xc1, 0x13, 0x91, 0x88, 0x13, 0x53, 0x50, 0x06, 0x8b, 0x9b, 0x19, 0x42, 0xcd, 0xe8, 0xce, 0x10, 0x45, 0x12, 0xf1, 0x00}; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace @@ -245,8 +243,7 @@ } } -// TODO(b/292227137): Migrate Shimless RMA app to LaCrOS. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) class ShimlessProfileIsolatedWebAppTrustCheckerTest : public ::testing::Test { public: @@ -311,6 +308,6 @@ } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace web_app
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_apply_waiter_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_apply_waiter_unittest.cc index 550dad5d..40e8ae0e 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_apply_waiter_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_apply_waiter_unittest.cc
@@ -7,6 +7,7 @@ #include "base/functional/callback_helpers.h" #include "base/test/mock_callback.h" #include "base/test/test_future.h" +#include "build/build_config.h" #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.h" @@ -102,7 +103,7 @@ } // Other platforms do not have a `WebAppProvider` in guest sessions. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(IsolatedWebAppUpdateApplyWaiterTest, NoProfileKeepAliveWhenOffTheRecord) { // In ChromeOS guest sessions, the profile is both a guest profile and off the @@ -131,7 +132,7 @@ EXPECT_THAT(keep_alive, NotNull()); EXPECT_THAT(profile_keep_alive, IsNull()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace } // namespace web_app
diff --git a/chrome/browser/web_applications/isolated_web_apps/pending_install_info_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/pending_install_info_unittest.cc index 00e21f5..41170a5 100644 --- a/chrome/browser/web_applications/isolated_web_apps/pending_install_info_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/pending_install_info_unittest.cc
@@ -27,11 +27,6 @@ std::unique_ptr<TestingProfile> CreateTestingProfile() { TestingProfile::Builder builder; - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - builder.SetIsMainProfile(true); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - return builder.Build(); }
diff --git a/chrome/browser/web_applications/manifest_update_manager.cc b/chrome/browser/web_applications/manifest_update_manager.cc index 87f48a8..5829302 100644 --- a/chrome/browser/web_applications/manifest_update_manager.cc +++ b/chrome/browser/web_applications/manifest_update_manager.cc
@@ -18,6 +18,7 @@ #include "base/metrics/histogram_functions.h" #include "base/no_destructor.h" #include "base/run_loop.h" +#include "build/build_config.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h" #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h" @@ -41,7 +42,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/web_applications/web_app_system_web_app_delegate_map_utils.h" #endif @@ -176,7 +177,7 @@ ManifestUpdateManager::~ManifestUpdateManager() = default; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void ManifestUpdateManager::SetSystemWebAppDelegateMap( const ash::SystemWebAppDelegateMap* system_web_apps_delegate_map) { system_web_apps_delegate_map_ = system_web_apps_delegate_map; @@ -224,7 +225,7 @@ return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (system_web_apps_delegate_map_ && IsSystemWebApp(provider_->registrar_unsafe(), *system_web_apps_delegate_map_, *app_id)) {
diff --git a/chrome/browser/web_applications/manifest_update_manager.h b/chrome/browser/web_applications/manifest_update_manager.h index eab8795..2c12ec44 100644 --- a/chrome/browser/web_applications/manifest_update_manager.h +++ b/chrome/browser/web_applications/manifest_update_manager.h
@@ -18,7 +18,7 @@ #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/time/time.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h" #include "chrome/browser/web_applications/manifest_update_utils.h" #include "chrome/browser/web_applications/web_app_install_manager.h" @@ -27,7 +27,7 @@ #include "components/keep_alive_registry/scoped_keep_alive.h" #include "components/webapps/common/web_app_id.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_delegate_map.h" #endif @@ -78,7 +78,7 @@ ManifestUpdateManager(); ~ManifestUpdateManager() override; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void SetSystemWebAppDelegateMap( const ash::SystemWebAppDelegateMap* system_web_apps_delegate_map); #endif @@ -174,7 +174,7 @@ static bool& BypassWindowCloseWaitingForTesting(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) raw_ptr<const ash::SystemWebAppDelegateMap, DanglingUntriaged> system_web_apps_delegate_map_ = nullptr; #endif
diff --git a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc index f977bf8..bec08142 100644 --- a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc +++ b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc
@@ -37,7 +37,6 @@ #include "base/time/time.h" #include "build/build_config.h" #include "build/buildflag.h" -#include "build/chromeos_buildflags.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" @@ -129,7 +128,7 @@ #include "base/mac/mac_util.h" #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "chrome/browser/ash/system_web_apps/test_support/test_system_web_app_installation.h" #endif @@ -2298,7 +2297,7 @@ EXPECT_TRUE(expected_launch_handler.client_mode_valid_and_specified()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) class ManifestUpdateManagerSystemAppBrowserTest : public ManifestUpdateManagerBrowserTest { public: @@ -2323,7 +2322,7 @@ EXPECT_EQ(GetProvider().registrar_unsafe().GetAppThemeColor(app_id), SK_ColorGREEN); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class ManifestUpdateManagerIsolatedWebAppBrowserTest : public IsolatedWebAppBrowserTestHarness {
diff --git a/chrome/browser/web_applications/os_integration/os_integration_manager.cc b/chrome/browser/web_applications/os_integration/os_integration_manager.cc index 4e08578..ceb31ff 100644 --- a/chrome/browser/web_applications/os_integration/os_integration_manager.cc +++ b/chrome/browser/web_applications/os_integration/os_integration_manager.cc
@@ -31,7 +31,6 @@ #include "base/task/task_traits.h" #include "base/types/pass_key.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h" #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
diff --git a/chrome/browser/web_applications/os_integration/protocol_handling_sub_manager_unittest.cc b/chrome/browser/web_applications/os_integration/protocol_handling_sub_manager_unittest.cc index c981fb3..24557b57 100644 --- a/chrome/browser/web_applications/os_integration/protocol_handling_sub_manager_unittest.cc +++ b/chrome/browser/web_applications/os_integration/protocol_handling_sub_manager_unittest.cc
@@ -11,7 +11,6 @@ #include "base/run_loop.h" #include "base/test/test_future.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" #include "chrome/browser/web_applications/os_integration/web_app_file_handler_manager.h" @@ -221,13 +220,7 @@ } #endif // BUILDFLAG(IS_MAC) - bool AreProtocolsRegisteredWithOs() { -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - return false; -#else - return true; -#endif - } + bool AreProtocolsRegisteredWithOs() { return !BUILDFLAG(IS_CHROMEOS); } }; TEST_F(ProtocolHandlingExecuteTest, Register) {
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager.cc b/chrome/browser/web_applications/policy/web_app_policy_manager.cc index 370528946..d7950966 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager.cc +++ b/chrome/browser/web_applications/policy/web_app_policy_manager.cc
@@ -56,20 +56,17 @@ #include "url/url_constants.h" #if BUILDFLAG(IS_CHROMEOS) -#include "chrome/browser/browser_process.h" -#include "chrome/browser/policy/system_features_disable_list_policy_handler.h" -#include "chrome/browser/web_applications/web_app_utils.h" -#include "components/policy/core/common/policy_pref_names.h" -#endif // BUILDFLAG(IS_CHROMEOS) - -#if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/web_app_id_constants.h" #include "ash/edusumer/graduation_utils.h" #include "ash/webui/system_apps/public/system_web_app_type.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/policy/profile_policy_connector.h" +#include "chrome/browser/policy/system_features_disable_list_policy_handler.h" #include "chrome/browser/web_applications/web_app_system_web_app_delegate_map_utils.h" +#include "chrome/browser/web_applications/web_app_utils.h" +#include "components/policy/core/common/policy_pref_names.h" #include "components/user_manager/user_manager.h" #endif @@ -90,7 +87,7 @@ // 2. All Chrome profiles apart from incognito/guest profiles. bool AreForceInstalledAppsAllowed(Profile* profile) { bool allowed = web_app::AreWebAppsUserInstallable(profile); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) allowed = allowed || user_manager::UserManager::Get()->IsLoggedInAsGuest() || user_manager::UserManager::Get()->IsLoggedInAsManagedGuestSession(); #endif @@ -122,7 +119,7 @@ WebAppPolicyManager::~WebAppPolicyManager() = default; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void WebAppPolicyManager::SetSystemWebAppDelegateMap( const ash::SystemWebAppDelegateMap* system_web_apps_delegate_map) { system_web_apps_delegate_map_ = system_web_apps_delegate_map; @@ -247,12 +244,12 @@ } } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) const std::set<ash::SystemWebAppType>& WebAppPolicyManager::GetDisabledSystemWebApps() const { return disabled_system_apps_; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) const std::set<webapps::AppId>& WebAppPolicyManager::GetDisabledWebAppsIds() const { @@ -776,7 +773,6 @@ policy::policy_prefs::kSystemFeaturesDisableMode, base::BindRepeating(&WebAppPolicyManager::OnDisableModePolicyChanged, base::Unretained(this))); -#if BUILDFLAG(IS_CHROMEOS_ASH) if (ash::features::IsGraduationEnabled()) { pref_change_registrar_.Add( ash::prefs::kGraduationEnablementStatus, @@ -787,7 +783,6 @@ ash::prefs::kClassManagementToolsAvailabilitySetting, base::BindRepeating(&WebAppPolicyManager::OnDisableModePolicyChanged, weak_ptr_factory_.GetWeakPtr())); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) // Make sure we get the right disabled mode in case it was changed before // policy registration. OnDisableModePolicyChanged(); @@ -803,16 +798,14 @@ void WebAppPolicyManager::PopulateDisabledWebAppsIdsLists() { disabled_web_apps_.clear(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) disabled_system_apps_.clear(); if (ash::features::IsGraduationEnabled() && !ash::graduation::IsEligibleForGraduation(pref_service_)) { disabled_system_apps_.insert(ash::SystemWebAppType::GRADUATION); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(IS_CHROMEOS) PrefService* const local_state = g_browser_process->local_state(); if (!local_state) // Sometimes it's not available in tests. return; @@ -825,7 +818,6 @@ case policy::SystemFeature::kCanvas: disabled_web_apps_.insert(ash::kCanvasAppId); break; -#if BUILDFLAG(IS_CHROMEOS_ASH) case policy::SystemFeature::kCamera: disabled_system_apps_.insert(ash::SystemWebAppType::CAMERA); break; @@ -887,27 +879,6 @@ case policy::SystemFeature::kGoogleMaps: disabled_web_apps_.insert(ash::kGoogleMapsAppId); break; -#else - case policy::SystemFeature::kCamera: - case policy::SystemFeature::kOsSettings: - case policy::SystemFeature::kScanning: - case policy::SystemFeature::kExplore: - case policy::SystemFeature::kCrosh: - case policy::SystemFeature::kTerminal: - case policy::SystemFeature::kGallery: - case policy::SystemFeature::kPrintJobs: - case policy::SystemFeature::kKeyShortcuts: - case policy::SystemFeature::kRecorder: - case policy::SystemFeature::kGmail: - case policy::SystemFeature::kGoogleDocs: - case policy::SystemFeature::kGoogleSlides: - case policy::SystemFeature::kGoogleSheets: - case policy::SystemFeature::kGoogleDrive: - case policy::SystemFeature::kGoogleKeep: - case policy::SystemFeature::kGoogleCalendar: - case policy::SystemFeature::kGoogleChat: - break; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) case policy::SystemFeature::kUnknownSystemFeature: case policy::SystemFeature::kBrowserSettings: case policy::SystemFeature::kWebStore: @@ -916,7 +887,6 @@ } } -#if BUILDFLAG(IS_CHROMEOS_ASH) DCHECK(system_web_apps_delegate_map_); for (const ash::SystemWebAppType& app_type : disabled_system_apps_) { std::optional<webapps::AppId> app_id = @@ -926,7 +896,6 @@ disabled_web_apps_.insert(app_id.value()); } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS) }
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager.h b/chrome/browser/web_applications/policy/web_app_policy_manager.h index f25d0df..65e1279 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager.h +++ b/chrome/browser/web_applications/policy/web_app_policy_manager.h
@@ -14,17 +14,17 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.h" #include "components/prefs/pref_change_registrar.h" #include "content/public/browser/render_frame_host.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/policy/system_features_disable_list_policy_handler.h" #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_delegate_map.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class PrefService; class Profile; @@ -61,7 +61,7 @@ provider_ = &provider; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void SetSystemWebAppDelegateMap( const ash::SystemWebAppDelegateMap* system_web_apps_delegate_map); #endif @@ -83,10 +83,10 @@ // disabled and notifies sync_bridge_ about the current app state. void OnDisableListPolicyChanged(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Gets system web apps disabled by SystemFeaturesDisableList policy. const std::set<ash::SystemWebAppType>& GetDisabledSystemWebApps() const; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // Gets ids of web apps disabled by SystemFeaturesDisableList policy. const std::set<webapps::AppId>& GetDisabledWebAppsIds() const; @@ -184,17 +184,17 @@ raw_ptr<PrefService> pref_service_ = nullptr; raw_ptr<WebAppProvider> provider_ = nullptr; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) raw_ptr<const ash::SystemWebAppDelegateMap, DanglingUntriaged> system_web_apps_delegate_map_ = nullptr; #endif PrefChangeRegistrar pref_change_registrar_; PrefChangeRegistrar local_state_pref_change_registrar_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // List of disabled system web apps, containing app types. std::set<ash::SystemWebAppType> disabled_system_apps_; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // List of disabled system and progressive web apps, containing app ids. std::set<webapps::AppId> disabled_web_apps_;
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager_browsertest.cc b/chrome/browser/web_applications/policy/web_app_policy_manager_browsertest.cc index 7bd378a..f6751ca 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager_browsertest.cc +++ b/chrome/browser/web_applications/policy/web_app_policy_manager_browsertest.cc
@@ -39,7 +39,7 @@ #include "third_party/blink/public/common/manifest/manifest.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" #include "chrome/test/base/testing_profile.h" #include "components/user_manager/user_names.h" @@ -267,7 +267,7 @@ EXPECT_EQ(GURL(kDefaultCustomIconUrl), manifest->icons[0].src); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Scenario: A policy installed web app is replacing an existing app causing it // to be uninstalled after the policy app is installed. @@ -293,7 +293,7 @@ uninstall_observer.Wait(); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class WebAppPolicyManagerGuestModeTest : public InProcessBrowserTest { public: @@ -305,7 +305,7 @@ protected: void SetUpCommandLine(base::CommandLine* command_line) override { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) command_line->AppendSwitch(ash::switches::kGuestSession); command_line->AppendSwitchASCII(ash::switches::kLoginUser, user_manager::kGuestUserName); @@ -319,10 +319,6 @@ IN_PROC_BROWSER_TEST_F(WebAppPolicyManagerGuestModeTest, DoNotCreateAppsOnGuestMode) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - test::ScopedSkipMainProfileCheck skip_main_profile_check; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - base::Value::List app_list; app_list.Append(GetForceInstalledAppItem()); @@ -342,7 +338,7 @@ EXPECT_EQ(proto::InstallState::INSTALLED_WITH_OS_INTEGRATION, test_provider->registrar_unsafe().GetInstallState(app_id)); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) Profile* guest_profile = CreateGuestBrowser()->profile(); EXPECT_FALSE(WebAppProvider::GetForTest(guest_profile)); #endif
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc b/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc index f9fcfde..975bd563 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc +++ b/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc
@@ -25,7 +25,6 @@ #include "base/test/test_future.h" #include "base/values.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/external_install_options.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" @@ -61,7 +60,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" @@ -69,13 +68,10 @@ #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/system_web_apps/test_support/test_system_web_app_manager.h" -#include "components/user_manager/scoped_user_manager.h" -#include "components/user_manager/user_names.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - -#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/policy/system_features_disable_list_policy_handler.h" #include "components/policy/core/common/policy_pref_names.h" +#include "components/user_manager/scoped_user_manager.h" +#include "components/user_manager/user_names.h" #endif // BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_WIN) @@ -355,8 +351,7 @@ ~WebAppPolicyManagerTestBase() override = default; void SetUp() override { -#if BUILDFLAG(IS_CHROMEOS_ASH) - // Set up user manager to so that Lacros mode can be enabled. +#if BUILDFLAG(IS_CHROMEOS) // Need to run the ChromeRenderViewHostTestHarness::SetUp() after the fake // user manager set up so that the scoped_user_manager can be destructed in // the correct order. @@ -378,7 +373,7 @@ auto fake_externally_managed_app_manager = std::make_unique<FakeExternallyManagedAppManager>(profile()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) test_system_app_manager_ = std::make_unique<ash::TestSystemWebAppManager>(profile()); #endif @@ -429,7 +424,7 @@ return webapps::UninstallResultCode::kAppRemoved; })); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) web_app_policy_manager_->SetSystemWebAppDelegateMap( &system_app_manager().system_app_delegates()); #endif @@ -439,7 +434,7 @@ void TearDown() override { provider_->Shutdown(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) test_system_app_manager_.reset(); #endif ChromeRenderViewHostTestHarness::TearDown(); @@ -469,7 +464,7 @@ web_app::test::InstallWebApp(profile(), std::move(web_app_info)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ash::TestSystemWebAppManager& system_app_manager() { return *test_system_app_manager_; } @@ -541,7 +536,7 @@ base::ScopedPathOverride override_start_dir_{base::DIR_START_MENU}; #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) std::unique_ptr<ash::TestSystemWebAppManager> test_system_app_manager_; std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; #endif @@ -1187,7 +1182,7 @@ EXPECT_EQ(0u, install_requests.size()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) TEST_F(WebAppPolicyManagerTest, DisableSystemWebApps) { auto disabled_apps = policy_manager().GetDisabledSystemWebApps(); EXPECT_TRUE(disabled_apps.empty()); @@ -1233,7 +1228,7 @@ base::RunLoop().RunUntilIdle(); EXPECT_TRUE(policy_manager().IsDisabledAppsModeHidden()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) TEST_F(WebAppPolicyManagerTest, WebAppSettingsDynamicRefresh) { const char kWebAppSettingInitialConfiguration[] = R"([ @@ -1367,7 +1362,7 @@ app_registrar().RemoveObserver(&mock_observer); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) class WebAppPolicyManagerWithGraduationTest : public WebAppPolicyManagerTestBase { public: @@ -1444,7 +1439,7 @@ app_registrar().RemoveObserver(&mock_observer); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) class WebAppPolicyManagerPreventCloseTest : public WebAppPolicyManagerTestBase,
diff --git a/chrome/browser/web_applications/preinstalled_web_app_config_utils.cc b/chrome/browser/web_applications/preinstalled_web_app_config_utils.cc index 74aa1f6..7dc7b13 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_config_utils.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_config_utils.cc
@@ -11,13 +11,14 @@ #include "base/logging.h" #include "base/no_destructor.h" #include "base/path_service.h" +#include "build/build_config.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" #include "chrome/browser/ash/profiles/profile_helper.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) namespace web_app { @@ -30,12 +31,12 @@ return *g_config_dir_for_testing.get(); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // The sub-directory of the extensions directory in which to scan for external // web apps (as opposed to external extensions or external ARC apps). const base::FilePath::CharType kWebAppsSubDirectory[] = FILE_PATH_LITERAL("web_apps"); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace @@ -60,7 +61,7 @@ if (!command_line_directory.empty()) return base::FilePath::FromUTF8Unsafe(command_line_directory); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // As of mid 2018, only Chrome OS has default/external web apps, and // chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS is only defined for OS_LINUX, // which includes OS_CHROMEOS. @@ -85,14 +86,14 @@ } LOG(ERROR) << "base::PathService::Get failed"; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) return {}; } base::FilePath GetPreinstalledWebAppExtraConfigDirFromCommandLine( Profile* profile) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) base::FilePath config_dir = GetPreinstalledWebAppConfigDirFromCommandLine(profile); std::string extra_config_subdir = @@ -103,7 +104,7 @@ return config_dir.AppendASCII(extra_config_subdir); #else return base::FilePath(); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } base::FilePath GetPreinstalledWebAppConfigDir(Profile* profile) {
diff --git a/chrome/browser/web_applications/preinstalled_web_app_config_utils.h b/chrome/browser/web_applications/preinstalled_web_app_config_utils.h index 93c51f3..b883c09 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_config_utils.h +++ b/chrome/browser/web_applications/preinstalled_web_app_config_utils.h
@@ -9,7 +9,6 @@ #include "base/auto_reset.h" #include "base/files/file_path.h" -#include "build/chromeos_buildflags.h" class Profile; @@ -24,7 +23,6 @@ } // namespace test -#if !BUILDFLAG(IS_CHROMEOS_LACROS) // The directory where default web app configs are stored. // Empty if not applicable. base::FilePath GetPreinstalledWebAppConfigDirFromCommandLine(Profile* profile); @@ -34,7 +32,6 @@ // devices. Empty if not applicable. base::FilePath GetPreinstalledWebAppExtraConfigDirFromCommandLine( Profile* profile); -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) // The directory where default web app configs are stored. // Empty if not applicable.
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.cc b/chrome/browser/web_applications/preinstalled_web_app_manager.cc index bc62a18..0e20e45 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.cc
@@ -33,7 +33,6 @@ #include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/callback_utils.h" #include "chrome/browser/web_applications/web_app_management_type.h" #include "chrome/browser/web_applications/web_app_provider.h"
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager_browsertest.cc b/chrome/browser/web_applications/preinstalled_web_app_manager_browsertest.cc index 3392c1c..dcf8154 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager_browsertest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager_browsertest.cc
@@ -22,7 +22,6 @@ #include "base/test/test_future.h" #include "base/time/time.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/intent_helper/preferred_apps_test_util.h" @@ -68,20 +67,11 @@ #include "ui/events/devices/touchscreen_device.h" #if BUILDFLAG(IS_CHROMEOS) -#include "chromeos/constants/chromeos_features.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/public/cpp/test/app_list_test_api.h" #include "chrome/browser/ash/app_list/app_list_client_impl.h" #include "chrome/browser/ash/app_list/app_list_syncable_service.h" #include "chrome/browser/ash/app_list/app_list_syncable_service_factory.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chrome/browser/web_applications/app_service/test/loopback_crosapi_app_service_proxy.h" -#include "chromeos/crosapi/mojom/crosapi.mojom.h" -#include "chromeos/startup/browser_init_params.h" +#include "chromeos/constants/chromeos_features.h" #endif namespace web_app { @@ -513,7 +503,6 @@ base::AutoReset<bool> enable_chrome_apps_; }; -#if !BUILDFLAG(IS_CHROMEOS_LACROS) IN_PROC_BROWSER_TEST_F(PreinstalledWebAppManagerExtensionBrowserTest, UninstallAndReplace) { base::AutoReset<bool> bypass_offline_manifest_requirement = @@ -551,8 +540,6 @@ EXPECT_EQ(app, uninstalled_app.get()); } -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) - IN_PROC_BROWSER_TEST_F(PreinstalledWebAppManagerBrowserTest, PreinstalledAppsPrefInstall) { base::AutoReset<bool> bypass_offline_manifest_requirement = @@ -1212,7 +1199,7 @@ std::nullopt); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) IN_PROC_BROWSER_TEST_F(PreinstalledWebAppManagerBrowserTest, OemInstalled) { base::AutoReset<bool> bypass_offline_manifest_requirement = PreinstalledWebAppManager::BypassOfflineManifestRequirementForTesting(); @@ -1244,9 +1231,8 @@ EXPECT_EQ(install_reason, apps::InstallReason::kOem); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) -#if !BUILDFLAG(IS_CHROMEOS_LACROS) namespace { ui::TouchscreenDevice CreateTouchDevice(ui::InputDeviceType type, bool stylus_support) { @@ -1256,7 +1242,6 @@ return touch_device; } } // namespace -#endif IN_PROC_BROWSER_TEST_F( PreinstalledWebAppManagerBrowserTest, @@ -1265,16 +1250,9 @@ PreinstalledWebAppManager::BypassOfflineManifestRequirementForTesting(); ASSERT_TRUE(embedded_test_server()->Start()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - auto init_params = crosapi::mojom::BrowserInitParams::New(); - init_params->device_properties = crosapi::mojom::DeviceProperties::New(); - init_params->device_properties->has_stylus_enabled_touchscreen = false; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#else ui::DeviceDataManagerTestApi().SetTouchscreenDevices( {CreateTouchDevice(ui::InputDeviceType::INPUT_DEVICE_INTERNAL, /*stylus_support=*/false)}); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) const auto manifest = base::ReplaceStringPlaceholders( R"({ @@ -1304,16 +1282,9 @@ PreinstalledWebAppManager::BypassOfflineManifestRequirementForTesting(); ASSERT_TRUE(embedded_test_server()->Start()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - auto init_params = crosapi::mojom::BrowserInitParams::New(); - init_params->device_properties = crosapi::mojom::DeviceProperties::New(); - init_params->device_properties->has_stylus_enabled_touchscreen = true; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#else ui::DeviceDataManagerTestApi().SetTouchscreenDevices( {CreateTouchDevice(ui::InputDeviceType::INPUT_DEVICE_INTERNAL, /*stylus_support=*/true)}); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) const auto manifest = base::ReplaceStringPlaceholders( R"({ @@ -1340,13 +1311,6 @@ PreinstalledWebAppManager::BypassOfflineManifestRequirementForTesting(); ASSERT_TRUE(embedded_test_server()->Start()); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - auto init_params = crosapi::mojom::BrowserInitParams::New(); - init_params->device_properties = crosapi::mojom::DeviceProperties::New(); - init_params->device_properties->has_stylus_enabled_touchscreen = true; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - const auto manifest = base::ReplaceStringPlaceholders( R"({ "app_url": "$1", @@ -1363,14 +1327,10 @@ ui::DeviceDataManager::GetInstance()->ResetDeviceListsForTest(); base::SequencedTaskRunner::GetCurrentDefault()->PostDelayedTask( FROM_HERE, base::BindLambdaForTesting([]() { -#if !BUILDFLAG(IS_CHROMEOS_LACROS) // Create a built-in touchscreen device with stylus support - // and add it to the device. Lacros does not use DeviceDataManager to - // determine whether stylus is supported, but still needs device lists - // to be complete before continuing. + // and add it to the device. ui::DeviceDataManagerTestApi().SetTouchscreenDevices({CreateTouchDevice( ui::InputDeviceType::INPUT_DEVICE_INTERNAL, true)}); -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) ui::DeviceDataManagerTestApi().OnDeviceListsComplete(); }), base::Milliseconds(500)); @@ -1379,7 +1339,7 @@ webapps::InstallResultCode::kSuccessNewInstall); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Disabled due to test flakiness. https://crbug.com/1267164. IN_PROC_BROWSER_TEST_F(PreinstalledWebAppManagerBrowserTest, DISABLED_UninstallFromTwoItemAppListFolder) { @@ -1446,7 +1406,7 @@ ""); EXPECT_EQ(app_list_syncable_service->GetSyncItem(user_app_id)->parent_id, ""); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // Check that offline only installs don't overwrite fresh online manifest // obtained via sync install. @@ -1512,22 +1472,14 @@ : public PreinstalledWebAppManagerBrowserTest { public: PreinstalledWebAppManagerWithCloudGamingBrowserTest() { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - auto params = crosapi::mojom::BrowserInitParams::New(); - params->is_cloud_gaming_device = true; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(params)); -#else scoped_feature_list_.InitAndEnableFeature( chromeos::features::kCloudGamingDevice); -#endif } private: base::test::ScopedFeatureList scoped_feature_list_; }; -// Tests that the custom behavior for the "CloudGamingDevice" feature works on -// both Ash and Lacros. IN_PROC_BROWSER_TEST_F(PreinstalledWebAppManagerWithCloudGamingBrowserTest, GateOnCloudGamingFeature) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -1558,13 +1510,7 @@ bool IsPreferredAppForSupportedLinks() const { return GetParam(); } void RemoveSupportedLinksPreference(const webapps::AppId& app_id) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // NOTE: CrosAPI doesn't implement `RemoveSupportedLinksPreference()`. - loopback_crosapi_->RemoveSupportedLinksPreference(app_id); - WaitForSupportedLinksPreference(app_id, /*is_preferred_app=*/false); -#else // BUILDFLAG(IS_CHROMEOS_LACROS) apps_util::RemoveSupportedLinksPreferenceAndWait(profile(), app_id); -#endif } void WaitForSupportedLinksPreference(const webapps::AppId& app_id, @@ -1575,23 +1521,6 @@ app_id, is_preferred_app) .Wait(); } - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - private: - // PreinstalledWebAppManagerBrowserTest: - void SetUpOnMainThread() override { - PreinstalledWebAppManagerBrowserTest::SetUpOnMainThread(); - loopback_crosapi_ = - std::make_unique<LoopbackCrosapiAppServiceProxy>(profile()); - } - - void TearDownOnMainThread() override { - PreinstalledWebAppManagerBrowserTest::TearDownOnMainThread(); - loopback_crosapi_.reset(); - } - - std::unique_ptr<LoopbackCrosapiAppServiceProxy> loopback_crosapi_; -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) }; INSTANTIATE_TEST_SUITE_P(
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager_unittest.cc b/chrome/browser/web_applications/preinstalled_web_app_manager_unittest.cc index 9a3086c..fc4bb8c 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager_unittest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager_unittest.cc
@@ -22,7 +22,6 @@ #include "base/test/scoped_feature_list.h" #include "base/test/scoped_path_override.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/extensions/extension_management_test_util.h" #include "chrome/browser/profiles/profile_test_util.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" @@ -44,13 +43,10 @@ #include "url/gurl.h" #if BUILDFLAG(IS_CHROMEOS) -#include "chrome/browser/policy/profile_policy_connector.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" +#include "chrome/browser/policy/profile_policy_connector.h" #include "chromeos/ash/components/system/fake_statistics_provider.h" #include "chromeos/ash/components/system/statistics_provider.h" #include "components/user_manager/scoped_user_manager.h" @@ -86,7 +82,7 @@ // testing::Test: void SetUp() override { testing::Test::SetUp(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( std::make_unique<ash::FakeChromeUserManager>()); // Mocking the StatisticsProvider for testing. @@ -101,7 +97,7 @@ // pointer. provider_ = nullptr; profile_.reset(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ash::system::StatisticsProvider::SetTestProvider(nullptr); user_manager_enabler_.reset(); #endif @@ -175,12 +171,10 @@ // This makes profile appears as a primary profile in ChromeOS. std::unique_ptr<TestingProfile> CreateProfileAndLogin() { std::unique_ptr<TestingProfile> profile = CreateProfile(); -#if BUILDFLAG(IS_CHROMEOS_ASH) const AccountId account_id(AccountId::FromUserEmailGaiaId( profile->GetProfileUserName(), GaiaId("1234567890"))); user_manager()->AddUser(account_id); user_manager()->LoginUser(account_id); -#endif return profile; } @@ -188,19 +182,15 @@ // manager. This makes profile appears as a primary profile in ChromeOS. std::unique_ptr<TestingProfile> CreateGuestProfileAndLogin() { std::unique_ptr<TestingProfile> profile = CreateGuestProfile(); -#if BUILDFLAG(IS_CHROMEOS_ASH) user_manager()->AddGuestUser(); user_manager()->LoginUser(user_manager::GuestAccountId()); -#endif return profile; } void SetExtraWebAppsDir(std::string_view test_dir, std::string_view extra_web_apps_dir) { -#if BUILDFLAG(IS_CHROMEOS_ASH) command_line_.GetProcessCommandLine()->AppendSwitchASCII( ash::switches::kExtraWebAppsDir, extra_web_apps_dir); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) } void VerifySetOfApps(const std::set<GURL>& expectations) { @@ -237,7 +227,7 @@ return config_dir.AppendASCII("web_app_default_apps").AppendASCII(test_dir); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) ash::FakeChromeUserManager* user_manager() { return static_cast<ash::FakeChromeUserManager*>( user_manager::UserManager::Get()); @@ -528,15 +518,10 @@ } TEST_F(PreinstalledWebAppManagerTest, GuestUser) { -#if BUILDFLAG(IS_CHROMEOS_ASH) // App service is available for OTR profile in Guest mode. set_profile(CreateGuestProfileAndLogin()); UseOtrProfile(); VerifySetOfApps({GURL(kAppAllUrl), GURL(kAppGuestUrl)}); -#else - set_profile(CreateGuestProfileAndLogin()); - VerifySetOfApps({GURL(kAppAllUrl), GURL(kAppGuestUrl)}); -#endif } TEST_F(PreinstalledWebAppManagerTest, UnmanagedUser) { @@ -567,12 +552,10 @@ VerifySetOfApps({GURL(kAppAllUrl), GURL(kAppChildUrl)}); } -#if BUILDFLAG(IS_CHROMEOS_ASH) TEST_F(PreinstalledWebAppManagerTest, NonPrimaryProfile) { set_profile(CreateProfile()); VerifySetOfApps({GURL(kAppAllUrl), GURL(kAppUnmanagedUrl)}); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) TEST_F(PreinstalledWebAppManagerTest, ExtraWebApps) { set_profile(CreateProfileAndLogin()); @@ -619,7 +602,6 @@ .size(), 0u); } - -#endif // #if BUILDFLAG(IS_CHROMEOS) +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace web_app
diff --git a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc index b09e1fb0..cd576170 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc
@@ -19,7 +19,7 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/test_future.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/app_registry_cache_waiter.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" @@ -62,7 +62,7 @@ #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/public/cpp/app_list/app_list_types.h" #include "chrome/browser/ash/app_list/app_list_model_updater.h" #include "chrome/browser/ash/app_list/app_list_syncable_service.h" @@ -71,17 +71,6 @@ #include "chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.h" #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chrome/browser/web_applications/commands/web_app_command.h" -#include "chrome/browser/web_applications/jobs/uninstall/web_app_uninstall_and_replace_job.h" -#include "chrome/browser/web_applications/locks/app_lock.h" -#include "chrome/browser/web_applications/web_app_command_scheduler.h" -#include "chromeos/crosapi/mojom/app_service.mojom.h" -#include "chromeos/crosapi/mojom/test_controller.mojom.h" -#include "chromeos/crosapi/mojom/web_app_service.mojom.h" -#include "chromeos/lacros/lacros_service.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - namespace { constexpr char kMigrationFlag[] = "MigrationTest"; @@ -144,7 +133,6 @@ } void TearDownOnMainThread() override { - // We uninstall all web apps, as Ash is not restarted between Lacros tests. auto* const provider = WebAppProvider::GetForTest(profile()); const WebAppRegistrar& registrar = provider->registrar_unsafe(); std::vector<webapps::AppId> app_ids = registrar.GetAppIds(); @@ -312,7 +300,7 @@ IN_PROC_BROWSER_TEST_F(PreinstalledWebAppMigrationBrowserTest, MigrateRevertMigrate) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Grab handles to the app list to update shelf/list state for apps later on. app_list::AppListSyncableService* app_list_syncable_service = app_list::AppListSyncableServiceFactory::GetForProfile(profile()); @@ -332,7 +320,7 @@ EXPECT_FALSE(IsWebAppInstalled()); EXPECT_TRUE(IsExtensionAppInstalled()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) app_list_model_updater->SetItemPosition( kExtensionId, syncer::StringOrdinal("testapplistposition")); app_list_syncable_service->SetPinPosition( @@ -373,7 +361,7 @@ histograms.ExpectUniqueSample( PreinstalledWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Chrome OS shelf/list position should migrate. EXPECT_EQ( app_list_syncable_service->GetSyncItem(GetWebAppId())->ToString(), @@ -428,7 +416,7 @@ histograms.ExpectUniqueSample( PreinstalledWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Chrome OS shelf/list position should re-migrate. EXPECT_EQ(app_list_syncable_service->GetSyncItem(GetWebAppId())->ToString(), base::StringPrintf("%s { Basic web app } [testapplistposition] " @@ -444,7 +432,7 @@ IN_PROC_BROWSER_TEST_F(PreinstalledWebAppMigrationBrowserTest, MigratePreferences) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) app_list::AppListSyncableService* app_list_syncable_service = app_list::AppListSyncableServiceFactory::GetForProfile(profile()); AppListModelUpdater* app_list_model_updater = @@ -465,7 +453,7 @@ EXPECT_FALSE(IsWebAppInstalled()); EXPECT_TRUE(IsExtensionAppInstalled()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) app_list_model_updater->SetItemPosition( kExtensionId, syncer::StringOrdinal("testapplistposition")); app_list_syncable_service->SetPinPosition( @@ -521,7 +509,7 @@ { const webapps::AppId web_app_id = GetWebAppId(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Chrome OS shelf/list position should migrate. EXPECT_EQ(app_list_syncable_service->GetSyncItem(GetWebAppId())->ToString(), base::StringPrintf("%s { Basic web app } [testapplistposition] " @@ -638,8 +626,6 @@ } } -#if !BUILDFLAG(IS_CHROMEOS_LACROS) -// TODO(crbug.com/40204047): Make this work under Lacros. // Check histogram counts when an app to replace gets installed after the // preinstalled web app is installed. IN_PROC_BROWSER_TEST_F(PreinstalledWebAppMigrationBrowserTest, @@ -689,7 +675,7 @@ 0, 1); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Pin both apps to the shelf. PinAppWithIDToShelf(GetWebAppId()); PinAppWithIDToShelf(kExtensionId); @@ -705,9 +691,8 @@ kHistogramAppToReplaceStillInstalledInShelfCount, 1, 1); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS) // Tests the migration from an extension-app to a preinstalled web app provided // by the preinstalled apps (rather than an external config). @@ -793,123 +778,4 @@ } } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -class TestUninstallAndReplaceJobCommand - : public WebAppCommand<AppLock, bool /*uninstall_triggered*/> { - public: - TestUninstallAndReplaceJobCommand( - Profile* profile, - const std::vector<webapps::AppId>& from_apps, - const webapps::AppId& to_app, - base::OnceCallback<void(bool uninstall_triggered)> on_complete) - : WebAppCommand<AppLock, bool>("TestUninstallAndReplaceJobCommand", - AppLockDescription(to_app), - std::move(on_complete), - /*args_for_shutdown=*/false), - profile_(profile), - from_apps_(from_apps), - to_app_(to_app) {} - - ~TestUninstallAndReplaceJobCommand() override = default; - - void StartWithLock(std::unique_ptr<AppLock> lock) override { - lock_ = std::move(lock); - uninstall_and_replace_job_.emplace( - profile_, GetMutableDebugValue(), *lock_, from_apps_, to_app_, - base::BindOnce(&TestUninstallAndReplaceJobCommand::OnComplete, - base::Unretained(this))); - uninstall_and_replace_job_->Start(); - } - - void OnComplete(bool uninstall_triggered) { - CompleteAndSelfDestruct(CommandResult::kSuccess, uninstall_triggered); - } - - private: - raw_ptr<Profile> profile_ = nullptr; - std::unique_ptr<AppLock> lock_; - - const std::vector<webapps::AppId> from_apps_; - const webapps::AppId to_app_; - - std::optional<WebAppUninstallAndReplaceJob> uninstall_and_replace_job_; -}; - -IN_PROC_BROWSER_TEST_F(PreinstalledWebAppMigrationBrowserTest, - TransferAppAttributes) { - // If ash does not contain the relevant test controller functionality, then - // there's nothing to do for this test. - auto* lacros_service = chromeos::LacrosService::Get(); - if (lacros_service->GetInterfaceVersion<crosapi::mojom::TestController>() < - static_cast<int>(crosapi::mojom::TestController::MethodMinVersions:: - kSetAppListItemAttributesMinVersion)) { - LOG(WARNING) << "Unsupported ash version."; - return; - } - - auto& test_controller = - lacros_service->GetRemote<crosapi::mojom::TestController>(); - - webapps::AppId old_app_id; - { - auto info = WebAppInstallInfo::CreateWithStartUrlForTesting( - embedded_test_server()->GetURL("/webapps/migration/old/")); - info->scope = info->start_url(); - info->title = u"Old app"; - old_app_id = web_app::test::InstallWebApp(profile(), std::move(info)); - apps::AppReadinessWaiter(profile(), old_app_id).Await(); - - auto attributes = crosapi::mojom::AppListItemAttributes::New(); - attributes->item_position = "testapplistposition"; - attributes->pin_position = "testpinposition"; - - base::test::TestFuture<void> future; - test_controller->SetAppListItemAttributes(old_app_id, std::move(attributes), - future.GetCallback()); - ASSERT_TRUE(future.Wait()); - } - - webapps::AppId new_app_id; - { - auto info = WebAppInstallInfo::CreateWithStartUrlForTesting( - embedded_test_server()->GetURL("/webapps/migration/new/")); - info->scope = info->start_url(); - info->title = u"New app"; - - WebAppInstallParams install_params; - base::test::TestFuture<const webapps::AppId&, webapps::InstallResultCode> - future; - WebAppProvider::GetForTest(profile()) - ->scheduler() - .InstallFromInfoWithParams( - std::move(info), - /*overwrite_existing_manifest_fields=*/false, - webapps::WebappInstallSource::OMNIBOX_INSTALL_ICON, - future.GetCallback(), install_params); - - EXPECT_EQ(future.Get<webapps::InstallResultCode>(), - webapps::InstallResultCode::kSuccessNewInstall); - new_app_id = future.Get<webapps::AppId>(); - apps::AppReadinessWaiter(profile(), new_app_id).Await(); - } - { - base::test::TestFuture<bool> future; - WebAppProvider::GetForTest(profile())->command_manager().ScheduleCommand( - std::make_unique<TestUninstallAndReplaceJobCommand>( - profile(), std::vector<webapps::AppId>{old_app_id}, new_app_id, - future.GetCallback())); - ASSERT_TRUE(future.Wait()); - EXPECT_TRUE(future.Get<bool /*did_uninstall_and_replace*/>()); - } - - base::test::TestFuture<crosapi::mojom::AppListItemAttributesPtr> - attributes_future; - test_controller->GetAppListItemAttributes(new_app_id, - attributes_future.GetCallback()); - auto attributes = attributes_future.Take(); - EXPECT_EQ(attributes->item_position, "testapplistposition"); - EXPECT_EQ(attributes->pin_position, "testpinposition"); -} -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - } // namespace web_app
diff --git a/chrome/browser/web_applications/preinstalled_web_app_utils_unittest.cc b/chrome/browser/web_applications/preinstalled_web_app_utils_unittest.cc index c34425d5..96e013e 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_utils_unittest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_utils_unittest.cc
@@ -10,23 +10,17 @@ #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/test/test_file_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/events/devices/device_data_manager.h" #include "ui/events/devices/device_data_manager_test_api.h" #include "ui/events/devices/touchscreen_device.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "chromeos/ash/experiences/arc/arc_util.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/mojom/crosapi.mojom.h" -#include "chromeos/startup/browser_init_params.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS) namespace web_app { @@ -120,7 +114,7 @@ public: PreinstalledWebAppUtilsTabletTest() { if (GetParam()) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) base::CommandLine::ForCurrentProcess()->AppendSwitch( ash::switches::kEnableTabletFormFactor); #else @@ -129,7 +123,7 @@ init_params->device_properties->is_tablet_form_factor = true; chromeos::BrowserInitParams::SetInitParamsForTests( std::move(init_params)); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } } ~PreinstalledWebAppUtilsTabletTest() override = default; @@ -170,7 +164,7 @@ public: PreinstalledWebAppUtilsArcTest() { if (GetParam()) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( ash::switches::kArcAvailability, "officially-supported"); #else @@ -179,7 +173,7 @@ init_params->device_properties->is_arc_available = true; chromeos::BrowserInitParams::SetInitParamsForTests( std::move(init_params)); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } } ~PreinstalledWebAppUtilsArcTest() override = default;
diff --git a/chrome/browser/web_applications/preinstalled_web_apps/google_docs.cc b/chrome/browser/web_applications/preinstalled_web_apps/google_docs.cc index 5a8e352..dae8562 100644 --- a/chrome/browser/web_applications/preinstalled_web_apps/google_docs.cc +++ b/chrome/browser/web_applications/preinstalled_web_apps/google_docs.cc
@@ -11,7 +11,7 @@ #include "ash/constants/web_app_id_constants.h" #include "base/functional/bind.h" #include "base/strings/utf_string_conversions.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h" #include "chrome/browser/web_applications/preinstalled_web_apps/preinstalled_web_app_definition_utils.h" #include "chrome/browser/web_applications/web_app_constants.h" @@ -22,14 +22,10 @@ #include "third_party/blink/public/mojom/manifest/display_mode.mojom-shared.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/startup/browser_params_proxy.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "chrome/browser/ash/drive/file_system_util.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) namespace web_app { namespace { @@ -116,11 +112,7 @@ #if BUILDFLAG(IS_CHROMEOS) bool IsDriveFsBulkPinningAvailable() { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - return chromeos::BrowserParamsProxy::Get()->IsDriveFsBulkPinningAvailable(); -#elif BUILDFLAG(IS_CHROMEOS_ASH) return drive::util::IsDriveFsBulkPinningAvailable(); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) } #endif // BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/web_applications/preinstalled_web_apps_browsertest.cc b/chrome/browser/web_applications/preinstalled_web_apps_browsertest.cc index 7686d78..8b51f73 100644 --- a/chrome/browser/web_applications/preinstalled_web_apps_browsertest.cc +++ b/chrome/browser/web_applications/preinstalled_web_apps_browsertest.cc
@@ -9,7 +9,6 @@ #include "base/test/bind.h" #include "build/branding_buildflags.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/web_applications/web_app_browsertest_base.h" #include "chrome/browser/web_applications/preinstalled_app_install_features.h" @@ -22,10 +21,10 @@ #include "chrome/test/base/in_process_browser_test.h" #include "content/public/test/browser_test.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser_commands.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) namespace web_app {
diff --git a/chrome/browser/web_applications/test/profile_test_helper.cc b/chrome/browser/web_applications/test/profile_test_helper.cc index 6fdd684..d2ab728 100644 --- a/chrome/browser/web_applications/test/profile_test_helper.cc +++ b/chrome/browser/web_applications/test/profile_test_helper.cc
@@ -7,8 +7,9 @@ #include <vector> #include "base/notreached.h" +#include "build/build_config.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" #include "components/account_id/account_id.h" #include "components/user_manager/user_names.h" @@ -32,7 +33,7 @@ } void ConfigureCommandLineForGuestMode(base::CommandLine* command_line) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) command_line->AppendSwitch(ash::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); command_line->AppendSwitchASCII(ash::switches::kLoginProfile, "hash");
diff --git a/chrome/browser/web_applications/test/profile_test_helper.h b/chrome/browser/web_applications/test/profile_test_helper.h index 9b8c80ec..9b18e9b 100644 --- a/chrome/browser/web_applications/test/profile_test_helper.h +++ b/chrome/browser/web_applications/test/profile_test_helper.h
@@ -10,16 +10,16 @@ #include "base/command_line.h" #include "base/test/scoped_command_line.h" #include "base/test/scoped_feature_list.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/test/web_app_test_utils.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser_commands.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) // Profile type to test. Provided to subclasses of TestProfileTypeMixin via // get_profile(). @@ -83,7 +83,7 @@ #define INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P(SUITE, PARAMS) \ INSTANTIATE_TEST_SUITE_P(All, SUITE, PARAMS, TestProfileTypeToString) -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Instantiates 3 versions of each test in |SUITE| to ensure coverage of // Guest and Incognito profiles, as well as regular profiles. This is currently // only used on ChromeOS. Other platforms will likely need a differently defined
diff --git a/chrome/browser/web_applications/test/web_app_install_test_utils.h b/chrome/browser/web_applications/test/web_app_install_test_utils.h index f943f6c..b841f1f2 100644 --- a/chrome/browser/web_applications/test/web_app_install_test_utils.h +++ b/chrome/browser/web_applications/test/web_app_install_test_utils.h
@@ -10,7 +10,6 @@ #include <vector> #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/web_app_install_info.h" #include "chrome/common/buildflags.h" #include "components/webapps/browser/installable/installable_metrics.h"
diff --git a/chrome/browser/web_applications/test/web_app_test_utils.cc b/chrome/browser/web_applications/test/web_app_test_utils.cc index a6d4382..258c2be 100644 --- a/chrome/browser/web_applications/test/web_app_test_utils.cc +++ b/chrome/browser/web_applications/test/web_app_test_utils.cc
@@ -1300,15 +1300,4 @@ return signatures; } -#if BUILDFLAG(IS_CHROMEOS_LACROS) -ScopedSkipMainProfileCheck::ScopedSkipMainProfileCheck() { - EXPECT_FALSE(IsMainProfileCheckSkippedForTesting()); - SetSkipMainProfileCheckForTesting(/*skip_check=*/true); -} - -ScopedSkipMainProfileCheck::~ScopedSkipMainProfileCheck() { - SetSkipMainProfileCheckForTesting(/*skip_check=*/false); -} -#endif - } // namespace web_app::test
diff --git a/chrome/browser/web_applications/test/web_app_test_utils.h b/chrome/browser/web_applications/test/web_app_test_utils.h index 3eb671bb..51dc999 100644 --- a/chrome/browser/web_applications/test/web_app_test_utils.h +++ b/chrome/browser/web_applications/test/web_app_test_utils.h
@@ -11,7 +11,6 @@ #include <optional> // for optional, nullopt #include <string_view> -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/os_integration/os_integration_sub_manager.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_install_params.h" @@ -97,17 +96,6 @@ // Creates a few well-formed integrity block signatures. std::vector<web_package::SignedWebBundleSignatureInfo> CreateSignatures(); -#if BUILDFLAG(IS_CHROMEOS_LACROS) -class ScopedSkipMainProfileCheck { - public: - ScopedSkipMainProfileCheck(); - ScopedSkipMainProfileCheck(const ScopedSkipMainProfileCheck&) = delete; - ScopedSkipMainProfileCheck& operator=(const ScopedSkipMainProfileCheck&) = - delete; - ~ScopedSkipMainProfileCheck(); -}; -#endif - } // namespace test } // namespace web_app
diff --git a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.cc b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.cc index 9745f83..eabd0f1 100644 --- a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.cc +++ b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.cc
@@ -10,6 +10,7 @@ #include "base/containers/contains.h" #include "base/metrics/user_metrics.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_management_type.h" @@ -202,7 +203,7 @@ return true; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) void UserUninstalledPreinstalledWebAppPrefs::ClearAllApps() { pref_service_->ClearPref(prefs::kUserUninstalledPreinstalledWebAppPref); }
diff --git a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h index d5f2c33d..80c52d4 100644 --- a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h +++ b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h
@@ -67,9 +67,10 @@ const base::flat_map<WebAppManagement::Type, WebApp::ExternalManagementConfig>& url_map, const bool only_default); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // Clear all apps marked as user uninstalled. Only used for Lacros // disablement. + // TODO(crbug.com/380780352): Remove after stepping stone. void ClearAllApps(); #endif
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index ce9e8a9..b5fdc1b 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc
@@ -24,6 +24,7 @@ #include "base/strings/to_string.h" #include "base/types/optional_util.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/generated_icon_fix_util.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h" @@ -869,7 +870,7 @@ base::Value WebApp::ClientData::AsDebugValue() const { base::Value::Dict root; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) root.Set("system_web_app_data", OptionalAsDebugValue(system_web_app_data)); #endif return base::Value(std::move(root)); @@ -979,7 +980,7 @@ app.capture_links_, app.manifest_url_, app.manifest_id_, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) app.client_data_.system_web_app_data, #endif app.file_handler_approval_state_,
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index 98f9094..c6f26a4 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h
@@ -19,7 +19,7 @@ #include "base/time/time.h" #include "base/values.h" #include "base/version.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/features.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h" @@ -48,7 +48,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_data.h" #endif @@ -131,7 +131,7 @@ ClientData(const ClientData& client_data); base::Value AsDebugValue() const; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) std::optional<ash::SystemWebAppData> system_web_app_data; #endif };
diff --git a/chrome/browser/web_applications/web_app_database.cc b/chrome/browser/web_applications/web_app_database.cc index 1460440..01c1749d 100644 --- a/chrome/browser/web_applications/web_app_database.cc +++ b/chrome/browser/web_applications/web_app_database.cc
@@ -23,6 +23,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/trace_event/trace_event.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/generated_icon_fix_util.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h" @@ -71,7 +72,7 @@ #include "url/gurl.h" #include "url/origin.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/webui/system_apps/public/system_web_app_type.h" #endif @@ -581,7 +582,7 @@ chromeos_data.handles_file_open_intents); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (web_app.client_data().system_web_app_data.has_value()) { auto& swa_data = web_app.client_data().system_web_app_data.value(); @@ -1107,7 +1108,7 @@ web_app->SetWebAppChromeOsData(std::move(chromeos_data)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (local_data.client_data().has_system_web_app_data()) { ash::SystemWebAppData& swa_data = web_app->client_data()->system_web_app_data.emplace();
diff --git a/chrome/browser/web_applications/web_app_database_unittest.cc b/chrome/browser/web_applications/web_app_database_unittest.cc index 629e1c0..a6cf814 100644 --- a/chrome/browser/web_applications/web_app_database_unittest.cc +++ b/chrome/browser/web_applications/web_app_database_unittest.cc
@@ -22,6 +22,7 @@ #include "base/test/test_future.h" #include "base/test/with_feature_override.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h" @@ -266,7 +267,7 @@ std::vector<webapps::AppId> apps_to_delete; Registry expected_registry; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool allow_system_source = true; #else bool allow_system_source = false; @@ -341,12 +342,6 @@ // Update the registry so apps reflect expected migrated state. for (auto& [app_id, app] : registry) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // System Web Apps are ignored by the registry on Lacros. - if (app->IsSystemApp()) { - continue; - } -#endif EnsureHasUserDisplayModeForCurrentPlatform(*app); test::MaybeEnsureShortcutAppsTreatedAsDiy(*app);
diff --git a/chrome/browser/web_applications/web_app_icon_generator.cc b/chrome/browser/web_applications/web_app_icon_generator.cc index 59284f9d..cdf2e9078 100644 --- a/chrome/browser/web_applications/web_app_icon_generator.cc +++ b/chrome/browser/web_applications/web_app_icon_generator.cc
@@ -11,7 +11,6 @@ #include "base/strings/utf_string_conversion_utils.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/shortcuts/shortcut_icon_generator.h" #include "chrome/grit/platform_locale_settings.h" #include "components/url_formatter/url_formatter.h"
diff --git a/chrome/browser/web_applications/web_app_icon_manager_browsertest.cc b/chrome/browser/web_applications/web_app_icon_manager_browsertest.cc index 6048d28..4e396625 100644 --- a/chrome/browser/web_applications/web_app_icon_manager_browsertest.cc +++ b/chrome/browser/web_applications/web_app_icon_manager_browsertest.cc
@@ -4,7 +4,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" @@ -114,7 +114,7 @@ gfx::ImageSkia app_icon = app_browser->app_controller()->GetWindowAppIcon().Rasterize(nullptr); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) gfx::ImageSkia image_skia = app_service_test().LoadAppIconBlocking(app_id, kWebAppIconSmall); EXPECT_TRUE(app_service_test().AreIconImageEqual(image_skia, app_icon));
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.cc b/chrome/browser/web_applications/web_app_install_finalizer.cc index d5ac925..c1fcc07 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.cc +++ b/chrome/browser/web_applications/web_app_install_finalizer.cc
@@ -27,7 +27,6 @@ #include "base/types/optional_ref.h" #include "base/values.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/commands/web_app_uninstall_command.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" @@ -69,7 +68,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "url/origin.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_data.h" #endif @@ -371,7 +370,7 @@ web_app->SetWebAppChromeOsData(std::move(cros_data)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // `WebApp::system_web_app_data` has a default value already. Only override if // the caller provided a new value. if (options.system_web_app_data.has_value()) {
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.h b/chrome/browser/web_applications/web_app_install_finalizer.h index 97e3b500..f23df77 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.h +++ b/chrome/browser/web_applications/web_app_install_finalizer.h
@@ -13,7 +13,7 @@ #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" #include "chrome/browser/web_applications/proto/web_app_install_state.pb.h" @@ -26,7 +26,7 @@ #include "components/webapps/common/web_app_id.h" #include "third_party/skia/include/core/SkBitmap.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_data.h" #endif @@ -81,7 +81,7 @@ bool skip_icon_writes_on_download_failure = false; std::optional<WebAppChromeOsData> chromeos_data; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) std::optional<ash::SystemWebAppData> system_web_app_data; #endif
diff --git a/chrome/browser/web_applications/web_app_install_params.h b/chrome/browser/web_applications/web_app_install_params.h index e7cc0aab..7ffaed75 100644 --- a/chrome/browser/web_applications/web_app_install_params.h +++ b/chrome/browser/web_applications/web_app_install_params.h
@@ -12,7 +12,7 @@ #include <vector> #include "base/functional/callback_forward.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/proto/web_app_install_state.pb.h" #include "chrome/browser/web_applications/web_app_screenshot_fetcher.h" @@ -20,7 +20,7 @@ #include "components/webapps/common/web_app_id.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/webui/system_apps/public/system_web_app_type.h" #endif @@ -98,7 +98,7 @@ std::vector<std::string> additional_search_terms; std::optional<std::string> launch_query_params; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) std::optional<ash::SystemWebAppType> system_app_type; #endif
diff --git a/chrome/browser/web_applications/web_app_install_utils.cc b/chrome/browser/web_applications/web_app_install_utils.cc index b7b1186d..3615840 100644 --- a/chrome/browser/web_applications/web_app_install_utils.cc +++ b/chrome/browser/web_applications/web_app_install_utils.cc
@@ -82,7 +82,7 @@ #include "url/gurl.h" #include "url/origin.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "chromeos/ash/experiences/system_web_apps/types/system_web_app_data.h" #endif @@ -1262,7 +1262,7 @@ options.add_to_quick_launch_bar = install_params.add_to_quick_launch_bar; options.skip_origin_association_validation = install_params.skip_origin_association_validation; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (install_params.system_app_type.has_value()) { options.system_web_app_data.emplace(); options.system_web_app_data->system_app_type = @@ -1297,7 +1297,7 @@ } syncer::SyncService* sync_service = SyncServiceFactory::GetForProfile(profile); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return sync_service->GetUserSettings()->GetSelectedOsTypes().Has( syncer::UserSelectableOsType::kOsApps); #else
diff --git a/chrome/browser/web_applications/web_app_launch_queue.cc b/chrome/browser/web_applications/web_app_launch_queue.cc index 5d781b5..63f371d0 100644 --- a/chrome/browser/web_applications/web_app_launch_queue.cc +++ b/chrome/browser/web_applications/web_app_launch_queue.cc
@@ -11,7 +11,7 @@ #include "base/check_is_test.h" #include "base/files/file_path.h" #include "base/memory/ptr_util.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/web_app_registrar.h" #include "content/public/browser/file_system_access_entry_factory.h" #include "content/public/browser/navigation_handle.h" @@ -37,7 +37,7 @@ // updates `entry_path` to the path that should be used by the File System // Access implementation. content::PathInfo GetPathInfo(const base::FilePath& entry_path) { -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) base::FilePath virtual_path; auto* external_mount_points = storage::ExternalMountPoints::GetSystemInstance(); @@ -91,7 +91,6 @@ content::FileSystemAccessEntryFactory::BindingContext context_; }; -// TODO(crbug.com/40169582): Add Lacros support. // TODO(crbug.com/40169582): Consider adding an {extension, pwa} enum to // `launch_params` instead of checking the scheme specifically for extensions? bool IsExtensionURL(const GURL& gurl) {
diff --git a/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc b/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc index 2990bf9..d4c80c28 100644 --- a/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc +++ b/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc
@@ -538,7 +538,7 @@ return "TYPE_DEVTOOLS"; case Browser::Type::TYPE_APP_POPUP: return "TYPE_APP_POPUP"; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) case Browser::Type::TYPE_CUSTOM_TAB: return "TYPE_CUSTOM_TAB"; #endif @@ -1725,7 +1725,7 @@ if (type == "TYPE_APP_POPUP") { return Browser::Type::TYPE_APP_POPUP; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (type == "TYPE_CUSTOM_TAB") { return Browser::Type::TYPE_CUSTOM_TAB; }
diff --git a/chrome/browser/web_applications/web_app_provider.cc b/chrome/browser/web_applications/web_app_provider.cc index 712886c7..bd730dc 100644 --- a/chrome/browser/web_applications/web_app_provider.cc +++ b/chrome/browser/web_applications/web_app_provider.cc
@@ -21,7 +21,6 @@ #include "base/run_loop.h" #include "base/types/pass_key.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/commands/web_app_command.h" #include "chrome/browser/web_applications/extensions_manager.h" @@ -59,13 +58,10 @@ #include "content/public/browser/web_contents.h" #if BUILDFLAG(IS_CHROMEOS) +#include "ash/constants/ash_features.h" #include "chrome/browser/web_applications/ash/migrations/adobe_express_oem_to_default_migration.h" #include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.h" #include "chrome/browser/web_applications/web_app_run_on_os_login_manager.h" -#endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include "ash/constants/ash_features.h" #include "chromeos/ash/components/browser_context_helper/browser_context_types.h" #endif @@ -124,7 +120,7 @@ // WebApp System must have only one instance in original profile. // Exclude secondary off-the-record profiles. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (!profile_->IsGuestSession()) DCHECK(!profile_->IsOffTheRecord()); #else
diff --git a/chrome/browser/web_applications/web_app_provider.h b/chrome/browser/web_applications/web_app_provider.h index 4ad2c25..abdbc8b 100644 --- a/chrome/browser/web_applications/web_app_provider.h +++ b/chrome/browser/web_applications/web_app_provider.h
@@ -96,22 +96,17 @@ // web apps. static WebAppProvider* GetForWebApps(Profile* profile); - // Returns the WebAppProvider for the current process. In particular: - // In Ash: Returns the WebAppProvider that hosts System Web Apps. - // In Lacros and other platforms: Returns the WebAppProvider that hosts - // non-system Web Apps. + // Returns the WebAppProvider for the current process. // // Avoid using this function where possible and prefer GetForWebApps which - // provides a guarantee they are being called from the correct process. Only - // use this if the calling code is shared between Ash and Lacros and expects - // the PWA WebAppProvider in Lacros and the SWA WebAppProvider in Ash. + // provides a guarantee they are being called from the correct process. // TODO(https://crbug.com/384063076): Stop returning the WebAppProvider for // profiles where `AreWebAppsEnabled` returns `false` to support CrOS system // web apps. static WebAppProvider* GetForLocalAppsUnchecked(Profile* profile); - // Return the WebAppProvider for tests, regardless of whether this is running - // in Lacros/Ash. Blocks if the web app registry is not yet ready. + // Return the WebAppProvider for tests. Blocks if the web app registry is not + // yet ready. // This returns `nullptr` if installed web apps are not supported on the // given `profile`. Use `web_app::AreWebAppsEnabled` to determine if web apps // are supported on a profile.
diff --git a/chrome/browser/web_applications/web_app_registrar.cc b/chrome/browser/web_applications/web_app_registrar.cc index 7fe1694..1d2105b 100644 --- a/chrome/browser/web_applications/web_app_registrar.cc +++ b/chrome/browser/web_applications/web_app_registrar.cc
@@ -28,7 +28,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/to_string.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h"
diff --git a/chrome/browser/web_applications/web_app_registrar_unittest.cc b/chrome/browser/web_applications/web_app_registrar_unittest.cc index b2f702b..f3222cd 100644 --- a/chrome/browser/web_applications/web_app_registrar_unittest.cc +++ b/chrome/browser/web_applications/web_app_registrar_unittest.cc
@@ -23,7 +23,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/apps/link_capturing/link_capturing_feature_test_support.h" #include "chrome/browser/web_applications/commands/run_on_os_login_command.h" #include "chrome/browser/web_applications/commands/web_app_uninstall_command.h" @@ -62,7 +62,7 @@ #include "url/gurl.h" #include "url/url_constants.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_features.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" @@ -1506,7 +1506,7 @@ Pair(outer_app_id, "ABC_Outer"))); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) class WebAppRegistrarAshTest : public WebAppTest { public: @@ -1592,74 +1592,6 @@ #endif -#if BUILDFLAG(IS_CHROMEOS_LACROS) - -using WebAppRegistrarLacrosTest = WebAppTest; - -TEST_F(WebAppRegistrarLacrosTest, SwaSourceNotSupported) { - const GURL example_url("https://example.com/my-app/start"); - const GURL swa_url("chrome://swa/start"); - const GURL uninstalling_url("https://example.com/uninstalling/start"); - - webapps::AppId example_id; - webapps::AppId swa_id; - webapps::AppId uninstalling_id; - WebAppRegistrarMutable registrar(profile()); - { - Registry registry; - - auto example_app = test::CreateWebApp(example_url); - example_id = example_app->app_id(); - registry.emplace(example_id, std::move(example_app)); - - auto swa_app = test::CreateWebApp(swa_url, WebAppManagement::Type::kSystem); - swa_id = swa_app->app_id(); - registry.emplace(swa_id, std::move(swa_app)); - - auto uninstalling_app = test::CreateWebApp(uninstalling_url); - uninstalling_app->SetIsUninstalling(true); - uninstalling_id = uninstalling_app->app_id(); - registry.emplace(uninstalling_id, std::move(uninstalling_app)); - - registrar.InitRegistry(std::move(registry)); - } - - EXPECT_EQ(registrar.FindBestAppWithUrlInScope( - example_url, - web_app::WebAppFilter::InstalledInOperatingSystemForTesting()), - example_id); - EXPECT_EQ(registrar.GetAppScope(example_id), - GURL("https://example.com/my-app/")); - EXPECT_TRUE(registrar.GetAppUserDisplayMode(example_id).has_value()); - EXPECT_EQ(registrar.CountUserInstalledApps(), 1); - - // System web apps are managed by Ash, excluded in Lacros - // WebAppRegistrar. - EXPECT_EQ(CountApps(registrar.GetApps()), 1); - - EXPECT_FALSE( - registrar - .FindBestAppWithUrlInScope( - swa_url, - web_app::WebAppFilter::InstalledInOperatingSystemForTesting()) - .has_value()); - EXPECT_TRUE(registrar.GetAppScope(swa_id).is_empty()); - EXPECT_FALSE(registrar.GetAppUserDisplayMode(swa_id).has_value()); - - EXPECT_FALSE( - registrar - .FindBestAppWithUrlInScope( - uninstalling_url, - web_app::WebAppFilter::InstalledInOperatingSystemForTesting()) - .has_value()); - EXPECT_EQ(registrar.GetAppScope(uninstalling_id), - GURL("https://example.com/uninstalling/")); - EXPECT_TRUE(registrar.GetAppUserDisplayMode(uninstalling_id).has_value()); - EXPECT_FALSE(base::Contains(registrar.GetAppIds(), uninstalling_id)); -} - -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - class WebAppRegistrarParameterizedTest : public WebAppRegistrarTest, public testing::WithParamInterface<
diff --git a/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc b/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc index d058c70..2af88e8 100644 --- a/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc
@@ -14,7 +14,6 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/notifications/system_notification_helper.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h"
diff --git a/chrome/browser/web_applications/web_app_sync_bridge.cc b/chrome/browser/web_applications/web_app_sync_bridge.cc index 6881f5d..912b4acf 100644 --- a/chrome/browser/web_applications/web_app_sync_bridge.cc +++ b/chrome/browser/web_applications/web_app_sync_bridge.cc
@@ -28,7 +28,7 @@ #include "base/strings/to_string.h" #include "base/types/expected.h" #include "base/types/pass_key.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/proto/web_app_install_state.pb.h" #include "chrome/browser/web_applications/user_display_mode.h"
diff --git a/chrome/browser/web_applications/web_app_sync_bridge_unittest.cc b/chrome/browser/web_applications/web_app_sync_bridge_unittest.cc index 23300b06..09282c6 100644 --- a/chrome/browser/web_applications/web_app_sync_bridge_unittest.cc +++ b/chrome/browser/web_applications/web_app_sync_bridge_unittest.cc
@@ -1303,11 +1303,7 @@ // This app should be uninstalled, since the `is_uninstalling` field is set. std::unique_ptr<WebApp> app1 = test::CreateWebApp(GURL("https://example.com/app1")); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - app1->AddSource(WebAppManagement::kPolicy); -#else app1->AddSource(WebAppManagement::kSystem); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) app1->SetIsUninstalling(/*is_uninstalling=*/true); const webapps::AppId app_id1 = app1->app_id(); system_apps.push_back(std::move(app1)); @@ -1315,11 +1311,7 @@ // This app will not be uninstalled. std::unique_ptr<WebApp> app2 = test::CreateWebApp(GURL("https://example.com/app2")); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - app2->AddSource(WebAppManagement::kPolicy); -#else app2->AddSource(WebAppManagement::kSystem); -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) const webapps::AppId app_id2 = app2->app_id(); system_apps.push_back(std::move(app2));
diff --git a/chrome/browser/web_applications/web_app_ui_manager_unittest.cc b/chrome/browser/web_applications/web_app_ui_manager_unittest.cc index b584825d..3b572dc 100644 --- a/chrome/browser/web_applications/web_app_ui_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_ui_manager_unittest.cc
@@ -9,7 +9,6 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/test/web_app_test_utils.h"
diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc index 892e4aa..4234896 100644 --- a/chrome/browser/web_applications/web_app_unittest.cc +++ b/chrome/browser/web_applications/web_app_unittest.cc
@@ -18,7 +18,6 @@ #include "base/json/json_writer.h" #include "base/path_service.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h" #include "chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h"
diff --git a/chrome/browser/web_applications/web_app_utils.h b/chrome/browser/web_applications/web_app_utils.h index 7bee67a..1e49f14 100644 --- a/chrome/browser/web_applications/web_app_utils.h +++ b/chrome/browser/web_applications/web_app_utils.h
@@ -13,7 +13,6 @@ #include <vector> #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_management_type.h"
diff --git a/chrome/browser/web_applications/web_app_utils_unittest.cc b/chrome/browser/web_applications/web_app_utils_unittest.cc index 598d19f..aa0dbc6 100644 --- a/chrome/browser/web_applications/web_app_utils_unittest.cc +++ b/chrome/browser/web_applications/web_app_utils_unittest.cc
@@ -9,7 +9,7 @@ #include "ash/constants/web_app_id_constants.h" #include "base/containers/adapters.h" #include "base/files/file_path.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/test/web_app_test.h"
diff --git a/chrome/browser/webauthn/android/cable_module_android.cc b/chrome/browser/webauthn/android/cable_module_android.cc index e09f85a..56b40fc 100644 --- a/chrome/browser/webauthn/android/cable_module_android.cc +++ b/chrome/browser/webauthn/android/cable_module_android.cc
@@ -135,17 +135,6 @@ } } - void CalculateIdentityKey( - const std::array<uint8_t, 32>& secret, - base::OnceCallback<void(bssl::UniquePtr<EC_KEY>)> callback) override { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::TaskPriority::BEST_EFFORT}, - base::BindOnce( - &SystemInterface::CalculateIdentityKeyOnBackgroundSequence, secret), - std::move(callback)); - } - void GetPrelinkFromPlayServices( base::OnceCallback<void(std::optional<std::vector<uint8_t>>)> callback) override { @@ -202,13 +191,6 @@ base::android::AttachCurrentThread()); } - static bssl::UniquePtr<EC_KEY> CalculateIdentityKeyOnBackgroundSequence( - std::array<uint8_t, 32> secret) { - // This runs on a worker thread because the scalar multiplication takes a - // few milliseconds on slower devices. - return device::cablev2::IdentityKey(secret); - } - static void GetPrelinkFromPlayServicesOnBackgroundSequence( uintptr_t this_pointer) { // This runs on a worker thread because this Java function can take a
diff --git a/chrome/browser/webauthn/android/cable_registration_state.cc b/chrome/browser/webauthn/android/cable_registration_state.cc index 03ef6002..a31d98b 100644 --- a/chrome/browser/webauthn/android/cable_registration_state.cc +++ b/chrome/browser/webauthn/android/cable_registration_state.cc
@@ -60,16 +60,12 @@ crypto::RandBytes(secret_); interface_->SetRootSecret(base::Base64Encode(secret_)); } - - interface_->CalculateIdentityKey( - secret_, base::BindOnce(&RegistrationState::OnIdentityKeyReady, - base::Unretained(this))); } // have_data_for_sync returns true if this object has loaded enough state to // put information into sync's DeviceInfo. bool RegistrationState::have_data_for_sync() const { - return device_supports_cable_.has_value() && identity_key_ && + return device_supports_cable_.has_value() && am_in_work_profile_.has_value() && sync_registration_ != nullptr && sync_registration_->contact_id() && have_play_services_data(); } @@ -193,10 +189,4 @@ MaybeSignalSync(); } -void RegistrationState::OnIdentityKeyReady( - bssl::UniquePtr<EC_KEY> identity_key) { - identity_key_ = std::move(identity_key); - MaybeSignalSync(); -} - } // namespace webauthn::authenticator
diff --git a/chrome/browser/webauthn/android/cable_registration_state.h b/chrome/browser/webauthn/android/cable_registration_state.h index af0a5c83..c066caf4 100644 --- a/chrome/browser/webauthn/android/cable_registration_state.h +++ b/chrome/browser/webauthn/android/cable_registration_state.h
@@ -56,11 +56,6 @@ // Test whether the current process is an in Android work profile. virtual void AmInWorkProfile(base::OnceCallback<void(bool)> callback) = 0; - // Generate a P-256 key pair from a seed. - virtual void CalculateIdentityKey( - const std::array<uint8_t, 32>& secret, - base::OnceCallback<void(bssl::UniquePtr<EC_KEY>)> callback) = 0; - // Fetch prelinking information from Play Services, if any. virtual void GetPrelinkFromPlayServices( base::OnceCallback<void(std::optional<std::vector<uint8_t>>)> @@ -86,7 +81,6 @@ return sync_registration_.get(); } const std::array<uint8_t, 32>& secret() const { return secret_; } - const EC_KEY* identity_key() const { return identity_key_.get(); } bool device_supports_cable() const { return *device_supports_cable_; } bool am_in_work_profile() const { return *am_in_work_profile_; } const std::optional<std::vector<uint8_t>>& link_data_from_play_services() @@ -130,18 +124,12 @@ // OnWorkProfileResult is run with the result of `AmInWorkProfile`. void OnWorkProfileResult(bool result); - // OnIdentityKeyReady is run with the result of `CalculateIdentityKey`. - void OnIdentityKeyReady(bssl::UniquePtr<EC_KEY> identity_key); - const std::unique_ptr<SystemInterface> interface_; std::unique_ptr<device::cablev2::authenticator::Registration> linking_registration_; std::unique_ptr<device::cablev2::authenticator::Registration> sync_registration_; std::array<uint8_t, 32> secret_; - // identity_key_ is a public/private P-256 key that is calculated from - // `secret_`. It's cached because it takes some time to compute. - bssl::UniquePtr<EC_KEY> identity_key_; std::unique_ptr<device::cablev2::authenticator::Registration::Event> pending_event_; // device_supports_cable_ caches the result of a Java function that checks
diff --git a/chrome/browser/webauthn/android/cable_registration_state_unittest.cc b/chrome/browser/webauthn/android/cable_registration_state_unittest.cc index 2b6c7a2..cfb20d2 100644 --- a/chrome/browser/webauthn/android/cable_registration_state_unittest.cc +++ b/chrome/browser/webauthn/android/cable_registration_state_unittest.cc
@@ -76,13 +76,6 @@ work_profile_callback_ = std::move(callback); } - void CalculateIdentityKey( - const std::array<uint8_t, 32>& secret, - base::OnceCallback<void(bssl::UniquePtr<EC_KEY>)> callback) override { - CHECK(!identity_key_callback_); - identity_key_callback_ = std::move(callback); - } - void RefreshLocalDeviceInfo() override { refresh_local_device_info_called_ = true; } @@ -101,7 +94,6 @@ base::OnceCallback<void(bool)> support_callback_; base::OnceCallback<void(bool)> work_profile_callback_; - base::OnceCallback<void(bssl::UniquePtr<EC_KEY>)> identity_key_callback_; base::OnceCallback<void(std::optional<std::vector<uint8_t>>)> prelink_callback_; }; @@ -151,8 +143,6 @@ EXPECT_FALSE(state_->have_data_for_sync()); std::move(interface_->support_callback_).Run(true); EXPECT_FALSE(state_->have_data_for_sync()); - std::move(interface_->identity_key_callback_).Run(FakeKey()); - EXPECT_FALSE(state_->have_data_for_sync()); EXPECT_FALSE(interface_->refresh_local_device_info_called_); state_->SignalSyncWhenReady(); EXPECT_FALSE(state_->have_data_for_sync());
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index bdce0d9d..a759b5d 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1739923150-7c209a8fa438433740cc8d7cb381d344782707a1-24399cf3548307a52b75efd2a923c5dd65c01f92.profdata +chrome-android32-main-1739944751-c0f968710e810a9f3e90cb63c1e19afa656940d2-50d4e19fc19ea1a95ef31616829f966a55e0e982.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index f14bd49..792f261a 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1739922408-c38f46babe0c9d3e1d655bfa81da2026420fc579-727a56820bb82f73f5ed5693c7a502afe8663097.profdata +chrome-android64-main-1739960861-6e9199240797ac8ff1136901e059817c1b5356b3-2775e0ef6c42dd1b022749582bf56614f4e937a5.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 654dae5..3b9281e9 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1739901582-b2a3cd0755c1870f88d17bcca74bd07ccc260041-0ef0f45f5b0cada6246a31ea73869fa63eb062ce.profdata +chrome-mac-main-1739944751-ed6fc83fd541db897d4c0acdcecbb05b832de353-50d4e19fc19ea1a95ef31616829f966a55e0e982.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 40e1e57..57389c8 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1739901582-20f9503a592d2344204ad27fe45cabc9413bbe17-0ef0f45f5b0cada6246a31ea73869fa63eb062ce.profdata +chrome-win32-main-1739923150-f999cdbe4a92f769ff6bf075af303f5bb4ccd8ea-24399cf3548307a52b75efd2a923c5dd65c01f92.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 7f75358e..9cf5aca 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1739890722-5349423d56a2d0e8f0dc2364a119d220c2f98517-d938382bf5e8e17501bd8ad17f999e3bb32e77b4.profdata +chrome-win64-main-1739933465-2aa34561c26da40ea2ac063af5a54efde53d33e0-630f0062170f445b6fd69ad38f3203de04123511.profdata
diff --git a/chrome/common/apps/platform_apps/api/_permission_features.json b/chrome/common/apps/platform_apps/api/_permission_features.json index 5f13f848..046f46e 100644 --- a/chrome/common/apps/platform_apps/api/_permission_features.json +++ b/chrome/common/apps/platform_apps/api/_permission_features.json
@@ -38,7 +38,9 @@ "location": "policy", "platforms": ["chromeos"], "allowlist": [ - "0962FDCCF4987E36619F5BDA0A8ED4CE78E6AC34" // Mercury V-Launcher + "0962FDCCF4987E36619F5BDA0A8ED4CE78E6AC34", // Mercury V-Launcher + "24E3AE98CC15530D49F8E4D996673D01C8206063", // Codimite V-Launcher Prod + "EA6971BE428F16A26DD9F77C280F81AE46BA79E7" // Codimite V-Launcher QA ] }], "firstRunPrivate": {
diff --git a/chrome/release_scripts b/chrome/release_scripts index e54cd72..3786319 160000 --- a/chrome/release_scripts +++ b/chrome/release_scripts
@@ -1 +1 @@ -Subproject commit e54cd72a13e2b29fc1ddeee1e1b0553bfd034594 +Subproject commit 3786319b49d5388118898d6ef740f9d73239f7c3
diff --git a/chrome/test/data/webui/chromeos/nearby_share/shared/nearby_contact_visibility_test.js b/chrome/test/data/webui/chromeos/nearby_share/shared/nearby_contact_visibility_test.js index c83f662..216d4dd6 100644 --- a/chrome/test/data/webui/chromeos/nearby_share/shared/nearby_contact_visibility_test.js +++ b/chrome/test/data/webui/chromeos/nearby_share/shared/nearby_contact_visibility_test.js
@@ -309,9 +309,8 @@ }); test( - 'Save persists visibility setting and allowed contacts LEGACY', + 'Save persists visibility setting and allowed contacts', async function() { - loadTimeData.overrideValues({'isQuickShareV2Enabled': false}); fakeContactManager.setupContactRecords(); fakeContactManager.setNumUnreachable(0); fakeContactManager.completeDownload(); @@ -348,32 +347,15 @@ assertEquals(fakeContactManager.allowedContacts[0], '2'); }); - test( - 'Save persists visibility setting and allowed contacts', - async function() { - fakeContactManager.setupContactRecords(); - fakeContactManager.setNumUnreachable(0); - fakeContactManager.completeDownload(); - visibilityElement.set('settings.visibility', Visibility.kAllContacts); - await waitAfterNextRender(visibilityElement); - - // after save, ui state is persisted - visibilityElement.saveVisibilityAndAllowedContacts(); - assertEquals( - visibilityElement.get('settings.visibility'), - Visibility.kAllContacts); - assertEquals(fakeContactManager.allowedContacts.length, 2); - }); - - test('System Settings changed on Save only LEGACY', async () => { - loadTimeData.overrideValues({'isQuickShareV2Enabled': false}); + test('System Settings changed on Save only', async () => { fakeContactManager.setupContactRecords(); fakeContactManager.setNumUnreachable(0); fakeContactManager.completeDownload(); visibilityElement.set('settings.visibility', Visibility.kAllContacts); await waitAfterNextRender(visibilityElement); - // visibility setting is not immediately updated + // System visibility setting is not immediately updated to Selected + // Devices despite toggling Selected Devices in Dialog. visibilityElement.shadowRoot.querySelector('#AllContactsToggle').click(); await waitAfterNextRender(visibilityElement); assertTrue(areContactCheckBoxesVisibleAndAllContactsToggledOff()); @@ -401,8 +383,7 @@ assertEquals('2', fakeContactManager.allowedContacts[0]); }); - test('Toggle some contacts from all contacts LEGACY', async () => { - loadTimeData.overrideValues({'isQuickShareV2Enabled': false}); + test('Toggle some contacts from all contacts', async () => { fakeContactManager.setupContactRecords(); fakeContactManager.setNumUnreachable(0); fakeContactManager.completeDownload(); @@ -416,8 +397,7 @@ assertTrue(areContactCheckBoxesVisibleAndAllContactsToggledOff()); }); - test('Toggle all contacts from some contacts LEGACY', async () => { - loadTimeData.overrideValues({'isQuickShareV2Enabled': false}); + test('Toggle all contacts from some contacts', async () => { fakeContactManager.setupContactRecords(); fakeContactManager.setNumUnreachable(0); fakeContactManager.completeDownload(); @@ -464,9 +444,8 @@ }); test( - 'Only contacts toggled are saved in allowed contact list when selected contacts toggled LEGACY', + 'Only contacts toggled are saved in allowed contact list when selected contacts toggled', async () => { - loadTimeData.overrideValues({'isQuickShareV2Enabled': false}); fakeContactManager.setupContactRecords(); fakeContactManager.setNumUnreachable(0); fakeContactManager.completeDownload();
diff --git a/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager.cc b/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager.cc index 8a5ea2a..bc309db 100644 --- a/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager.cc +++ b/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager.cc
@@ -8,8 +8,10 @@ #include <optional> #include <utility> +#include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" +#include "ash/constants/generative_ai_country_restrictions.h" #include "base/functional/bind.h" #include "base/functional/callback_forward.h" #include "base/sequence_checker.h" @@ -70,11 +72,11 @@ specialized_features::FeatureAccessConfig MantisUntrustedServiceManager::GetFeatureAccessConfig() { specialized_features::FeatureAccessConfig access_config; - // TODO(crbug.com/362993438): Check region restriction. access_config.capability_callback = base::BindRepeating([](AccountCapabilities capabilities) { return capabilities.can_use_generative_ai_photo_editing(); }); + access_config.country_codes = ash::GetGenerativeAiCountryAllowlist(); return access_config; } @@ -101,6 +103,10 @@ std::move(callback).Run(true); return; } + if (!base::FeatureList::IsEnabled(ash::features::kMediaAppImageMantisModel)) { + std::move(callback).Run(false); + return; + } specialized_features::FeatureAccessFailureSet failure_set = access_checker_->Check();
diff --git a/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager_unittest.cc b/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager_unittest.cc index 9272d0e..2655fef 100644 --- a/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager_unittest.cc +++ b/chromeos/ash/components/mantis/media_app/mantis_untrusted_service_manager_unittest.cc
@@ -7,10 +7,12 @@ #include <memory> #include <optional> +#include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/webui/media_app_ui/media_app_ui_untrusted.mojom.h" #include "base/memory/raw_ptr.h" #include "base/test/gmock_callback_support.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "chromeos/ash/components/mantis/mojom/mantis_processor.mojom.h" @@ -150,6 +152,18 @@ EXPECT_TRUE(result_future.Take()); } +TEST_F(MantisUntrustedServiceManagerTest, IsNotAvailableByFeatureFlag) { + base::test::ScopedFeatureList feature_list; + feature_list.InitWithFeatures({}, {features::kMediaAppImageMantisModel}); + + MantisUntrustedServiceManager manager(std::move(access_checker_)); + + TestFuture<bool> result_future; + manager.IsAvailable(&pref_, result_future.GetCallback()); + + EXPECT_FALSE(result_future.Take()); +} + TEST_F(MantisUntrustedServiceManagerTest, IsNotAvailableByAccountCapabilities) { ASSERT_FALSE(MantisUntrustedServiceManager::GetFeatureAccessConfig() .capability_callback.is_null());
diff --git a/chromeos/ash/services/cros_safety/cros_safety_service.cc b/chromeos/ash/services/cros_safety/cros_safety_service.cc index 669be26..fe9bb7ab 100644 --- a/chromeos/ash/services/cros_safety/cros_safety_service.cc +++ b/chromeos/ash/services/cros_safety/cros_safety_service.cc
@@ -15,14 +15,21 @@ namespace ash { -CrosSafetyService::CrosSafetyService(manta::MantaService* manta_service) - : manta_service_(manta_service) { - CHECK(manta_service_); +CrosSafetyService::CrosSafetyService( + raw_ptr<manta::MantaService> manta_service) { CHECK(mojo_service_manager::IsServiceManagerBound()) << "CrosSafetyService requires mojo service manager."; mojo_service_manager::GetServiceManagerProxy()->Register( chromeos::mojo_services::kCrosSafetyService, provider_receiver_.BindNewPipeAndPassRemote()); + + if (manta_service) { + auto provider = manta_service->CreateWalrusProvider(); + if (provider) { + cloud_safety_session_ = + std::make_unique<CloudSafetySession>(std::move(provider)); + } + } } CrosSafetyService::~CrosSafetyService() = default; @@ -105,17 +112,10 @@ void CrosSafetyService::CreateCloudSafetySession( mojo::PendingReceiver<cros_safety::mojom::CloudSafetySession> session, CreateCloudSafetySessionCallback callback) { - // initialize cloud_safety_session_ if not previously done. if (!cloud_safety_session_) { - auto provider = manta_service_->CreateWalrusProvider(); - if (!provider) { - std::move(callback).Run(cros_safety::mojom::GetCloudSafetySessionResult:: - kMantaServiceFailedToCreate); - return; - } - - cloud_safety_session_ = - std::make_unique<CloudSafetySession>(std::move(provider)); + std::move(callback).Run(cros_safety::mojom::GetCloudSafetySessionResult:: + kMantaServiceFailedToCreate); + return; } cloud_safety_session_->AddReceiver(std::move(session));
diff --git a/chromeos/ash/services/cros_safety/cros_safety_service.h b/chromeos/ash/services/cros_safety/cros_safety_service.h index 52c0e84..5775e13 100644 --- a/chromeos/ash/services/cros_safety/cros_safety_service.h +++ b/chromeos/ash/services/cros_safety/cros_safety_service.h
@@ -32,7 +32,7 @@ using CreateCloudSafetySessionCallback = base::OnceCallback<void(cros_safety::mojom::GetCloudSafetySessionResult)>; - explicit CrosSafetyService(manta::MantaService* manta_service); + explicit CrosSafetyService(raw_ptr<manta::MantaService> manta_service); CrosSafetyService(const CrosSafetyService&) = delete; CrosSafetyService& operator=(const CrosSafetyService&) = delete; ~CrosSafetyService() override; @@ -61,7 +61,6 @@ chromeos::mojo_service_manager::mojom::ProcessIdentityPtr identity, mojo::ScopedMessagePipeHandle receiver) override; - const raw_ptr<manta::MantaService> manta_service_; std::unique_ptr<CloudSafetySession> cloud_safety_session_; // Receiver for mojo service manager service provider.
diff --git a/chromeos/constants/chromeos_features.cc b/chromeos/constants/chromeos_features.cc index 1456126..122ce81 100644 --- a/chromeos/constants/chromeos_features.cc +++ b/chromeos/constants/chromeos_features.cc
@@ -325,6 +325,24 @@ // https://<customer>-my.sharepoint.com). "https://sharepoint.com"}; +// Controls whether the PWA manifest on Microsoft 365 Urls should be overridden +// with a static PWA manifest id. +BASE_FEATURE(kMicrosoft365ManifestOverride, + "Microsoft365ManifestOverride", + base::FEATURE_ENABLED_BY_DEFAULT); + +// Comma separated list of Urls where the M365 PWA manifest should be +// overridden. +const base::FeatureParam<std::string> kMicrosoft365ManifestUrls{ + &kMicrosoft365ManifestOverride, "m365-manifest-urls", + /*default*/ + + // The current Microsoft 365 web app. + "https://www.microsoft365.com/," + + // The new branding for the Microsoft 365 web app. + "https://m365.cloud.microsoft/"}; + // Enables the Microsoft OneDrive integration workflow for enterprise users to // cloud integration support. BASE_FEATURE(kMicrosoftOneDriveIntegrationForEnterprise, @@ -516,6 +534,10 @@ return base::FeatureList::IsEnabled(kMicrosoft365ScopeExtensions); } +bool IsMicrosoft365ManifestOverrideEnabled() { + return base::FeatureList::IsEnabled(kMicrosoft365ManifestOverride); +} + bool IsMicrosoftOneDriveIntegrationForEnterpriseEnabled() { return IsUploadOfficeToCloudEnabled() && base::FeatureList::IsEnabled(
diff --git a/chromeos/constants/chromeos_features.h b/chromeos/constants/chromeos_features.h index 2490fa2..8eca91a 100644 --- a/chromeos/constants/chromeos_features.h +++ b/chromeos/constants/chromeos_features.h
@@ -93,6 +93,10 @@ extern const base::FeatureParam<std::string> kMicrosoft365ScopeExtensionsDomains; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +BASE_DECLARE_FEATURE(kMicrosoft365ManifestOverride); +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +extern const base::FeatureParam<std::string> kMicrosoft365ManifestUrls; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) BASE_DECLARE_FEATURE(kPlatformKeysChangesWave1); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) BASE_DECLARE_FEATURE(kQuickAnswersMaterialNextUI); @@ -185,6 +189,8 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsMicrosoft365ScopeExtensionsEnabled(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +bool IsMicrosoft365ManifestOverrideEnabled(); +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsMicrosoftOneDriveIntegrationForEnterpriseEnabled(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsFeatureManagementHistoryEmbeddingEnabled();
diff --git a/chromeos/recorder_strings.grdp b/chromeos/recorder_strings.grdp index fdb3ebf..9ead19b 100644 --- a/chromeos/recorder_strings.grdp +++ b/chromeos/recorder_strings.grdp
@@ -119,6 +119,15 @@ <message desc="Accessibility label of error language row in the language picker." name="IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_ARIA_LABEL"> Can't download <ph name="LANGUAGE_NAME">$1<ex>English</ex></ph> transcription model. Try again or restart your Chromebook </message> + <message desc="Status message for screen reader to announce the language download failure in the language picker." name="IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_STATUS_MESSAGE"> + Can't download <ph name="LANGUAGE_NAME">$1<ex>English</ex></ph> transcription model. Try again or restart your Chromebook + </message> + <message desc="Status message for screen reader to announce the language download completion in the language picker." name="IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_FINISHED_STATUS_MESSAGE"> + <ph name="LANGUAGE_NAME">$1<ex>English</ex></ph> transcription model download completed + </message> + <message desc="Status message for screen reader to announce the language download start in the language picker." name="IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_STARTED_STATUS_MESSAGE"> + <ph name="LANGUAGE_NAME">$1<ex>English</ex></ph> transcription model download in progress + </message> <message desc="Description of language error state in the language picker." name="IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_ERROR_DESCRIPTION"> Can’t download. Try again or restart your Chromebook. </message>
diff --git a/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_STATUS_MESSAGE.png.sha1 b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_STATUS_MESSAGE.png.sha1 new file mode 100644 index 0000000..42bd992 --- /dev/null +++ b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_ERROR_STATUS_MESSAGE.png.sha1
@@ -0,0 +1 @@ +a08885d3082a72b1283a25b8de856882ff8a2ab1 \ No newline at end of file
diff --git a/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_FINISHED_STATUS_MESSAGE.png.sha1 b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_FINISHED_STATUS_MESSAGE.png.sha1 new file mode 100644 index 0000000..4aea068a8 --- /dev/null +++ b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_FINISHED_STATUS_MESSAGE.png.sha1
@@ -0,0 +1 @@ +cc9e0d414579f73c12c72744b3c8bf257a25a1a5 \ No newline at end of file
diff --git a/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_STARTED_STATUS_MESSAGE.png.sha1 b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_STARTED_STATUS_MESSAGE.png.sha1 new file mode 100644 index 0000000..85c83a3 --- /dev/null +++ b/chromeos/recorder_strings_grdp/IDS_RECORDER_LANGUAGE_PICKER_LANGUAGE_DOWNLOAD_STARTED_STATUS_MESSAGE.png.sha1
@@ -0,0 +1 @@ +7f5c65244b2d92d813a476de85f4adaafe642dab \ No newline at end of file
diff --git a/clank b/clank index 5ba3a0e..8ce502b 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 5ba3a0efeedf8dfa0fd609ba309bcd7206ba69e3 +Subproject commit 8ce502b458bbec661860869adc2fe1dd18decfc8
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index 09c882b..5485788d 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn
@@ -174,6 +174,8 @@ "data_model/form_group.h", "data_model/iban.cc", "data_model/iban.h", + "data_model/loyalty_card.cc", + "data_model/loyalty_card.h", "data_model/payment_instrument.cc", "data_model/payment_instrument.h", "data_model/payments_metadata.cc", @@ -665,6 +667,8 @@ "webdata/autofill_webdata_service_observer.h", "webdata/entities/entity_table.cc", "webdata/entities/entity_table.h", + "webdata/passes/passes_table.cc", + "webdata/passes/passes_table.h", "webdata/payments/autofill_wallet_credential_sync_bridge.cc", "webdata/payments/autofill_wallet_credential_sync_bridge.h", "webdata/payments/autofill_wallet_metadata_sync_bridge.cc", @@ -1042,6 +1046,8 @@ "test_utils/autofill_testing_pref_service.cc", "test_utils/autofill_testing_pref_service.h", "test_utils/field_prediction_test_matchers.h", + "test_utils/passes_data_test_utils.cc", + "test_utils/passes_data_test_utils.h", "test_utils/test_autofill_clock.cc", "test_utils/test_autofill_clock.h", "test_utils/test_event_waiter.h", @@ -1371,6 +1377,7 @@ "webdata/autocomplete/autocomplete_table_unittest.cc", "webdata/autofill_sync_metadata_table_unittest.cc", "webdata/entities/entity_table_unittest.cc", + "webdata/passes/passes_table_unittest.cc", "webdata/payments/autofill_wallet_credential_sync_bridge_unittest.cc", "webdata/payments/autofill_wallet_metadata_sync_bridge_unittest.cc", "webdata/payments/autofill_wallet_offer_sync_bridge_unittest.cc",
diff --git a/components/autofill/core/browser/data_manager/payments/payments_data_manager.cc b/components/autofill/core/browser/data_manager/payments/payments_data_manager.cc index 5b42ea4..464803a 100644 --- a/components/autofill/core/browser/data_manager/payments/payments_data_manager.cc +++ b/components/autofill/core/browser/data_manager/payments/payments_data_manager.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <memory> +#include "base/containers/contains.h" #include "base/containers/span.h" #include "base/containers/to_vector.h" #include "base/functional/bind.h" @@ -2172,6 +2173,12 @@ sync_pb::BnplIssuerDetails bnpl_issuer_details = payment_instrument.bnpl_issuer_details(); + // If `payment_instrument` has an unsupported issuer ID, do not cache it. + if (!base::Contains(payments::BnplManager::GetSupportedBnplIssuerIds(), + bnpl_issuer_details.issuer_id())) { + return; + } + std::vector<BnplIssuer::EligiblePriceRange> eligible_price_ranges; eligible_price_ranges.reserve( bnpl_issuer_details.eligible_price_range_size()); @@ -2238,6 +2245,14 @@ const sync_pb::BnplCreationOption& bnpl_issuer = payment_instrument_creation_option.buy_now_pay_later_option(); + + // If `payment_instrument_creation_option` has an unsupported issuer ID, do + // not cache it. + if (!base::Contains(payments::BnplManager::GetSupportedBnplIssuerIds(), + bnpl_issuer.issuer_id())) { + return; + } + std::vector<BnplIssuer::EligiblePriceRange> eligible_price_ranges; eligible_price_ranges.reserve(bnpl_issuer.eligible_price_range_size()); for (const sync_pb::EligiblePriceRange& eligible_price_range : @@ -2248,6 +2263,12 @@ eligible_price_range.max_price_in_micros()); } + // An unlinked BNPL issuer is only valid if there is at least one eligible + // price range. + if (eligible_price_ranges.empty()) { + return; + } + unlinked_bnpl_issuers_.emplace_back(std::nullopt, bnpl_issuer.issuer_id(), std::move(eligible_price_ranges)); }
diff --git a/components/autofill/core/browser/data_manager/payments/payments_data_manager_unittest.cc b/components/autofill/core/browser/data_manager/payments/payments_data_manager_unittest.cc index ea17a21..576f940 100644 --- a/components/autofill/core/browser/data_manager/payments/payments_data_manager_unittest.cc +++ b/components/autofill/core/browser/data_manager/payments/payments_data_manager_unittest.cc
@@ -41,6 +41,7 @@ #include "components/autofill/core/browser/form_structure.h" #include "components/autofill/core/browser/metrics/autofill_metrics.h" #include "components/autofill/core/browser/metrics/payments/mandatory_reauth_metrics.h" +#include "components/autofill/core/browser/payments/constants.h" #include "components/autofill/core/browser/studies/autofill_experiments.h" #include "components/autofill/core/browser/suggestions/payments/payments_suggestion_generator.h" #include "components/autofill/core/browser/suggestions/suggestion.h" @@ -2336,7 +2337,7 @@ features::kAutofillEnableBuyNowPayLaterSyncing); sync_pb::PaymentInstrument payment_instrument = test::CreatePaymentInstrumentWithLinkedBnplIssuer( - 1234L, /*issuer_id=*/"some_bnpl_issuer", "USD", + 1234L, std::string(kBnplAffirmIssuerId), "USD", /*min_price_in_micros=*/0, /*max_price_in_micros=*/35000000); ASSERT_TRUE( @@ -2366,12 +2367,13 @@ features::kAutofillEnableBuyNowPayLaterSyncing); sync_pb::PaymentInstrument payment_instrument_1 = test::CreatePaymentInstrumentWithLinkedBnplIssuer( - 1234L, /*issuer_id=*/"some_bnpl_issuer", "USD", + 1234L, std::string(kBnplAffirmIssuerId), "USD", /*min_price_in_micros=*/0, /*max_price_in_micros=*/35000000); sync_pb::PaymentInstrument payment_instrument_2 = test::CreatePaymentInstrumentWithLinkedBnplIssuer( - 2345L, /*issuer_id=*/"zip", "USD", /*min_price_in_micros=*/0, + 2345L, std::string(kBnplZipIssuerId), "USD", + /*min_price_in_micros=*/0, /*max_price_in_micros=*/35000000); ASSERT_TRUE(GetServerDataTable()->SetPaymentInstruments( {payment_instrument_1, payment_instrument_2})); @@ -2389,13 +2391,36 @@ EXPECT_TRUE(payments_data_manager().GetLinkedBnplIssuers().empty()); } +// Tests that no linked BNPL issuers are cached if the only issuer synced is +// unsupported. +TEST_F(PaymentsDataManagerTest, GetLinkedBnplIssuers_UnsupportedIssuer) { + base::test::ScopedFeatureList scoped_feature_list( + features::kAutofillEnableBuyNowPayLaterSyncing); + sync_pb::PaymentInstrument payment_instrument_1 = + test::CreatePaymentInstrumentWithLinkedBnplIssuer( + 1234L, "unsupported_issuer_id", "USD", + /*min_price_in_micros=*/0, + /*max_price_in_micros=*/35000000); + ASSERT_TRUE( + GetServerDataTable()->SetPaymentInstruments({payment_instrument_1})); + + // `Refresh()` must be called to ensure that the linked BNPL issuer payment + // instruments are loaded again from the WebDatabase. + payments_data_manager().Refresh(); + WaitForOnPaymentsDataChanged(); + + // Verify that no linked BNPL issuers are cached into PaymentsDataManager + // because the only issuer synced was unsupported. + EXPECT_TRUE(payments_data_manager().GetLinkedBnplIssuers().empty()); +} + // If the conditions are met to return a linked BNPL issuer, this test ensures // it is returned and verifies that they had the expected values upon returning. TEST_F(PaymentsDataManagerTest, GetLinkedBnplIssuers) { base::test::ScopedFeatureList scoped_feature_list( features::kAutofillEnableBuyNowPayLaterSyncing); int64_t instrument_id = 1234L; - std::string issuer_id = "some_bnpl_issuer"; + std::string issuer_id = std::string(kBnplAffirmIssuerId); std::string currency = "USD"; uint64_t min_price_in_micros = 50000000; uint64_t max_price_in_micros = 35000000; @@ -2435,7 +2460,7 @@ base::test::ScopedFeatureList scoped_feature_list( features::kAutofillEnableBuyNowPayLaterSyncing); int64_t instrument_id = 1234L; - std::string issuer_id = "some_bnpl_issuer"; + std::string issuer_id = std::string(kBnplAffirmIssuerId); std::string currency = "USD"; uint64_t min_price_in_micros = 50000000; uint64_t max_price_in_micros = 35000000; @@ -3614,7 +3639,7 @@ sync_pb::BnplCreationOption* bnpl_option = creation_option.mutable_buy_now_pay_later_option(); - bnpl_option->set_issuer_id("issuer_id"); + bnpl_option->set_issuer_id(kBnplAffirmIssuerId); sync_pb::EligiblePriceRange eligible_price_range; eligible_price_range.set_currency("USD"); @@ -3637,16 +3662,80 @@ // Must match the BnplCreationOption in the payment instrument creation // option. - std::vector<BnplIssuer> want_bnpl_issuers = { - BnplIssuer(/*instrument_id=*/std::nullopt, "issuer_id", - {BnplIssuer::EligiblePriceRange(/*currency= */ "USD", - /*price_lower_bound=*/50, - /*price_upper_bound=*/200)})}; + std::vector<BnplIssuer> want_bnpl_issuers = {BnplIssuer( + /*instrument_id=*/std::nullopt, std::string(kBnplAffirmIssuerId), + {BnplIssuer::EligiblePriceRange(/*currency= */ "USD", + /*price_lower_bound=*/50, + /*price_upper_bound=*/200)})}; EXPECT_THAT(payments_data_manager().GetUnlinkedBnplIssuers(), testing::UnorderedElementsAreArray(want_bnpl_issuers)); } +// Tests that no unlinked BNPL issuers are cached if the only synced unlinked +// issuer is not supported. +TEST_F(PaymentsDataManagerTest, GetUnlinkedBnplIssuers_UnsupportedIssuerId) { + // Create a BNPL payment creation option. + sync_pb::PaymentInstrumentCreationOption creation_option; + creation_option.set_id("1234"); + + sync_pb::BnplCreationOption* bnpl_option = + creation_option.mutable_buy_now_pay_later_option(); + bnpl_option->set_issuer_id("unsupported_issuer_id"); + + sync_pb::EligiblePriceRange eligible_price_range; + eligible_price_range.set_currency("USD"); + eligible_price_range.set_min_price_in_micros(50); + eligible_price_range.set_max_price_in_micros(200); + *bnpl_option->add_eligible_price_range() = eligible_price_range; + + ASSERT_TRUE(GetServerDataTable()->SetPaymentInstrumentCreationOptions( + {creation_option})); + + // Since the PaymentsDataManager was initialized before adding the unlinked + // BNPL issuer payment instrument creation options to the WebDatabase, we + // expect GetUnlinkedBnplIssuers to return an empty list. + EXPECT_EQ(payments_data_manager().GetUnlinkedBnplIssuers().size(), 0u); + + // We need to call `Refresh()` to ensure that the BNPL issuer payment + // instrument creation options are loaded again from the WebDatabase. + payments_data_manager().Refresh(); + WaitForOnPaymentsDataChanged(); + + // The only Issuer ID present is for an unsupported issuer, so no BNPL issuers + // should be cached. + EXPECT_TRUE(payments_data_manager().GetUnlinkedBnplIssuers().empty()); +} + +// Tests that no unlinked BNPL issuers are cached if the only synced unlinked +// issuer does not have an eligible price range. +TEST_F(PaymentsDataManagerTest, GetUnlinkedBnplIssuers_NoEligiblePriceRange) { + // Create a BNPL payment creation option. + sync_pb::PaymentInstrumentCreationOption creation_option; + creation_option.set_id("1234"); + + sync_pb::BnplCreationOption* bnpl_option = + creation_option.mutable_buy_now_pay_later_option(); + bnpl_option->set_issuer_id(kBnplAffirmIssuerId); + + ASSERT_TRUE(GetServerDataTable()->SetPaymentInstrumentCreationOptions( + {creation_option})); + + // Since the PaymentsDataManager was initialized before adding the unlinked + // BNPL issuer payment instrument creation options to the WebDatabase, we + // expect GetUnlinkedBnplIssuers to return an empty list. + EXPECT_EQ(payments_data_manager().GetUnlinkedBnplIssuers().size(), 0u); + + // We need to call `Refresh()` to ensure that the BNPL issuer payment + // instrument creation options are loaded again from the WebDatabase. + payments_data_manager().Refresh(); + WaitForOnPaymentsDataChanged(); + + // No unlinked BNPL issuers should be cached as there is no eligible price + // range present. + EXPECT_TRUE(payments_data_manager().GetUnlinkedBnplIssuers().empty()); +} + TEST_F( PaymentsDataManagerTest, GetUnlinkedBnplIssuers_PaymentsDataManagerRefreshedTwice_NoDuplicatedUnlinkedBnplIssuers) { @@ -3669,21 +3758,15 @@ // Tests that `GetBnplIssuers` returns all linked and unlinked buy-now-pay-later // issuers. TEST_F(PaymentsDataManagerTest, GetBnplIssuers) { - // Add two linked issuers and one unlinked issuer to payments data manager. - BnplIssuer linked_issuer1 = test::GetTestLinkedBnplIssuer(); - BnplIssuer linked_issuer2 = - BnplIssuer(/*instrument_id=*/5678, /*issuer_id=*/"dummy", - {BnplIssuer::EligiblePriceRange(/*currency= */ "USD", - /*price_lower_bound=*/50, - /*price_upper_bound=*/200)}); + // Add one linked issuer and one unlinked issuer to payments data manager. + BnplIssuer linked_issuer = test::GetTestLinkedBnplIssuer(); BnplIssuer unlinked_issuer = test::GetTestUnlinkedBnplIssuer(); - test_api(payments_data_manager()).AddBnplIssuer(linked_issuer1); - test_api(payments_data_manager()).AddBnplIssuer(linked_issuer2); + test_api(payments_data_manager()).AddBnplIssuer(linked_issuer); test_api(payments_data_manager()).AddBnplIssuer(unlinked_issuer); - EXPECT_THAT(payments_data_manager().GetBnplIssuers(), - testing::UnorderedElementsAreArray( - {linked_issuer1, linked_issuer2, unlinked_issuer})); + EXPECT_THAT( + payments_data_manager().GetBnplIssuers(), + testing::UnorderedElementsAreArray({linked_issuer, unlinked_issuer})); } // Tests that Buy-now-pay-later issuer getters does not return any issuers if
diff --git a/components/autofill/core/browser/data_model/loyalty_card.cc b/components/autofill/core/browser/data_model/loyalty_card.cc new file mode 100644 index 0000000..106ad610 --- /dev/null +++ b/components/autofill/core/browser/data_model/loyalty_card.cc
@@ -0,0 +1,25 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/data_model/loyalty_card.h" + +namespace autofill { + +LoyaltyCard::LoyaltyCard(std::string loyalty_card_id, + std::string merchant_name, + std::string program_name, + std::string program_logo, + std::string loyalty_card_number) + : loyalty_card_id(std::move(loyalty_card_id)), + merchant_name(std::move(merchant_name)), + program_name(std::move(program_name)), + program_logo(std::move(program_logo)), + loyalty_card_number(std::move(loyalty_card_number)) {} + +LoyaltyCard::LoyaltyCard(const LoyaltyCard&) = default; +LoyaltyCard::LoyaltyCard(LoyaltyCard&&) = default; + +LoyaltyCard::~LoyaltyCard() = default; + +} // namespace autofill
diff --git a/components/autofill/core/browser/data_model/loyalty_card.h b/components/autofill/core/browser/data_model/loyalty_card.h new file mode 100644 index 0000000..81332d86 --- /dev/null +++ b/components/autofill/core/browser/data_model/loyalty_card.h
@@ -0,0 +1,45 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_LOYALTY_CARD_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_LOYALTY_CARD_H_ + +#include <string> + +namespace autofill { + +// Represents a loaylty card coming from the Google Wallet. +class LoyaltyCard final { + public: + LoyaltyCard(std::string loyalty_card_id, + std::string merchant_name, + std::string program_name, + std::string program_logo, + std::string loyalty_card_number); + + LoyaltyCard(const LoyaltyCard&); + LoyaltyCard(LoyaltyCard&&); + LoyaltyCard& operator=(const LoyaltyCard&) = default; + LoyaltyCard& operator=(LoyaltyCard&&) = default; + + ~LoyaltyCard(); + + friend bool operator==(const LoyaltyCard&, const LoyaltyCard&) = default; + + // A unique identifier coming from the server, which is used as a primary key + // for storing loyalty cards in the database. + std::string loyalty_card_id; + // The merchant name e.g. "Deutsche Bahn". + std::string merchant_name; + // The loyalty card program name e.g. "BahnBonus". + std::string program_name; + // The logo icon URL. + std::string program_logo; + // The loyalty card issuer text code. + std::string loyalty_card_number; +}; + +} // namespace autofill + +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_LOYALTY_CARD_H_
diff --git a/components/autofill/core/browser/test_utils/autofill_test_utils.cc b/components/autofill/core/browser/test_utils/autofill_test_utils.cc index ad2897a6..10434b2 100644 --- a/components/autofill/core/browser/test_utils/autofill_test_utils.cc +++ b/components/autofill/core/browser/test_utils/autofill_test_utils.cc
@@ -36,6 +36,7 @@ #include "components/autofill/core/browser/integrators/mock_autofill_optimization_guide.h" #include "components/autofill/core/browser/metrics/suggestions_list_metrics.h" #include "components/autofill/core/browser/payments/card_unmask_challenge_option.h" +#include "components/autofill/core/browser/payments/constants.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/autofill/core/browser/suggestions/suggestion_type.h" #include "components/autofill/core/browser/ui/autofill_external_delegate.h" @@ -1175,7 +1176,7 @@ eligible_price_ranges.emplace_back(/*currency=*/"USD", /*price_lower_bound=*/50'000'000, /*price_upper_bound=*/200'000'000); - return BnplIssuer(12345, /*issuer_id=*/"test_issuer_id1", + return BnplIssuer(12345, std::string(kBnplAffirmIssuerId), std::move(eligible_price_ranges)); } @@ -1185,7 +1186,7 @@ eligible_price_ranges.emplace_back(/*currency=*/"USD", /*price_lower_bound=*/35'000'000, /*price_upper_bound=*/100'000'000); - return BnplIssuer(std::nullopt, /*issuer_id=*/"test_issuer_id2", + return BnplIssuer(std::nullopt, std::string(kBnplZipIssuerId), std::move(eligible_price_ranges)); } @@ -1196,7 +1197,7 @@ sync_pb::BnplCreationOption* bnpl_option = payment_instrument_creation_option.mutable_buy_now_pay_later_option(); - bnpl_option->set_issuer_id("issuer_id"); + bnpl_option->set_issuer_id(kBnplAffirmIssuerId); sync_pb::EligiblePriceRange eligible_price_range; eligible_price_range.set_currency("USD");
diff --git a/components/autofill/core/browser/test_utils/passes_data_test_utils.cc b/components/autofill/core/browser/test_utils/passes_data_test_utils.cc new file mode 100644 index 0000000..83c71130 --- /dev/null +++ b/components/autofill/core/browser/test_utils/passes_data_test_utils.cc
@@ -0,0 +1,25 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/test_utils/passes_data_test_utils.h" + +#include "components/autofill/core/browser/data_model/loyalty_card.h" + +namespace autofill::test { + +LoyaltyCard CreateLoyaltyCard() { + return LoyaltyCard( + /*loyalty_card_id=*/"loyalty_card_id_1", + /*merchant_name=*/"Deutsche Bahn", /*program_name=*/"BahnBonus", + /*program_logo=*/"https://empty.url.com", /*loyalty_card_number=*/"1234"); +} + +LoyaltyCard CreateLoyaltyCard2() { + return LoyaltyCard(/*loyalty_card_id=*/"loyalty_card_id_2", + /*merchant_name=*/"Lidl", /*program_name=*/"CustomerCard", + /*program_logo=*/"https://empty.url.com", + /*loyalty_card_number=*/"4321"); +} + +} // namespace autofill::test
diff --git a/components/autofill/core/browser/test_utils/passes_data_test_utils.h b/components/autofill/core/browser/test_utils/passes_data_test_utils.h new file mode 100644 index 0000000..b260ecc --- /dev/null +++ b/components/autofill/core/browser/test_utils/passes_data_test_utils.h
@@ -0,0 +1,19 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_UTILS_PASSES_DATA_TEST_UTILS_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_UTILS_PASSES_DATA_TEST_UTILS_H_ + +#include "components/autofill/core/browser/data_model/loyalty_card.h" + +namespace autofill::test { + +// Returns a fully populated loyalty card. +LoyaltyCard CreateLoyaltyCard(); +// Returns a fully populated loyalty card different from `CreateLoyaltyCard()`. +LoyaltyCard CreateLoyaltyCard2(); + +} // namespace autofill::test + +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_UTILS_PASSES_DATA_TEST_UTILS_H_
diff --git a/components/autofill/core/browser/webdata/passes/passes_table.cc b/components/autofill/core/browser/webdata/passes/passes_table.cc new file mode 100644 index 0000000..15303e0 --- /dev/null +++ b/components/autofill/core/browser/webdata/passes/passes_table.cc
@@ -0,0 +1,131 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/webdata/passes/passes_table.h" + +#include <optional> +#include <string_view> + +#include "components/autofill/core/browser/data_model/loyalty_card.h" +#include "components/autofill/core/browser/webdata/autofill_table_utils.h" +#include "components/webdata/common/web_database.h" +#include "sql/database.h" +#include "sql/statement.h" + +namespace autofill { + +namespace { + +constexpr std::string_view kLoyaltyCardsTable = "loyalty_card"; +constexpr std::string_view kLoyaltyCardGuid = "guid"; +constexpr std::string_view kLoyaltyCardMerchantName = "merchant_name"; +constexpr std::string_view kLoyaltyCardProgramName = "program_name"; +constexpr std::string_view kLoyaltyCardProgramLogo = "program_logo"; +constexpr std::string_view kLoyaltyCardNumber = "loyalty_card_number"; + +// Expects that `s` is pointing to a query result containing `kLoyaltyCardGuid`, +// `kLoyaltyCardMerchantName`, `kLoyaltyCardProgramName`, +// `kLoyaltyCardProgramLogo` and `kLoyaltyCardNumber` in that order. Constructs +// a `LoyaltyCard` from that data. +LoyaltyCard LoyaltyCardFromStatement(sql::Statement& s) { + return LoyaltyCard(/*loyalty_card_id=*/s.ColumnString(0), + /*merchant_name=*/s.ColumnString(1), + /*program_name=*/s.ColumnString(2), + /*program_logo=*/s.ColumnString(3), + /*loyalty_card_number=*/s.ColumnString(4)); +} + +WebDatabaseTable::TypeKey GetKey() { + static int table_key = 0; + return reinterpret_cast<void*>(&table_key); +} + +} // namespace + +PassesTable::PassesTable() = default; + +PassesTable::~PassesTable() = default; + +// static +PassesTable* PassesTable::FromWebDatabase(WebDatabase* db) { + return static_cast<PassesTable*>(db->GetTable(GetKey())); +} + +WebDatabaseTable::TypeKey PassesTable::GetTypeKey() const { + return GetKey(); +} + +bool PassesTable::CreateTablesIfNecessary() { + return InitLoyaltyCardsTable(); +} + +bool PassesTable::InitLoyaltyCardsTable() { + return CreateTableIfNotExists( + db(), kLoyaltyCardsTable, + {{kLoyaltyCardGuid, "TEXT PRIMARY KEY NOT NULL"}, + {kLoyaltyCardMerchantName, "TEXT NOT NULL"}, + {kLoyaltyCardProgramName, "TEXT NOT NULL"}, + {kLoyaltyCardProgramLogo, "TEXT NOT NULL"}, + {kLoyaltyCardNumber, "TEXT NOT NULL"}}); +} + +bool PassesTable::MigrateToVersion(int version, + bool* update_compatible_version) { + // No migrations exist at this point. + return true; +} + +std::vector<LoyaltyCard> PassesTable::GetLoyaltyCards() const { + sql::Statement query; + SelectBuilder( + db(), query, kLoyaltyCardsTable, + {kLoyaltyCardGuid, kLoyaltyCardMerchantName, kLoyaltyCardProgramName, + kLoyaltyCardProgramLogo, kLoyaltyCardNumber}); + std::vector<LoyaltyCard> result; + while (query.Step()) { + result.emplace_back(LoyaltyCardFromStatement(query)); + } + return result; +} + +bool PassesTable::AddOrUpdateLoyaltyCard( + const LoyaltyCard& loyalty_card) const { + sql::Statement query; + InsertBuilder( + db(), query, kLoyaltyCardsTable, + {kLoyaltyCardGuid, kLoyaltyCardMerchantName, kLoyaltyCardProgramName, + kLoyaltyCardProgramLogo, kLoyaltyCardNumber}, + /*or_replace=*/true); + int index = 0; + query.BindString(index++, loyalty_card.loyalty_card_id); + query.BindString(index++, loyalty_card.merchant_name); + query.BindString(index++, loyalty_card.program_name); + query.BindString(index++, loyalty_card.program_logo); + query.BindString(index++, loyalty_card.loyalty_card_number); + return query.Run(); +} + +std::optional<LoyaltyCard> PassesTable::GetLoyaltyCardById( + std::string_view loyalty_card_id) const { + sql::Statement query; + if (SelectByGuid( + db(), query, kLoyaltyCardsTable, + {kLoyaltyCardGuid, kLoyaltyCardMerchantName, kLoyaltyCardProgramName, + kLoyaltyCardProgramLogo, kLoyaltyCardNumber}, + loyalty_card_id)) { + return LoyaltyCardFromStatement(query); + } + return std::nullopt; +} + +bool PassesTable::RemoveLoyaltyCard(std::string_view loyalty_card_id) { + return DeleteWhereColumnEq(db(), kLoyaltyCardsTable, kLoyaltyCardGuid, + loyalty_card_id); +} + +bool PassesTable::ClearLoyaltyCards() { + return Delete(db(), kLoyaltyCardsTable); +} + +} // namespace autofill
diff --git a/components/autofill/core/browser/webdata/passes/passes_table.h b/components/autofill/core/browser/webdata/passes/passes_table.h new file mode 100644 index 0000000..96e457a5 --- /dev/null +++ b/components/autofill/core/browser/webdata/passes/passes_table.h
@@ -0,0 +1,78 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_PASSES_PASSES_TABLE_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_PASSES_PASSES_TABLE_H_ + +#include <string_view> +#include <vector> + +#include "components/autofill/core/browser/data_model/loyalty_card.h" +#include "components/webdata/common/web_database_table.h" + +class WebDatabase; + +namespace autofill { + +// This class manages non-payments data types coming from Google Wallet within +// the SQLite database passed in the constructor. It expects the following +// schema: +// +// ----------------------------------------------------------------------------- +// loyalty_cards +// +// guid Uniquely identifies the loyalty card instance (primary +// key). +// merchant_name The name of the loyalty card provider e.g. "Deutsche +// Bahn". +// program_name The name of the program from the loyalty card provider +// e.g. "BahnBonus". +// program_logo The url of the logo icon for the card. +// loyalty_card_number A string representation of the loyalty card number. +class PassesTable : public WebDatabaseTable { + public: + PassesTable(); + + PassesTable(const PassesTable&) = delete; + PassesTable& operator=(const PassesTable&) = delete; + + ~PassesTable() override; + + // Retrieves the PassesTable* owned by `db`. + static PassesTable* FromWebDatabase(WebDatabase* db); + + // WebDatabaseTable: + WebDatabaseTable::TypeKey GetTypeKey() const override; + bool CreateTablesIfNecessary() override; + bool MigrateToVersion(int version, bool* update_compatible_version) override; + + // Returns all loyalty cards stored in the database. + std::vector<LoyaltyCard> GetLoyaltyCards() const; + + // Inserts a new or updates an existing loyalty card into the database using + // the loyalty card id as a primary key. Returns `true` if the operation + // succeeded. + bool AddOrUpdateLoyaltyCard(const LoyaltyCard& loyalty_card) const; + + // Attempts to retrieve a loyalty card from the database using the + // `loyalty_card_id` as a unique identifier. Returns `std::nullopt` if there's + // no loyalty card with `loyalty_card_id` in the database. + std::optional<LoyaltyCard> GetLoyaltyCardById( + std::string_view loyalty_card_id) const; + + // Removes the loyalty card from the database using `loyalty_card_id` as a + // unique identifier. Returns `true` if the operation succeeded. + bool RemoveLoyaltyCard(std::string_view loyalty_card_id); + + // Removes all loyalty cards stored in the database. Returns `true` if the + // operation succeeded. + bool ClearLoyaltyCards(); + + private: + bool InitLoyaltyCardsTable(); +}; + +} // namespace autofill + +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_PASSES_PASSES_TABLE_H_
diff --git a/components/autofill/core/browser/webdata/passes/passes_table_unittest.cc b/components/autofill/core/browser/webdata/passes/passes_table_unittest.cc new file mode 100644 index 0000000..a438180 --- /dev/null +++ b/components/autofill/core/browser/webdata/passes/passes_table_unittest.cc
@@ -0,0 +1,100 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/webdata/passes/passes_table.h" + +#include "base/files/scoped_temp_dir.h" +#include "components/autofill/core/browser/data_model/loyalty_card.h" +#include "components/autofill/core/browser/test_utils/passes_data_test_utils.h" +#include "components/webdata/common/web_database.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace autofill { + +namespace { + +using ::testing::IsEmpty; +using ::testing::UnorderedElementsAre; + +class PassesTableTest : public testing::Test { + protected: + void SetUp() override { + ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + db_.AddTable(&table_); + ASSERT_EQ(sql::INIT_OK, + db_.Init(temp_dir_.GetPath().AppendASCII("TestDB"))); + } + + PassesTable& passes_table() { return table_; } + + private: + base::ScopedTempDir temp_dir_; + PassesTable table_; + WebDatabase db_; +}; + +TEST_F(PassesTableTest, GetLoyaltyCards) { + const LoyaltyCard card1 = test::CreateLoyaltyCard(); + const LoyaltyCard card2 = test::CreateLoyaltyCard2(); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card2)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), + UnorderedElementsAre(card1, card2)); +} + +TEST_F(PassesTableTest, GetLoyaltyCardById) { + const LoyaltyCard card1 = test::CreateLoyaltyCard(); + const LoyaltyCard card2 = test::CreateLoyaltyCard2(); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card2)); + EXPECT_EQ(passes_table().GetLoyaltyCardById(card1.loyalty_card_id), card1); + EXPECT_EQ(passes_table().GetLoyaltyCardById(card2.loyalty_card_id), card2); + EXPECT_EQ(passes_table().GetLoyaltyCardById("invalid_id"), std::nullopt); +} + +TEST_F(PassesTableTest, AddOrUpdateLoyaltyCard) { + LoyaltyCard card1 = test::CreateLoyaltyCard(); + LoyaltyCard card2 = test::CreateLoyaltyCard2(); + // Add `card1`. + EXPECT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), UnorderedElementsAre(card1)); + // Update `card1`. + card1.loyalty_card_number = "123*321"; + EXPECT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), UnorderedElementsAre(card1)); + // Add `card2`. + EXPECT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card2)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), + UnorderedElementsAre(card1, card2)); +} + +TEST_F(PassesTableTest, RemoveLoyaltyCard) { + const LoyaltyCard card1 = test::CreateLoyaltyCard(); + const LoyaltyCard card2 = test::CreateLoyaltyCard2(); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card2)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), + UnorderedElementsAre(card1, card2)); + EXPECT_TRUE(passes_table().RemoveLoyaltyCard(card1.loyalty_card_id)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), UnorderedElementsAre(card2)); + // Removing a non-existing `loyalty_card_id` shouldn't be considered a + // failure. + EXPECT_TRUE(passes_table().RemoveLoyaltyCard(card1.loyalty_card_id)); +} + +TEST_F(PassesTableTest, ClearLoyaltyCards) { + const LoyaltyCard card1 = test::CreateLoyaltyCard(); + const LoyaltyCard card2 = test::CreateLoyaltyCard2(); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card1)); + ASSERT_TRUE(passes_table().AddOrUpdateLoyaltyCard(card2)); + EXPECT_THAT(passes_table().GetLoyaltyCards(), + UnorderedElementsAre(card1, card2)); + EXPECT_TRUE(passes_table().ClearLoyaltyCards()); + EXPECT_THAT(passes_table().GetLoyaltyCards(), IsEmpty()); +} + +} // namespace + +} // namespace autofill
diff --git a/components/browser_ui/widget/android/java/res/values/colors.xml b/components/browser_ui/widget/android/java/res/values/colors.xml index 6072a6c..7ef66837 100644 --- a/components/browser_ui/widget/android/java/res/values/colors.xml +++ b/components/browser_ui/widget/android/java/res/values/colors.xml
@@ -11,7 +11,6 @@ <color name="toolbar_text_box_background">@color/omnibox_bg_color</color> <macro name="search_box_hint" tools:ignore="UnusedResources">@macro/default_text_color_secondary</macro> <macro name="ntp_search_box_hint" tools:ignore="UnusedResources">@macro/default_text_color</macro> - <color name="search_box_hint_baseline">@color/default_text_color_secondary_baseline</color> <!-- Chip Colors --> <color name="default_chip_assistive_text_color">@color/default_text_color_baseline</color>
diff --git a/components/error_page_strings.grdp b/components/error_page_strings.grdp index b32621b..c49d31db 100644 --- a/components/error_page_strings.grdp +++ b/components/error_page_strings.grdp
@@ -121,6 +121,9 @@ <message name="IDS_ERRORPAGES_MESSAGE_IWA_INSTALLED_IN_DEV_MODE" desc="Message of the error page for when an IWA was installed in Isolated Web App Developer Mode, but that mode was disabled."> To run this app, re-enable Isolated Web App Developer Mode </message> + <message name="IDS_ERRORPAGES_MESSAGE_IWA_PAGE_NOT_FOUND" desc="Message of the error page for when accessing an IWA resource caused HTTP error."> + The page you requested could not be found in the application + </message> <message name="IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE" desc="Heading in the error page when we encountered an error reading from the cache. Generally this happens when the disk cache is corrupted from improper shutdown."> This site can’t be loaded from the cache </message>
diff --git a/components/error_page_strings_grdp/IDS_ERRORPAGES_MESSAGE_IWA_PAGE_NOT_FOUND.png.sha1 b/components/error_page_strings_grdp/IDS_ERRORPAGES_MESSAGE_IWA_PAGE_NOT_FOUND.png.sha1 new file mode 100644 index 0000000..6e01a7d --- /dev/null +++ b/components/error_page_strings_grdp/IDS_ERRORPAGES_MESSAGE_IWA_PAGE_NOT_FOUND.png.sha1
@@ -0,0 +1 @@ +20a90ae13539d57549808963e9c7703451e016c9 \ No newline at end of file
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 89e7fca..4e185f6 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 89e7fca303aaea70284cc77d91f03c69c3883f3e +Subproject commit 4e185f6350b47d631b33b5c5fcb8bc359e402990
diff --git a/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc b/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc index 8049852..2cd04b7 100644 --- a/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc +++ b/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc
@@ -342,6 +342,11 @@ WebDXFeature::kLayoutInstability}, {WebFeature::kJSSelfProfiling, WebDXFeature::kProfiler}, {WebFeature::kZstdContentEncoding, WebDXFeature::kZstd}, + {WebFeature::kColumnPseudoElement, WebDXFeature::kColumnPseudo}, + {WebFeature::kScrollButtonPseudoElement, + WebDXFeature::kScrollButtons}, + {WebFeature::kScrollMarkerPseudoElement, + WebDXFeature::kScrollMarkers}, }}; return *kMap; @@ -353,127 +358,133 @@ WebDXFeature::kLogicalProperties; static const base::NoDestructor< const base::flat_map<CSSSampleId, WebDXFeature>> - kMap{{ - {CSSSampleId::kAccentColor, WebDXFeature::kAccentColor}, - {CSSSampleId::kAnchorName, WebDXFeature::kAnchorPositioning}, - {CSSSampleId::kAnimationComposition, - WebDXFeature::kAnimationComposition}, - {CSSSampleId::kAppearance, WebDXFeature::kAppearance}, - {CSSSampleId::kAspectRatio, WebDXFeature::kAspectRatio}, - {CSSSampleId::kBackdropFilter, WebDXFeature::kBackdropFilter}, - {CSSSampleId::kBorderImage, WebDXFeature::kBorderImage}, - {CSSSampleId::kColorScheme, WebDXFeature::kColorScheme}, - {CSSSampleId::kContainIntrinsicSize, - WebDXFeature::kContainIntrinsicSize}, - {CSSSampleId::kFieldSizing, WebDXFeature::kFieldSizing}, - {CSSSampleId::kFontOpticalSizing, WebDXFeature::kFontOpticalSizing}, - {CSSSampleId::kFontPalette, WebDXFeature::kFontPalette}, - {CSSSampleId::kFontSizeAdjust, WebDXFeature::kFontSizeAdjust}, - {CSSSampleId::kFontSynthesisSmallCaps, - WebDXFeature::kFontSynthesisSmallCaps}, - {CSSSampleId::kFontSynthesisStyle, WebDXFeature::kFontSynthesisStyle}, - {CSSSampleId::kFontSynthesisWeight, - WebDXFeature::kFontSynthesisWeight}, - {CSSSampleId::kFontSynthesis, WebDXFeature::kFontSynthesis}, - {CSSSampleId::kFontVariantAlternates, - WebDXFeature::kFontVariantAlternates}, - {CSSSampleId::kFontVariantEmoji, WebDXFeature::kFontVariantEmoji}, - {CSSSampleId::kHyphens, WebDXFeature::kHyphens}, - {CSSSampleId::kScrollbarColor, WebDXFeature::kScrollbarColor}, - {CSSSampleId::kScrollbarGutter, WebDXFeature::kScrollbarGutter}, - {CSSSampleId::kScrollbarWidth, WebDXFeature::kScrollbarWidth}, - {CSSSampleId::kScrollSnapType, WebDXFeature::kScrollSnap}, - {CSSSampleId::kTextIndent, WebDXFeature::kTextIndent}, - {CSSSampleId::kTextSpacingTrim, WebDXFeature::kTextSpacingTrim}, - {CSSSampleId::kTransitionBehavior, WebDXFeature::kTransitionBehavior}, - {CSSSampleId::kTranslate, WebDXFeature::kIndividualTransforms}, - {CSSSampleId::kRotate, WebDXFeature::kIndividualTransforms}, - {CSSSampleId::kScale, WebDXFeature::kIndividualTransforms}, - {CSSSampleId::kWillChange, WebDXFeature::kWillChange}, - {CSSSampleId::kMaskImage, WebDXFeature::kMasks}, - {CSSSampleId::kMaskClip, WebDXFeature::kMasks}, - {CSSSampleId::kMaskSize, WebDXFeature::kMasks}, - {CSSSampleId::kMaskOrigin, WebDXFeature::kMasks}, - {CSSSampleId::kMaskRepeat, WebDXFeature::kMasks}, - {CSSSampleId::kMaskComposite, WebDXFeature::kMasks}, - {CSSSampleId::kMaskPosition, WebDXFeature::kMasks}, - {CSSSampleId::kMaskMode, WebDXFeature::kMasks}, - {CSSSampleId::kMask, WebDXFeature::kMasks}, - {CSSSampleId::kPaintOrder, WebDXFeature::kPaintOrder}, - {CSSSampleId::kBackgroundClip, WebDXFeature::kBackgroundClipText}, - {CSSSampleId::kContainIntrinsicInlineSize, - WebDXFeature::kContainInlineSize}, - {CSSSampleId::kOverlay, WebDXFeature::kOverlay}, - {CSSSampleId::kContentVisibility, WebDXFeature::kContentVisibility}, - {CSSSampleId::kCounterSet, WebDXFeature::kCounterSet}, - {CSSSampleId::kObjectViewBox, WebDXFeature::kObjectViewBox}, - {CSSSampleId::kForcedColorAdjust, WebDXFeature::kForcedColors}, - {CSSSampleId::kWhiteSpaceCollapse, WebDXFeature::kWhiteSpaceCollapse}, - {CSSSampleId::kImageOrientation, WebDXFeature::kImageOrientation}, - // https://drafts.csswg.org/css-logical-1/ - {CSSSampleId::kBlockSize, logical_properties}, - {CSSSampleId::kInlineSize, logical_properties}, - {CSSSampleId::kMinBlockSize, logical_properties}, - {CSSSampleId::kMaxBlockSize, logical_properties}, - {CSSSampleId::kMinInlineSize, logical_properties}, - {CSSSampleId::kMaxInlineSize, logical_properties}, - {CSSSampleId::kMarginBlockStart, logical_properties}, - {CSSSampleId::kMarginBlockEnd, logical_properties}, - {CSSSampleId::kMarginInlineStart, logical_properties}, - {CSSSampleId::kMarginInlineEnd, logical_properties}, - {CSSSampleId::kInsetBlockStart, logical_properties}, - {CSSSampleId::kInsetBlockEnd, logical_properties}, - {CSSSampleId::kInsetInlineStart, logical_properties}, - {CSSSampleId::kInsetInlineEnd, logical_properties}, - {CSSSampleId::kPaddingBlockStart, logical_properties}, - {CSSSampleId::kPaddingBlockEnd, logical_properties}, - {CSSSampleId::kPaddingInlineStart, logical_properties}, - {CSSSampleId::kPaddingInlineEnd, logical_properties}, - {CSSSampleId::kBorderBlockStartWidth, logical_properties}, - {CSSSampleId::kBorderBlockEndWidth, logical_properties}, - {CSSSampleId::kBorderInlineStartWidth, logical_properties}, - {CSSSampleId::kBorderInlineEndWidth, logical_properties}, - {CSSSampleId::kBorderBlockStartStyle, logical_properties}, - {CSSSampleId::kBorderBlockEndStyle, logical_properties}, - {CSSSampleId::kBorderInlineStartStyle, logical_properties}, - {CSSSampleId::kBorderInlineEndStyle, logical_properties}, - {CSSSampleId::kBorderBlockStartColor, logical_properties}, - {CSSSampleId::kBorderBlockEndColor, logical_properties}, - {CSSSampleId::kBorderInlineStartColor, logical_properties}, - {CSSSampleId::kBorderInlineEndColor, logical_properties}, - {CSSSampleId::kBorderStartStartRadius, logical_properties}, - {CSSSampleId::kBorderEndEndRadius, logical_properties}, - {CSSSampleId::kBorderStartEndRadius, logical_properties}, - {CSSSampleId::kBorderEndStartRadius, logical_properties}, - {CSSSampleId::kFontVariantPosition, - WebDXFeature::kFontVariantPosition}, - {CSSSampleId::kTextEmphasis, WebDXFeature::kTextEmphasis}, - {CSSSampleId::kTextWrap, WebDXFeature::kTextWrap}, - {CSSSampleId::kTextWrapStyle, WebDXFeature::kTextWrapStyle}, - {CSSSampleId::kOffsetPath, WebDXFeature::kMotionPath}, - {CSSSampleId::kOutline, WebDXFeature::kOutline}, - {CSSSampleId::kTransformBox, WebDXFeature::kTransformBox}, - {CSSSampleId::kRubyAlign, WebDXFeature::kRubyAlign}, - {CSSSampleId::kRubyPosition, WebDXFeature::kRubyPosition}, - {CSSSampleId::kInitialLetter, WebDXFeature::kInitialLetter}, - {CSSSampleId::kHyphenateCharacter, WebDXFeature::kHyphenateCharacter}, - {CSSSampleId::kHyphenateLimitChars, - WebDXFeature::kHyphenateLimitChars}, - {CSSSampleId::kQuotes, WebDXFeature::kQuotes}, - {CSSSampleId::kBaselineSource, WebDXFeature::kBaselineSource}, - {CSSSampleId::kClipPath, WebDXFeature::kClipPath}, - {CSSSampleId::kBoxDecorationBreak, WebDXFeature::kBoxDecorationBreak}, - {CSSSampleId::kPageOrientation, WebDXFeature::kPageOrientation}, - {CSSSampleId::kScrollTimeline, WebDXFeature::kScrollDrivenAnimations}, - {CSSSampleId::kScrollTimelineName, - WebDXFeature::kScrollDrivenAnimations}, - {CSSSampleId::kViewTimeline, WebDXFeature::kScrollDrivenAnimations}, - {CSSSampleId::kViewTimelineName, - WebDXFeature::kScrollDrivenAnimations}, - {CSSSampleId::kInterpolateSize, WebDXFeature::kInterpolateSize}, - {CSSSampleId::kViewTransitionClass, - WebDXFeature::kViewTransitionClass}, - }}; + kMap{{{CSSSampleId::kAccentColor, WebDXFeature::kAccentColor}, + {CSSSampleId::kAnchorName, WebDXFeature::kAnchorPositioning}, + {CSSSampleId::kAnimationComposition, + WebDXFeature::kAnimationComposition}, + {CSSSampleId::kAppearance, WebDXFeature::kAppearance}, + {CSSSampleId::kAspectRatio, WebDXFeature::kAspectRatio}, + {CSSSampleId::kBackdropFilter, WebDXFeature::kBackdropFilter}, + {CSSSampleId::kBorderImage, WebDXFeature::kBorderImage}, + {CSSSampleId::kColorScheme, WebDXFeature::kColorScheme}, + {CSSSampleId::kContainIntrinsicSize, + WebDXFeature::kContainIntrinsicSize}, + {CSSSampleId::kFieldSizing, WebDXFeature::kFieldSizing}, + {CSSSampleId::kFontOpticalSizing, WebDXFeature::kFontOpticalSizing}, + {CSSSampleId::kFontPalette, WebDXFeature::kFontPalette}, + {CSSSampleId::kFontSizeAdjust, WebDXFeature::kFontSizeAdjust}, + {CSSSampleId::kFontSynthesisSmallCaps, + WebDXFeature::kFontSynthesisSmallCaps}, + {CSSSampleId::kFontSynthesisStyle, + WebDXFeature::kFontSynthesisStyle}, + {CSSSampleId::kFontSynthesisWeight, + WebDXFeature::kFontSynthesisWeight}, + {CSSSampleId::kFontSynthesis, WebDXFeature::kFontSynthesis}, + {CSSSampleId::kFontVariantAlternates, + WebDXFeature::kFontVariantAlternates}, + {CSSSampleId::kFontVariantEmoji, WebDXFeature::kFontVariantEmoji}, + {CSSSampleId::kHyphens, WebDXFeature::kHyphens}, + {CSSSampleId::kScrollbarColor, WebDXFeature::kScrollbarColor}, + {CSSSampleId::kScrollbarGutter, WebDXFeature::kScrollbarGutter}, + {CSSSampleId::kScrollbarWidth, WebDXFeature::kScrollbarWidth}, + {CSSSampleId::kScrollSnapType, WebDXFeature::kScrollSnap}, + {CSSSampleId::kTextIndent, WebDXFeature::kTextIndent}, + {CSSSampleId::kTextSpacingTrim, WebDXFeature::kTextSpacingTrim}, + {CSSSampleId::kTransitionBehavior, + WebDXFeature::kTransitionBehavior}, + {CSSSampleId::kTranslate, WebDXFeature::kIndividualTransforms}, + {CSSSampleId::kRotate, WebDXFeature::kIndividualTransforms}, + {CSSSampleId::kScale, WebDXFeature::kIndividualTransforms}, + {CSSSampleId::kWillChange, WebDXFeature::kWillChange}, + {CSSSampleId::kMaskImage, WebDXFeature::kMasks}, + {CSSSampleId::kMaskClip, WebDXFeature::kMasks}, + {CSSSampleId::kMaskSize, WebDXFeature::kMasks}, + {CSSSampleId::kMaskOrigin, WebDXFeature::kMasks}, + {CSSSampleId::kMaskRepeat, WebDXFeature::kMasks}, + {CSSSampleId::kMaskComposite, WebDXFeature::kMasks}, + {CSSSampleId::kMaskPosition, WebDXFeature::kMasks}, + {CSSSampleId::kMaskMode, WebDXFeature::kMasks}, + {CSSSampleId::kMask, WebDXFeature::kMasks}, + {CSSSampleId::kPaintOrder, WebDXFeature::kPaintOrder}, + {CSSSampleId::kBackgroundClip, WebDXFeature::kBackgroundClipText}, + {CSSSampleId::kContainIntrinsicInlineSize, + WebDXFeature::kContainInlineSize}, + {CSSSampleId::kOverlay, WebDXFeature::kOverlay}, + {CSSSampleId::kContentVisibility, WebDXFeature::kContentVisibility}, + {CSSSampleId::kCounterSet, WebDXFeature::kCounterSet}, + {CSSSampleId::kObjectViewBox, WebDXFeature::kObjectViewBox}, + {CSSSampleId::kForcedColorAdjust, WebDXFeature::kForcedColors}, + {CSSSampleId::kWhiteSpaceCollapse, + WebDXFeature::kWhiteSpaceCollapse}, + {CSSSampleId::kImageOrientation, WebDXFeature::kImageOrientation}, + // https://drafts.csswg.org/css-logical-1/ + {CSSSampleId::kBlockSize, logical_properties}, + {CSSSampleId::kInlineSize, logical_properties}, + {CSSSampleId::kMinBlockSize, logical_properties}, + {CSSSampleId::kMaxBlockSize, logical_properties}, + {CSSSampleId::kMinInlineSize, logical_properties}, + {CSSSampleId::kMaxInlineSize, logical_properties}, + {CSSSampleId::kMarginBlockStart, logical_properties}, + {CSSSampleId::kMarginBlockEnd, logical_properties}, + {CSSSampleId::kMarginInlineStart, logical_properties}, + {CSSSampleId::kMarginInlineEnd, logical_properties}, + {CSSSampleId::kInsetBlockStart, logical_properties}, + {CSSSampleId::kInsetBlockEnd, logical_properties}, + {CSSSampleId::kInsetInlineStart, logical_properties}, + {CSSSampleId::kInsetInlineEnd, logical_properties}, + {CSSSampleId::kPaddingBlockStart, logical_properties}, + {CSSSampleId::kPaddingBlockEnd, logical_properties}, + {CSSSampleId::kPaddingInlineStart, logical_properties}, + {CSSSampleId::kPaddingInlineEnd, logical_properties}, + {CSSSampleId::kBorderBlockStartWidth, logical_properties}, + {CSSSampleId::kBorderBlockEndWidth, logical_properties}, + {CSSSampleId::kBorderInlineStartWidth, logical_properties}, + {CSSSampleId::kBorderInlineEndWidth, logical_properties}, + {CSSSampleId::kBorderBlockStartStyle, logical_properties}, + {CSSSampleId::kBorderBlockEndStyle, logical_properties}, + {CSSSampleId::kBorderInlineStartStyle, logical_properties}, + {CSSSampleId::kBorderInlineEndStyle, logical_properties}, + {CSSSampleId::kBorderBlockStartColor, logical_properties}, + {CSSSampleId::kBorderBlockEndColor, logical_properties}, + {CSSSampleId::kBorderInlineStartColor, logical_properties}, + {CSSSampleId::kBorderInlineEndColor, logical_properties}, + {CSSSampleId::kBorderStartStartRadius, logical_properties}, + {CSSSampleId::kBorderEndEndRadius, logical_properties}, + {CSSSampleId::kBorderStartEndRadius, logical_properties}, + {CSSSampleId::kBorderEndStartRadius, logical_properties}, + {CSSSampleId::kFontVariantPosition, + WebDXFeature::kFontVariantPosition}, + {CSSSampleId::kTextEmphasis, WebDXFeature::kTextEmphasis}, + {CSSSampleId::kTextWrap, WebDXFeature::kTextWrap}, + {CSSSampleId::kTextWrapStyle, WebDXFeature::kTextWrapStyle}, + {CSSSampleId::kOffsetPath, WebDXFeature::kMotionPath}, + {CSSSampleId::kOutline, WebDXFeature::kOutline}, + {CSSSampleId::kTransformBox, WebDXFeature::kTransformBox}, + {CSSSampleId::kRubyAlign, WebDXFeature::kRubyAlign}, + {CSSSampleId::kRubyPosition, WebDXFeature::kRubyPosition}, + {CSSSampleId::kInitialLetter, WebDXFeature::kInitialLetter}, + {CSSSampleId::kHyphenateCharacter, + WebDXFeature::kHyphenateCharacter}, + {CSSSampleId::kHyphenateLimitChars, + WebDXFeature::kHyphenateLimitChars}, + {CSSSampleId::kQuotes, WebDXFeature::kQuotes}, + {CSSSampleId::kBaselineSource, WebDXFeature::kBaselineSource}, + {CSSSampleId::kClipPath, WebDXFeature::kClipPath}, + {CSSSampleId::kBoxDecorationBreak, + WebDXFeature::kBoxDecorationBreak}, + {CSSSampleId::kPageOrientation, WebDXFeature::kPageOrientation}, + {CSSSampleId::kScrollTimeline, + WebDXFeature::kScrollDrivenAnimations}, + {CSSSampleId::kScrollTimelineName, + WebDXFeature::kScrollDrivenAnimations}, + {CSSSampleId::kViewTimeline, WebDXFeature::kScrollDrivenAnimations}, + {CSSSampleId::kViewTimelineName, + WebDXFeature::kScrollDrivenAnimations}, + {CSSSampleId::kInterpolateSize, WebDXFeature::kInterpolateSize}, + {CSSSampleId::kViewTransitionClass, + WebDXFeature::kViewTransitionClass}, + {CSSSampleId::kScrollMarkerGroup, WebDXFeature::kScrollMarkers}, + {CSSSampleId::kInteractivity, WebDXFeature::kInteractivity}}}; return *kMap; }
diff --git a/components/policy/core/common/cloud/enterprise_metrics.h b/components/policy/core/common/cloud/enterprise_metrics.h index b4aedbc..8c1df7c 100644 --- a/components/policy/core/common/cloud/enterprise_metrics.h +++ b/components/policy/core/common/cloud/enterprise_metrics.h
@@ -469,8 +469,6 @@ // Suffixes added to kUMAStateDeterminationTotalDurationByState. inline constexpr char kUMASuffixConnectionError[] = ".ConnectionError"; -inline constexpr char kUMASuffixMachineInfoRetrievalError[] = - ".MachineInfoRetrievalError"; inline constexpr char kUMASuffixStateKeysRetrievalError[] = ".StateKeysRetrievalError"; inline constexpr char kUMASuffixDisabled[] = ".Disabled";
diff --git a/components/sync/service/sync_prefs.cc b/components/sync/service/sync_prefs.cc index 99b9df9..ec2ce07 100644 --- a/components/sync/service/sync_prefs.cc +++ b/components/sync/service/sync_prefs.cc
@@ -402,25 +402,6 @@ return false; } -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -int SyncPrefs::GetNumberOfAccountsWithPasswordsSelected() const { - int n_accounts = 0; - for (auto [serialized_gaia_id_hash, selected_types] : - pref_service_->GetDict(prefs::internal::kSelectedTypesPerAccount)) { - // `selected_types` should be a dict but doesn't hurt to check and be safe. - bool enabled = - selected_types.is_dict() && - selected_types.GetDict() - .FindBool(GetPrefNameForType(UserSelectableType::kPasswords)) - .value_or(false); - if (enabled) { - n_accounts++; - } - } - return n_accounts; -} -#endif - void SyncPrefs::SetSelectedTypesForSyncingUser( bool keep_everything_synced, UserSelectableTypeSet registered_types,
diff --git a/components/sync/service/sync_prefs.h b/components/sync/service/sync_prefs.h index 5e9aad8e..13fd44f 100644 --- a/components/sync/service/sync_prefs.h +++ b/components/sync/service/sync_prefs.h
@@ -125,12 +125,6 @@ bool IsTypeDisabledByUserForAccount(const UserSelectableType type, const signin::GaiaIdHash& gaia_id_hash); -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - // On Desktop, kPasswords isn't considered "selected" by default in transport - // mode. This method returns how many accounts selected (enabled) the type. - int GetNumberOfAccountsWithPasswordsSelected() const; -#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - // Sets the selection state for all `registered_types` and "keep everything // synced" flag. // `keep_everything_synced` indicates that all current and future types
diff --git a/components/sync/service/sync_prefs_unittest.cc b/components/sync/service/sync_prefs_unittest.cc index 8cd57efe..128b737 100644 --- a/components/sync/service/sync_prefs_unittest.cc +++ b/components/sync/service/sync_prefs_unittest.cc
@@ -803,33 +803,6 @@ EXPECT_EQ(0, sync_prefs_->GetPassphrasePromptMutedProductVersion()); } -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -TEST_F(SyncPrefsTest, GetNumberOfAccountsWithPasswordsSelected) { - EXPECT_EQ(sync_prefs_->GetNumberOfAccountsWithPasswordsSelected(), 0); - - sync_prefs_->SetSelectedTypeForAccount(UserSelectableType::kPasswords, true, - gaia_id_hash_); - - EXPECT_EQ(sync_prefs_->GetNumberOfAccountsWithPasswordsSelected(), 1); - - const auto other_gaia_id_hash = - signin::GaiaIdHash::FromGaiaId(GaiaId("other")); - sync_prefs_->SetSelectedTypeForAccount(UserSelectableType::kPasswords, true, - other_gaia_id_hash); - - EXPECT_EQ(sync_prefs_->GetNumberOfAccountsWithPasswordsSelected(), 2); - - sync_prefs_->SetSelectedTypeForAccount(UserSelectableType::kPasswords, false, - gaia_id_hash_); - - EXPECT_EQ(sync_prefs_->GetNumberOfAccountsWithPasswordsSelected(), 1); - - sync_prefs_->KeepAccountSettingsPrefsOnlyForUsers({}); - - EXPECT_EQ(sync_prefs_->GetNumberOfAccountsWithPasswordsSelected(), 0); -} -#endif - TEST_F(SyncPrefsTest, PasswordSyncAllowed_DefaultValue) { // Passwords is in its default state. For syncing users, it's enabled. For // non-syncing users, it depends on the platform.
diff --git a/components/sync/service/sync_user_settings.h b/components/sync/service/sync_user_settings.h index 058b1f8..4d57cd1 100644 --- a/components/sync/service/sync_user_settings.h +++ b/components/sync/service/sync_user_settings.h
@@ -74,13 +74,6 @@ virtual SyncUserSettings::UserSelectableTypePrefState GetTypePrefStateForAccount(UserSelectableType type) const = 0; -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - // On Desktop, kPasswords isn't considered "selected" by default in transport - // mode. This method returns how many accounts selected (enabled) the type. - // TODO(crbug.com/40944135): Remove this once the type is enabled by default. - virtual int GetNumberOfAccountsWithPasswordsSelected() const = 0; -#endif - // Whether the "Sync everything" is enabled. This only has an effect if // Sync-the-feature is enabled. Note that even if this is true, some types may // be disabled e.g. due to enterprise policy.
diff --git a/components/sync/service/sync_user_settings_impl.cc b/components/sync/service/sync_user_settings_impl.cc index 4142440..295722f8c 100644 --- a/components/sync/service/sync_user_settings_impl.cc +++ b/components/sync/service/sync_user_settings_impl.cc
@@ -159,12 +159,6 @@ return SyncUserSettings::UserSelectableTypePrefState::kEnabledOrDefault; } -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -int SyncUserSettingsImpl::GetNumberOfAccountsWithPasswordsSelected() const { - return prefs_->GetNumberOfAccountsWithPasswordsSelected(); -} -#endif - void SyncUserSettingsImpl::SetSelectedTypes(bool sync_everything, UserSelectableTypeSet types) { UserSelectableTypeSet registered_types = GetRegisteredSelectableTypes();
diff --git a/components/sync/service/sync_user_settings_impl.h b/components/sync/service/sync_user_settings_impl.h index 6829ae9..287c0ac 100644 --- a/components/sync/service/sync_user_settings_impl.h +++ b/components/sync/service/sync_user_settings_impl.h
@@ -69,9 +69,6 @@ bool IsTypeManagedByCustodian(UserSelectableType type) const override; SyncUserSettings::UserSelectableTypePrefState GetTypePrefStateForAccount( UserSelectableType type) const override; -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - int GetNumberOfAccountsWithPasswordsSelected() const override; -#endif void SetSelectedTypes(bool sync_everything, UserSelectableTypeSet types) override; void SetSelectedType(UserSelectableType type, bool is_type_on) override;
diff --git a/components/sync/test/sync_user_settings_mock.h b/components/sync/test/sync_user_settings_mock.h index 0f4fa68..0d618a7 100644 --- a/components/sync/test/sync_user_settings_mock.h +++ b/components/sync/test/sync_user_settings_mock.h
@@ -41,12 +41,6 @@ GetTypePrefStateForAccount, (UserSelectableType), (const override)); -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - MOCK_METHOD(int, - GetNumberOfAccountsWithPasswordsSelected, - (), - (const override)); -#endif MOCK_METHOD(void, SetSelectedTypes, (bool, UserSelectableTypeSet),
diff --git a/components/sync/test/test_sync_user_settings.cc b/components/sync/test/test_sync_user_settings.cc index f0a6840..0d9c3d8e 100644 --- a/components/sync/test/test_sync_user_settings.cc +++ b/components/sync/test/test_sync_user_settings.cc
@@ -110,12 +110,6 @@ return SyncUserSettings::UserSelectableTypePrefState::kDisabled; } -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -int TestSyncUserSettings::GetNumberOfAccountsWithPasswordsSelected() const { - return selected_types_.Has(UserSelectableType::kPasswords) ? 1 : 0; -} -#endif - DataTypeSet TestSyncUserSettings::GetPreferredDataTypes() const { DataTypeSet types = UserSelectableTypesToDataTypes(GetSelectedTypes()); types.PutAll(AlwaysPreferredUserTypes());
diff --git a/components/sync/test/test_sync_user_settings.h b/components/sync/test/test_sync_user_settings.h index e86d0faf..8e97ed8 100644 --- a/components/sync/test/test_sync_user_settings.h +++ b/components/sync/test/test_sync_user_settings.h
@@ -40,9 +40,6 @@ bool IsTypeManagedByCustodian(UserSelectableType type) const override; SyncUserSettings::UserSelectableTypePrefState GetTypePrefStateForAccount( UserSelectableType type) const override; -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) - int GetNumberOfAccountsWithPasswordsSelected() const override; -#endif void SetSelectedTypes(bool sync_everything, UserSelectableTypeSet types) override; void SetSelectedType(UserSelectableType type, bool is_type_on) override;
diff --git a/components/user_manager/test_helper.cc b/components/user_manager/test_helper.cc index 53bea6e..dd2e916 100644 --- a/components/user_manager/test_helper.cc +++ b/components/user_manager/test_helper.cc
@@ -42,6 +42,18 @@ } // static +void TestHelper::RegisterPublicAccountUser(PrefService& local_state, + std::string_view user_id) { + auto type = policy::GetDeviceLocalAccountType(user_id); + CHECK_EQ(type, policy::DeviceLocalAccountType::kPublicSession) + << user_id << " did not satisfy to be used for a public account user. " + << "See policy::GetDeviceLocalAccountType for details"; + ScopedListPrefUpdate update(&local_state, + prefs::kDeviceLocalAccountsWithSavedData); + update->Append(user_id); +} + +// static std::string TestHelper::GetFakeUsernameHash(const AccountId& account_id) { CHECK(account_id.is_valid()); return ash::UserDataAuthClient::GetStubSanitizedUsername( @@ -91,6 +103,25 @@ return nullptr; } + return AddDeviceLocalAccountUserInternal(user_id, UserType::kKioskApp); +} + +User* TestHelper::AddPublicAccountUser(std::string_view user_id) { + // Quick check that the `user_id` satisfies kiosk-app type. + auto type = policy::GetDeviceLocalAccountType(user_id); + if (type != policy::DeviceLocalAccountType::kPublicSession) { + LOG(ERROR) + << "user_id (" << user_id << ") did not satisfy to be used for " + << "a public account user. See policy::GetDeviceLocalAccountType " + << "for details."; + return nullptr; + } + + return AddDeviceLocalAccountUserInternal(user_id, UserType::kPublicAccount); +} + +User* TestHelper::AddDeviceLocalAccountUserInternal(std::string_view user_id, + UserType user_type) { // Build DeviceLocalAccountInfo for the existing users. std::vector<UserManager::DeviceLocalAccountInfo> device_local_accounts; for (const auto& user : user_manager_->GetPersistedUsers()) { @@ -110,7 +141,7 @@ } // Add the given `user_id`. - device_local_accounts.emplace_back(std::string(user_id), UserType::kKioskApp); + device_local_accounts.emplace_back(std::string(user_id), user_type); user_manager_->UpdateDeviceLocalAccountUser(device_local_accounts); return user_manager_->FindUserAndModify(AccountId::FromUserEmail(user_id)); }
diff --git a/components/user_manager/test_helper.h b/components/user_manager/test_helper.h index 5e1ceeb..df5d3485 100644 --- a/components/user_manager/test_helper.h +++ b/components/user_manager/test_helper.h
@@ -34,6 +34,10 @@ static void RegisterKioskAppUser(PrefService& local_state, std::string_view user_id); + // Records the `user_id` as a Public Account user to the given `local_state`. + static void RegisterPublicAccountUser(PrefService& local_state, + std::string_view user_id); + // Returns the fake username hash for testing. // Valid AccountId must be used, otherwise CHECKed. static std::string GetFakeUsernameHash(const AccountId& account_id); @@ -52,12 +56,18 @@ // On failure, returns nullptr. [[nodiscard]] User* AddGuestUser(); + // Creates and adds a new PublicAccount user, and returns it. + // On failure, returns nullptr. + [[nodiscard]] User* AddPublicAccountUser(std::string_view user_id); + // Creates and adds a new Kiosk user, and returns it. // On failure, returns nullptr. [[nodiscard]] User* AddKioskAppUser(std::string_view user_id); private: User* AddUserInternal(const AccountId& account_id, UserType user_type); + User* AddDeviceLocalAccountUserInternal(std::string_view user_id, + UserType user_type); raw_ref<UserManager> user_manager_; };
diff --git a/content/browser/buckets/OWNERS b/content/browser/buckets/OWNERS index 5ddb620..0ec608e7 100644 --- a/content/browser/buckets/OWNERS +++ b/content/browser/buckets/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/content/browser/cache_storage/OWNERS b/content/browser/cache_storage/OWNERS index 819b5f1..54f6ede 100644 --- a/content/browser/cache_storage/OWNERS +++ b/content/browser/cache_storage/OWNERS
@@ -3,6 +3,7 @@ horo@chromium.org jkarlin@chromium.org jsbell@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org wanderview@chromium.org
diff --git a/content/browser/cookie_store/OWNERS b/content/browser/cookie_store/OWNERS index d928613..20d73976 100644 --- a/content/browser/cookie_store/OWNERS +++ b/content/browser/cookie_store/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/content/browser/devtools/devtools_instrumentation.cc b/content/browser/devtools/devtools_instrumentation.cc index 1ddac74..27da5e4 100644 --- a/content/browser/devtools/devtools_instrumentation.cc +++ b/content/browser/devtools/devtools_instrumentation.cc
@@ -765,12 +765,17 @@ return; } + // See a comment in `PreloadingDecider::ctor()`. + auto* devtools_preload_storage = + DevToolsPreloadStorage::GetForCurrentDocument(ftn->current_frame_host()); + if (!devtools_preload_storage) { + return; + } + // We update DevToolsPreloadStorage, even if there are no active DevTools // sessions, to persist the latest status update. - DevToolsPreloadStorage::GetOrCreateForCurrentDocument( - ftn->current_frame_host()) - ->UpdatePrefetchStatus(prefetch_url, preload_pipeline_id, status, - prefetch_status, request_id); + devtools_preload_storage->UpdatePrefetchStatus( + prefetch_url, preload_pipeline_id, status, prefetch_status, request_id); std::string initiating_frame_id = ftn->current_frame_host()->devtools_frame_token().ToString(); @@ -875,13 +880,18 @@ return; } + // See a comment in `PreloadingDecider::ctor()`. + auto* devtools_preload_storage = + DevToolsPreloadStorage::GetForCurrentDocument(ftn->current_frame_host()); + if (!devtools_preload_storage) { + return; + } + // We update DevToolsPreloadStorage, even if there are no active DevTools // sessions, to persist the latest status update. - DevToolsPreloadStorage::GetOrCreateForCurrentDocument( - ftn->current_frame_host()) - ->UpdatePrerenderStatus(prerender_url, target_hint, preload_pipeline_id, - status, prerender_status, - disallowed_mojo_interface, mismatched_headers); + devtools_preload_storage->UpdatePrerenderStatus( + prerender_url, target_hint, preload_pipeline_id, status, prerender_status, + disallowed_mojo_interface, mismatched_headers); DispatchToAgents(ftn, &protocol::PreloadHandler::DidUpdatePrerenderStatus, initiator_devtools_navigation_token, prerender_url,
diff --git a/content/browser/dom_storage/OWNERS b/content/browser/dom_storage/OWNERS index 963c080..de5eaeb 100644 --- a/content/browser/dom_storage/OWNERS +++ b/content/browser/dom_storage/OWNERS
@@ -2,6 +2,7 @@ dmurph@chromium.org fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/content/browser/file_system_access/OWNERS b/content/browser/file_system_access/OWNERS index 8d2512f..3398c89 100644 --- a/content/browser/file_system_access/OWNERS +++ b/content/browser/file_system_access/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rahsin@microsoft.com rakina@chromium.org
diff --git a/content/browser/indexed_db/OWNERS b/content/browser/indexed_db/OWNERS index 959cce6..84c21a4 100644 --- a/content/browser/indexed_db/OWNERS +++ b/content/browser/indexed_db/OWNERS
@@ -2,6 +2,7 @@ estade@chromium.org fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org stevebe@microsoft.com
diff --git a/content/browser/locks/OWNERS b/content/browser/locks/OWNERS index c8643de..a88a417 100644 --- a/content/browser/locks/OWNERS +++ b/content/browser/locks/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/content/browser/preloading/preloading_decider.cc b/content/browser/preloading/preloading_decider.cc index 15ec0e94..5725bbb 100644 --- a/content/browser/preloading/preloading_decider.cc +++ b/content/browser/preloading/preloading_decider.cc
@@ -15,6 +15,7 @@ #include "base/numerics/safe_conversions.h" #include "base/strings/string_split.h" #include "content/browser/devtools/devtools_instrumentation.h" +#include "content/browser/devtools/devtools_preload_storage.h" #include "content/browser/preloading/prefetch/no_vary_search_helper.h" #include "content/browser/preloading/prefetch/prefetch_document_manager.h" #include "content/browser/preloading/prefetch/prefetch_params.h" @@ -193,6 +194,49 @@ prerenderer_->SetPrerenderCancellationCallback( base::BindRepeating(&OnPrerenderCanceled, rfh->GetWeakDocumentPtr())); + + // Forcibly create `DevToolsPreloadStorage` before we use it in + // `devtools_instrumentation`. + // + // For more details, see + // https://docs.google.com/document/d/1ZP7lYrtqZL9jC2xXieNY_UBMJL1sCrfmzTB8K6v4sD4/edit?resourcekey=0-fkbeQhkT3PhBb9FnnPgnZA&tab=t.e4x3d1nxzmy3#heading=h.4lvl0yr9vmh7 + // + // We found that there is a case that + // `devtools_instrumentation::DidUpdatePrerenderStatus()` in the same stack + // that called `DocumentAssociatedData::dtor()`. The former needs an instance + // of `DevToolsPreloadStorage`. If we call + // `DevToolsPreloadStorage::GetOrCreateForCurrentDocument()` there, the call + // may try to create an instance, but it is forbidden as the holder + // `DocumentAssociatedData` is in dtor and will crash. + // + // To mitigate this crash, we'll call `GetOrCreateForCurrentDocument()` here + // and use `GetForCurrentDocument()` in + // `devtools_instrumentation::DidUpdatePrerenderStatus()`. + // + // This works because: + // + // - The issue happens only on speculation rules preload, not + // browser-initiated preloads. This is because browser-initiated preloads + // don't emit CDP events as they don't have an initiator document, thus + // don't use `DevToolsPreloadStorage`. This is guaranteed by + // `DevToolsPrerenderAttempt::SetFailureReason()`. Therefore, we do this + // workaround in `PreloadingDecider`, not the common layer. + // So, we can assume that the below + // `DevToolsPreloadStorage::GetOrCreateForCurrentDocument()` is called and + // an instance basically exists. + // - `SupportsUserData::ClearAllUserData()` (which is called from + // `DocumentAssociatedData::dtor()`) swaps user data with an empty map and + // then drops the swapped map at the end of scope, which calls each dtor. + // https://source.chromium.org/chromium/chromium/src/+/main:base/supports_user_data.cc;l=142;drc=5f14562c01775211a40ebc3056d0a773c3569008 + // So, `DevToolsPreloadStorage::GetForCurrentDocument()` returns non null + // pointer iff the call is before `DocumentAssociatedData::dtor()` call. We + // can branch by the condition. + // + // Note that this is just a short-term fix. We are planning to fix the root + // cause. + // + // TODO(crbug.com/394631076): Fix the root cause and revert this. + DevToolsPreloadStorage::GetOrCreateForCurrentDocument(rfh); } PreloadingDecider::~PreloadingDecider() = default;
diff --git a/content/browser/renderer_host/navigator_unittest.cc b/content/browser/renderer_host/navigator_unittest.cc index 4c9adae6c..5f982718 100644 --- a/content/browser/renderer_host/navigator_unittest.cc +++ b/content/browser/renderer_host/navigator_unittest.cc
@@ -418,6 +418,9 @@ const GURL kUrl2("http://www.chromium.org/"); contents()->NavigateAndCommit(kUrl1); + // This test assumes a beforeunload handler is present. + main_test_rfh()->SuddenTerminationDisablerChanged( + true, blink::mojom::SuddenTerminationDisablerType::kBeforeUnloadHandler); // Start a new navigation. FrameTreeNode* node = main_test_rfh()->frame_tree_node(); @@ -451,6 +454,9 @@ FrameTreeNode* root_node = contents()->GetPrimaryFrameTree().root(); TestRenderFrameHost* subframe_rfh = main_test_rfh()->AppendChild("Child"); ASSERT_TRUE(subframe_rfh); + // This test assumes a beforeunload handler is present on the subframe. + subframe_rfh->SuddenTerminationDisablerChanged( + true, blink::mojom::SuddenTerminationDisablerType::kBeforeUnloadHandler); // Start a navigation at the subframe. FrameTreeNode* subframe_node = subframe_rfh->frame_tree_node();
diff --git a/content/browser/service_worker/service_worker_client_utils.cc b/content/browser/service_worker/service_worker_client_utils.cc index 996615ea..04fa009 100644 --- a/content/browser/service_worker/service_worker_client_utils.cc +++ b/content/browser/service_worker/service_worker_client_utils.cc
@@ -13,6 +13,7 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/location.h" +#include "base/metrics/histogram_functions.h" #include "base/task/sequenced_task_runner.h" #include "base/task/single_thread_task_runner.h" #include "base/time/time.h" @@ -223,7 +224,11 @@ url::Origin::Create(controller->script_url()); auto* rfh = RenderFrameHostImpl::FromID(service_worker_client.GetRenderFrameHostId()); - if (!controller_origin.IsSameOriginWith(rfh->GetLastCommittedOrigin())) { + if (!controller_origin.IsSameOriginWith(rfh->GetLastCommittedOrigin()) + // TODO(crbug.com/396502398): find the reason why `Clients.matchAll()` + // is called by the Chrome extension ServiceWorker, and remove the + // following condition. + && controller_origin.scheme() != "chrome-extension") { SCOPED_CRASH_KEY_STRING256("AddWindowClient", "ctrler_origin", controller_origin.GetURL().spec()); SCOPED_CRASH_KEY_STRING256("AddWindowClient", "rfh_origin", @@ -325,6 +330,11 @@ AddNonWindowClient(*controllee.second, options->client_type, &clients); } } + if (controller->script_url().SchemeIs("chrome-extension")) { + base::UmaHistogramCounts1000( + "ServiceWorker.GetClients.ExtensionController.AllClients", + clients.size()); + } DidGetClients(std::move(callback), std::move(clients)); } @@ -339,6 +349,11 @@ std::move(clients)); return; } + if (controller->script_url().SchemeIs("chrome-extension")) { + base::UmaHistogramCounts1000( + "ServiceWorker.GetClients.ExtensionController.WindowClients", + clients.size()); + } DidGetClients(std::move(callback), std::move(clients)); }
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index eac2c8e..77f7237 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -1377,6 +1377,9 @@ GTEST_SKIP(); } DisableProactiveBrowsingInstanceSwapFor(orig_rfh); + // This test assumes a beforeunload handler is present. + orig_rfh->SuddenTerminationDisablerChanged( + true, blink::mojom::SuddenTerminationDisablerType::kBeforeUnloadHandler); auto same_site_navigation = NavigationSimulator::CreateRendererInitiated( kSameSiteUrl, main_test_rfh()); same_site_navigation->SetHasUserGesture(false);
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index f4ae86c..64baded 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -3178,7 +3178,8 @@ DCHECK_NE(commit_params->http_response_code, -1); GetContentClient()->renderer()->PrepareErrorPageForHttpStatusError( this, error, navigation_params->http_method.Ascii(), - commit_params->http_response_code, nullptr, error_html_ptr); + commit_params->http_response_code, + std::move(alternative_error_page_info), error_html_ptr); } else { if (error_page_content) { error_html = error_page_content.value();
diff --git a/content/services/auction_worklet/set_priority_signals_override_bindings.h b/content/services/auction_worklet/set_priority_signals_override_bindings.h index cb0d711..abc25e36 100644 --- a/content/services/auction_worklet/set_priority_signals_override_bindings.h +++ b/content/services/auction_worklet/set_priority_signals_override_bindings.h
@@ -24,9 +24,10 @@ class SetPrioritySignalsOverrideBindings : public Bindings { public: explicit SetPrioritySignalsOverrideBindings(AuctionV8Helper* v8_helper); - SetPrioritySignalsOverrideBindings(const SetPriorityBindings&) = delete; - SetPrioritySignalsOverrideBindings& operator=(const SetPriorityBindings&) = - delete; + SetPrioritySignalsOverrideBindings( + const SetPrioritySignalsOverrideBindings&) = delete; + SetPrioritySignalsOverrideBindings& operator=( + const SetPrioritySignalsOverrideBindings&) = delete; ~SetPrioritySignalsOverrideBindings() override; // Add report method to global context. `this` must outlive the context.
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 5220bd5..e065d6e7 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -443,15 +443,9 @@ #################### crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/glsl/samplers/glsl-function-texture2dproj.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html [ Failure ] crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/gl-teximage.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/image-decoder-to-texture.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texparameter-test.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texture-active-bind-2.html [ Failure ] crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texture-active-bind.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texture-npot.html [ Failure ] crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texture-srgb-upload.html [ Failure ] -crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/texture-video-transparent.html [ Failure ] crbug.com/1490427 [ fuchsia fuchsia-board-qemu-x64 ] conformance/textures/misc/tex-video-using-tex-unit-non-zero.html [ Failure ] crbug.com/1490427 [ angle-vulkan arm fuchsia fuchsia-board-nelson web-engine-shell ] conformance/canvas/drawingbuffer-static-canvas-test.html [ Failure ] crbug.com/1490427 [ angle-vulkan arm fuchsia fuchsia-board-nelson web-engine-shell ] conformance/rendering/rendering-stencil-large-viewport.html [ Failure ] @@ -522,13 +516,11 @@ crbug.com/642822 [ mac amd ] conformance/rendering/clipping-wide-points.html [ Failure ] crbug.com/1230781 [ mac amd angle-opengl ] conformance/canvas/to-data-url-test.html [ Failure ] crbug.com/328100306 [ amd angle-metal sonoma ] conformance/glsl/bugs/sampler-array-using-loop-index.html [ Failure ] -crbug.com/328102507 [ amd-0x7340 angle-opengl asan graphite-disabled mac-x86_64 oop-c release sonoma ] conformance/renderbuffers/stencil-renderbuffer-initialization.html [ Failure ] crbug.com/328102507 [ amd-0x7340 angle-opengl debug graphite-disabled mac-x86_64 no-asan oop-c sonoma ] conformance/renderbuffers/stencil-renderbuffer-initialization.html [ Failure ] crbug.com/354627705 [ mac amd-0x7340 angle-opengl ] conformance/context/context-attributes-alpha-depth-stencil-antialias.html [ Failure ] crbug.com/354627705 [ mac amd-0x7340 angle-metal ] conformance/extensions/webgl-polygon-mode.html [ Failure ] crbug.com/354627705 [ mac amd-0x7340 angle-opengl ] conformance/rendering/color-mask-preserved-during-implicit-clears.html [ Failure ] crbug.com/382090956 [ mac amd angle-metal ] deqp/data/gles2/shaders/conversions_vector_to_vector.html [ RetryOnFailure ] -crbug.com/angleproject/389733590 [ mac amd angle-metal debug ] conformance/extensions/khr-parallel-shader-compile.html [ RetryOnFailure ] ## Mac Retina NVidia failures / flakes ## @@ -637,10 +629,8 @@ crbug.com/1372149 [ android android-sm-a236b no-passthrough ] conformance/rendering/blending.html [ Failure ] crbug.com/40241618 [ android android-sm-s911u1 no-passthrough ] conformance/rendering/blending.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough renderer-skia-vulkan ] conformance/extensions/ext-color-buffer-half-float.html [ Failure ] -crbug.com/40939890 [ android android-sm-s911u1 no-passthrough renderer-skia-vulkan ] conformance/extensions/ext-color-buffer-half-float.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough ] conformance/extensions/oes-texture-float-with-video.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough renderer-skia-vulkan ] conformance/extensions/oes-texture-float.html [ Failure ] -crbug.com/40939890 [ android android-sm-s911u1 no-passthrough renderer-skia-vulkan ] conformance/extensions/oes-texture-float.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough ] conformance/extensions/oes-texture-half-float-with-video.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough ] conformance/textures/image_bitmap_from_video/tex-2d-luminance-luminance-unsigned_byte.html [ Failure ] crbug.com/1499000 [ android android-sm-a236b no-passthrough ] conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html [ Failure ]
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc index 3c041708..87afe031 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc
@@ -30,19 +30,6 @@ // TODO(crbug.com/330865436): Eliminate once killswitches checked within this // function roll out safely. bool SupportScanout() { - // If any of the below clients are not guarding their addition of SCANOUT - // usage by SCANOUT support being present in SharedImageCapabilities, then - // GLTextureImageBacking *must* accept SCANOUT usage for this use case. - if (!base::FeatureList::IsEnabled( - features::kFastInkHostAddScanoutUsageOnlyIfSupportedBySharedImage)) { - return true; - } - if (!base::FeatureList::IsEnabled( - features:: - kRoundedDisplayAddScanoutUsageOnlyIfSupportedBySharedImage)) { - return true; - } - return base::FeatureList::IsEnabled(kSupportScanoutInGLTextureImageBacking); }
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc index 9d745a03..728b4a3b 100644 --- a/gpu/config/gpu_finch_features.cc +++ b/gpu/config/gpu_finch_features.cc
@@ -388,19 +388,6 @@ base::FEATURE_DISABLED_BY_DEFAULT); #endif -// If enabled, SharedImages created for the impacted clients have SCANOUT usage -// added only if SharedImageCapabilities indicates that there is support. Serve -// as killswitches for these rollouts. Live in //gpu as backings that are -// rolling out restrictions on supporting SCANOUT usage must check the value of -// these base::Features. -// TODO(crbug.com/330865436): Remove post-safe rollout. -BASE_FEATURE(kFastInkHostAddScanoutUsageOnlyIfSupportedBySharedImage, - "FastInkHostAddScanoutUsageOnlyIfSupportedBySharedImage", - base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kRoundedDisplayAddScanoutUsageOnlyIfSupportedBySharedImage, - "RoundedDisplayAddScanoutUsageOnlyIfSupportedBySharedImage", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enable persistent storage of VkPipelineCache data. BASE_FEATURE(kEnableVkPipelineCache, "EnableVkPipelineCache",
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h index 28854dd..4c47be2e 100644 --- a/gpu/config/gpu_finch_features.h +++ b/gpu/config/gpu_finch_features.h
@@ -73,11 +73,6 @@ GPU_EXPORT BASE_DECLARE_FEATURE(kSkiaGraphiteDawnUseD3D12); #endif -GPU_EXPORT BASE_DECLARE_FEATURE( - kFastInkHostAddScanoutUsageOnlyIfSupportedBySharedImage); -GPU_EXPORT BASE_DECLARE_FEATURE( - kRoundedDisplayAddScanoutUsageOnlyIfSupportedBySharedImage); - GPU_EXPORT BASE_DECLARE_FEATURE(kConditionallySkipGpuChannelFlush); GPU_EXPORT BASE_DECLARE_FEATURE(kEnableVkPipelineCache);
diff --git a/internal b/internal index 7a7ac80..72be70e 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 7a7ac80a328065cac1905dae0f019dee50e2ca76 +Subproject commit 72be70e45c7b591f2804381c1ec404d5438e255f
diff --git a/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller.mm b/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller.mm index 0561555..6e9cd9f 100644 --- a/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller.mm +++ b/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller.mm
@@ -67,8 +67,6 @@ SyncErrorsSectionIdentifier = kSectionIdentifierEnumZero, // List of accounts. AccountsSectionIdentifier, - // Manage accounts and sign-out. - SignOutSectionIdentifier, // Settings. SettingsSectionIdentifier, }; @@ -472,10 +470,8 @@ [accountsIdentifiers addObject:@(RowIdentifierAddAccount)]; [snapshot appendItemsWithIdentifiers:accountsIdentifiers intoSectionWithIdentifier:@(AccountsSectionIdentifier)]; - - [snapshot appendSectionsWithIdentifiers:@[ @(SignOutSectionIdentifier) ]]; [snapshot appendItemsWithIdentifiers:@[ @(RowIdentifierSignOut) ] - intoSectionWithIdentifier:@(SignOutSectionIdentifier)]; + intoSectionWithIdentifier:@(AccountsSectionIdentifier)]; [snapshot appendSectionsWithIdentifiers:@[ @(SettingsSectionIdentifier) ]]; [snapshot appendItemsWithIdentifiers:@[ @(RowIdentifierSettings) ]
diff --git a/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller_unittests.mm b/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller_unittests.mm index 8e33cab5..f807d72 100644 --- a/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller_unittests.mm +++ b/ios/chrome/browser/authentication/ui_bundled/account_menu/account_menu_view_controller_unittests.mm
@@ -163,9 +163,9 @@ [[FakeAccountMenuDataSource alloc] init]; NSIndexPath* path_for_secondary_account_ = [NSIndexPath indexPathForRow:0 inSection:0]; - NSIndexPath* path_for_sign_out_ = [NSIndexPath indexPathForRow:0 inSection:1]; NSIndexPath* path_for_add_account_ = [NSIndexPath indexPathForRow:1 inSection:0]; + NSIndexPath* path_for_sign_out_ = [NSIndexPath indexPathForRow:2 inSection:0]; raw_ptr<AuthenticationService> authentication_service_; raw_ptr<FakeSystemIdentityManager> fake_system_identity_manager_; base::UserActionTester user_actions_; @@ -219,11 +219,9 @@ // Test the view controller when it starts. TEST_P(AccountMenuViewControllerTest, TestDefaultSetting) { - EXPECT_EQ(3, TableView().numberOfSections); - // The secondary account and Add Account... - EXPECT_EQ(2, [TableView() numberOfRowsInSection:0]); - // Sign Out - EXPECT_EQ(1, [TableView() numberOfRowsInSection:1]); + EXPECT_EQ(2, TableView().numberOfSections); + // The secondary account, Add Account..., and Sign Out. + EXPECT_EQ(3, [TableView() numberOfRowsInSection:0]); UITableViewCell* secondary_account_cell = GetCell(path_for_secondary_account_); EXPECT_TRUE( @@ -282,13 +280,11 @@ buttonLabelID:IDS_IOS_ACCOUNT_TABLE_ERROR_ENTER_PASSPHRASE_BUTTON]; data_source_.accountErrorUIInfo = errorInfo; [view_controller_ updateErrorSection:errorInfo]; - EXPECT_EQ(4, TableView().numberOfSections); + EXPECT_EQ(3, TableView().numberOfSections); // The error section EXPECT_EQ(2, [TableView() numberOfRowsInSection:0]); - // The secondary account and Add Account... - EXPECT_EQ(2, [TableView() numberOfRowsInSection:0]); - // Sign Out - EXPECT_EQ(1, [TableView() numberOfRowsInSection:2]); + // The secondary account, Add Account..., and Sign Out. + EXPECT_EQ(3, [TableView() numberOfRowsInSection:1]); NSIndexPath* path_for_error_message = [NSIndexPath indexPathForRow:0 inSection:0]; @@ -318,11 +314,9 @@ updateAccountListWithGaiaIDsToAdd:@[ kSecondaryIdentity2.gaiaID ] gaiaIDsToRemove:@[] gaiaIDsToKeep:@[ kSecondaryIdentity.gaiaID ]]; - EXPECT_EQ(3, TableView().numberOfSections); - // The secondary accounts and Add Account... - EXPECT_EQ(3, [TableView() numberOfRowsInSection:0]); - // Sign Out - EXPECT_EQ(1, [TableView() numberOfRowsInSection:1]); + EXPECT_EQ(2, TableView().numberOfSections); + // The secondary account, Add Account..., and Sign Out. + EXPECT_EQ(4, [TableView() numberOfRowsInSection:0]); } // Test that removing a secondary account remove a row in the secondary account @@ -332,22 +326,18 @@ updateAccountListWithGaiaIDsToAdd:@[] gaiaIDsToRemove:@[ kSecondaryIdentity.gaiaID ] gaiaIDsToKeep:@[]]; - EXPECT_EQ(3, TableView().numberOfSections); - // No Secondary account. Just Add Account... - EXPECT_EQ(1, [TableView() numberOfRowsInSection:0]); - // Sign Out - EXPECT_EQ(1, [TableView() numberOfRowsInSection:1]); + EXPECT_EQ(2, TableView().numberOfSections); + // No Secondary account. Just Add Account..., and Sign Out. + EXPECT_EQ(2, [TableView() numberOfRowsInSection:0]); } // Test that updating the primary account has no discernable impact on the view // controller. TEST_P(AccountMenuViewControllerTest, TestUpdatePrimaryAccount) { [view_controller_ updatePrimaryAccount]; - EXPECT_EQ(3, TableView().numberOfSections); - // The secondary account and Add Account... - EXPECT_EQ(2, [TableView() numberOfRowsInSection:0]); - // Sign Out - EXPECT_EQ(1, [TableView() numberOfRowsInSection:1]); + EXPECT_EQ(2, TableView().numberOfSections); + // The secondary account, Add Account..., and Sign Out. + EXPECT_EQ(3, [TableView() numberOfRowsInSection:0]); } INSTANTIATE_TEST_SUITE_P(,
diff --git a/ios/chrome/browser/find_in_page/model/find_tab_helper.mm b/ios/chrome/browser/find_in_page/model/find_tab_helper.mm index 360824f..acd08342 100644 --- a/ios/chrome/browser/find_in_page/model/find_tab_helper.mm +++ b/ios/chrome/browser/find_in_page/model/find_tab_helper.mm
@@ -17,7 +17,12 @@ } } -FindTabHelper::~FindTabHelper() {} +FindTabHelper::~FindTabHelper() { + // If there is a controller then it needs to be detached from `web_state` + // before the call to `-dealloc`. + [controller_ detachFromWebState]; + controller_ = nil; +} void FindTabHelper::DismissFindNavigator() { // Same as `StopFinding()` except the UI is not marked as inactive so it can
diff --git a/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator.mm b/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator.mm index 971f72af..9466f56 100644 --- a/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator.mm +++ b/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator.mm
@@ -262,11 +262,6 @@ } - (void)lensOverlay:(id<ChromeLensOverlay>)lensOverlay - suggestSignalsAvailableOnResult:(id<ChromeLensOverlayResult>)result { - [self lensOverlay:lensOverlay hasSuggestSignalsAvailableOnResult:result]; -} - -- (void)lensOverlay:(id<ChromeLensOverlay>)lensOverlay hasSuggestSignalsAvailableOnResult:(id<ChromeLensOverlayResult>)result { if (result != _currentLensResult) { return;
diff --git a/ios/chrome/browser/web/model/choose_file/choose_file_java_script_feature_unittest.mm b/ios/chrome/browser/web/model/choose_file/choose_file_java_script_feature_unittest.mm index 9477a4c..146479b6 100644 --- a/ios/chrome/browser/web/model/choose_file/choose_file_java_script_feature_unittest.mm +++ b/ios/chrome/browser/web/model/choose_file/choose_file_java_script_feature_unittest.mm
@@ -260,41 +260,41 @@ // Test synchronisation web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'acceptType':0,'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', {});", + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage({});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'acceptType':-2, 'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'acceptType':37, 'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'acceptType':'invalid', 'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'missing':'invalid', 'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 1); @@ -302,7 +302,7 @@ // Test synchronisation web::test::ExecuteJavaScriptForFeature( web_state_.get(), - @"__gCrWeb.common.sendWebKitMessage('ChooseFileHandler', " + @"window.webkit.messageHandlers['ChooseFileHandler'].postMessage(" @"{'acceptType':0,'hasMultiple':true,'hasSelectedFile':false});", ChooseFileJavaScriptFeature::GetInstance()); histogram_tester.ExpectTotalCount("IOS.Web.FileInput.Clicked", 2);
diff --git a/ios/chrome/browser/web/model/image_fetch/image_fetch_tab_helper_unittest.mm b/ios/chrome/browser/web/model/image_fetch/image_fetch_tab_helper_unittest.mm index 1e37386..f56c95ac 100644 --- a/ios/chrome/browser/web/model/image_fetch/image_fetch_tab_helper_unittest.mm +++ b/ios/chrome/browser/web/model/image_fetch/image_fetch_tab_helper_unittest.mm
@@ -119,8 +119,9 @@ stringWithFormat: @"__gCrWeb.imageFetch = {}; __gCrWeb.imageFetch.getImageData = " "function(id, url) { " - "__gCrWeb.common.sendWebKitMessage('ImageFetchMessageHandler', " - "{'id': id, 'data': btoa('%s'), 'from':'canvas'}); }; true;", + " window.webkit.messageHandlers['ImageFetchMessageHandler']." + " postMessage({'id': id, 'data': btoa('%s'), 'from':'canvas'});" + "}; true;", kImageData], ImageFetchJavaScriptFeature::GetInstance()); ASSERT_NSEQ(@YES, script_result); @@ -152,8 +153,9 @@ stringWithFormat: @"__gCrWeb.imageFetch = {}; __gCrWeb.imageFetch.getImageData = " "function(id, url) { " - "__gCrWeb.common.sendWebKitMessage('ImageFetchMessageHandler', " - "{'id': id, 'data': btoa('%s'), 'from':'xhr'}); }; true;", + " window.webkit.messageHandlers['ImageFetchMessageHandler']." + " postMessage({'id': id, 'data': btoa('%s'), 'from':'xhr'});" + "}; true;", kImageData], ImageFetchJavaScriptFeature::GetInstance()); ASSERT_NSEQ(@YES, script_result); @@ -182,8 +184,8 @@ web_state(), @"__gCrWeb.imageFetch = {}; __gCrWeb.imageFetch.getImageData = " "function(id, url) { " - "__gCrWeb.common.sendWebKitMessage('ImageFetchMessageHandler', " - "{'id': id}); }; true;", + " window.webkit.messageHandlers['ImageFetchMessageHandler']." + " postMessage({'id': id}); }; true;", ImageFetchJavaScriptFeature::GetInstance()); ASSERT_NSEQ(@YES, script_result);
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 index 0473f9ed..ad36ce4 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -7545c5632414de2bc541c4672ecc9da8236c2469 \ No newline at end of file +82f682f40d98bcaea77ebb8d67fdac4b45c11dcd \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 index b813ace0..131987c 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -b5761df2b8e8fb38b2924c5f96c0ecd6540f0797 \ No newline at end of file +88c1c4e70d7b27c91a08c511bc24c398de60d00d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index cf03028..c7ec8f65 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -0cd469244b7681cb342b90306107f80b1736f9e8 \ No newline at end of file +d932df464bbae7742a908e30f5c7bbaee12e6dfd \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 index 189181d8..d994d3e 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -bff1a5c1ace96fa587531e8b69d739c60d8d5ac9 \ No newline at end of file +12375a07a9662e8569aaacf89e37039d7a2a34fb \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index 9ceb4f2..a9bc96b 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -66ad2517bb30a3c91747ecb3aa895db384d9b73d \ No newline at end of file +bc0d9a921d6d8a80ca257a20be47732e6a2dc3df \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 index 1b6713dd..515caea 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -839909ce506fdf04fd6d4c2205dbbb6d1a197906 \ No newline at end of file +2b228741fe1c7fc13605c9ba2e3914a5f8447e5f \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 index bf785e66..0b57337 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -4fff607d03340b36fb7cd58a032d734a45b57407 \ No newline at end of file +ced6820d6cea71f833ed94df42cc548bba7b9d23 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 index 0af6aa47..b5b6eb2 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -fb91aeea6585bcd6ed140a6677dc4c4da1059bfd \ No newline at end of file +024eb25ea8a7c203b98f85a99b404f9311170eeb \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 index 17499968..ea570ff6 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -53688bedce276fe4e23a803d58ed7da4128495af \ No newline at end of file +4b095d3c499533c56c41c10a13df18e497346afd \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 13c3be6..a3d4fe5 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -70f50f42ada5570f856116cb9aaa8f0a76a64418 \ No newline at end of file +bb5adc3a559a49db04db064f62286460c010fb8a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index de62ff3..24fad8a 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -68831c8a012572c96da5d37271288445f6eeccda \ No newline at end of file +0c18faac3bb50e857b4f2bf7a3e08442402d2103 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 index 7b506c6..d93bdf1c 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -f9ef43ef48811653d26fff99b16bf93eacbdcfb8 \ No newline at end of file +4db8b242ef1f73e281f21358adc376df0f3731e9 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index d395aa4a..d8bc5a0c8 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -65642621cf27f0755cd5d3907e5dadf4b151bbdb \ No newline at end of file +3e39961fcf57817234482dc3010454623714c0c8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 index f6a141bb..d8aaca3 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -8b2171db17a4d92f70332163b0932ee812f538d9 \ No newline at end of file +11fd8e2ea18799292c485c3d4694be7f07d59e08 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index b9f894e..86038f5 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -28a857d5e5c27110ac367d476a3673fbb80c5ca0 \ No newline at end of file +b40d705b2d0ec304ae93130179a6572886a82e89 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 index 829efb6a..17cea41 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -6608add753b8126292c314a94b81df06a6649ba2 \ No newline at end of file +d67eabcb0a08e018d0df67c162692fcfbf106c6c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index af4901f..0a1cc15 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -d7ad1ce85c5bca70d7a21b8504b81f0a7cd1bdce \ No newline at end of file +70d8e1e099b00d26e9b9912167cb9609bcc0e17c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 39dd41c6..0058a59 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -5d3543ebb6ca84977bb8b5a35a67d1313ef1b4fe \ No newline at end of file +330fa53a91ee51b14e5500a958a6827ef3ff89b0 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index 1976bcd..c27ead99 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -9fbef4841d8eb20e5c054ec6f4b3f869596c17c3 \ No newline at end of file +279b527d0955052e66626ac57f3afab26e3c0b61 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index 873b4254..91d9d73 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -3c1660352509147107cd5ae49b058e78b85b62a2 \ No newline at end of file +4086075c8f2a152b328047ed486f053fc11ffd9b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 108580d..7873c4f0 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -f36240cc8cd00a9dc2a90372a8b10921247a77aa \ No newline at end of file +d55280fbb2004fccfd1f3e6daf49be5e2f77db1d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 index adc9eba..0d88b60 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -e96648e6e0b6c587ce7a9422ccd681fc5892bfe9 \ No newline at end of file +8848f96bf8e08e1f34d8540395680a88f552ce67 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index 5448270..e9a0a96 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -242b7d30fa4c04b68fbe81eef0f1f7bc811691c3 \ No newline at end of file +510c61e4908fdea0a3d025afc68d89026b36eb85 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 634ee60da..a449358 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -87d291919aa77bef9cc23110a0ff3119211b2afa \ No newline at end of file +6c51c40fbc9ee194d4ec3a6fe80ac8485c68c7a7 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 12d7d9c..f96903fc 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -5151aa3c2f19a601f2a8acaf2b493363d31f8c67 \ No newline at end of file +882bea2ca4548ab04c96db0d7ab63e86fecad177 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 index 83afa2d..60cd7a7 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -1e88b0b120e9dced4b22984b21ba94e742cc238f \ No newline at end of file +3861f3f2da8f6679ba489bc92ace85d3d9a26118 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index bb793523..88b7d444 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -3c6dcea836cee6adada46275e688aa7e19a6d8aa \ No newline at end of file +b344ae50531d11fcfd6f3c637bac115c327db748 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 0c5b4f91..310c2e4d 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -d5af181aadeadb42f914fe0dd7c79a1ea93fa9bb \ No newline at end of file +bc9127a6e35451983959378fc6385b0f1597a1b1 \ No newline at end of file
diff --git a/ios/public/provider/chrome/browser/lens/lens_overlay_api.h b/ios/public/provider/chrome/browser/lens/lens_overlay_api.h index f7d9455..0550b165e 100644 --- a/ios/public/provider/chrome/browser/lens/lens_overlay_api.h +++ b/ios/public/provider/chrome/browser/lens/lens_overlay_api.h
@@ -32,10 +32,6 @@ // The lens overlay has suggest signals available for the given result. - (void)lensOverlay:(id<ChromeLensOverlay>)lensOverlay - suggestSignalsAvailableOnResult:(id<ChromeLensOverlayResult>)result; - -// The lens overlay has suggest signals available for the given result. -- (void)lensOverlay:(id<ChromeLensOverlay>)lensOverlay hasSuggestSignalsAvailableOnResult:(id<ChromeLensOverlayResult>)result; // The lens overlay requested to open a URL (e.g. after a selection in the
diff --git a/ios/web/js_messaging/java_script_feature_inttest.mm b/ios/web/js_messaging/java_script_feature_inttest.mm index 74ca94e97b..ef16df7 100644 --- a/ios/web/js_messaging/java_script_feature_inttest.mm +++ b/ios/web/js_messaging/java_script_feature_inttest.mm
@@ -130,34 +130,6 @@ EXPECT_STREQ(kFakeJavaScriptFeaturePostMessageReplyValue, reply->c_str()); } -// Tests that a page which overrides the window.webkit object does not break the -// JavaScriptFeature JS->native messaging system when the feature script is -// using `__gCrWeb.common.sendWebKitMessage` -TEST_F(JavaScriptFeaturePageContentWorldTest, - MessagingWithOverriddenWebkitObjectCommonJS) { - LoadHtml(kPageHTML); - ExecuteJavaScript(@"webkit = undefined;"); - - ASSERT_FALSE(feature()->last_received_web_state()); - ASSERT_FALSE(feature()->last_received_message()); - - auto parameters = - base::Value::List().Append(kFakeJavaScriptFeaturePostMessageReplyValue); - feature()->ReplyWithPostMessageCommonJS(GetMainFrame(), parameters); - - ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^bool { - return feature()->last_received_web_state(); - })); - - EXPECT_EQ(web_state(), feature()->last_received_web_state()); - - ASSERT_TRUE(feature()->last_received_message()->body()); - const std::string* reply = - feature()->last_received_message()->body()->GetIfString(); - ASSERT_TRUE(reply); - EXPECT_STREQ(kFakeJavaScriptFeaturePostMessageReplyValue, reply->c_str()); -} - // Tests that a JavaScriptFeature with // ReinjectionBehavior::kReinjectOnDocumentRecreation re-injects JavaScript in // the page content world.
diff --git a/ios/web/public/js_messaging/README.md b/ios/web/public/js_messaging/README.md index f18050a..7582c0f 100644 --- a/ios/web/public/js_messaging/README.md +++ b/ios/web/public/js_messaging/README.md
@@ -162,9 +162,8 @@ Any responses will be routed to `ScriptMessageReceived`. -From the JavaScript side, these messages are sent using -`__gCrWeb.common.sendWebKitMessage` in older scripts and `sendWebKitMessage` -from `//ios/web/public/js_messaging/resources/utils.js` in modern scripts. +From the JavaScript side, these messages are sent using `sendWebKitMessage` +from `//ios/web/public/js_messaging/resources/utils.js`. Note that the handler name must be unique application-wide. WebKit will throw an exception while setting up the handler if a name is already registered.
diff --git a/ios/web/test/fakes/fake_java_script_feature.h b/ios/web/test/fakes/fake_java_script_feature.h index 33a7d7619..aa0d5df 100644 --- a/ios/web/test/fakes/fake_java_script_feature.h +++ b/ios/web/test/fakes/fake_java_script_feature.h
@@ -45,11 +45,6 @@ void ReplyWithPostMessage(WebFrame* web_frame, const base::Value::List& parameters); - // Executes `kJavaScriptFeatureTestScriptReplyWithPostMessage` with - // `parameters` in `web_frame` using __gCrWeb.common.sendWebKitMessage. - void ReplyWithPostMessageCommonJS(WebFrame* web_frame, - const base::Value::List& parameters); - // Returns the number of errors received void GetErrorCount(WebFrame* web_frame, base::OnceCallback<void(const base::Value*)> callback);
diff --git a/ios/web/test/fakes/fake_java_script_feature.mm b/ios/web/test/fakes/fake_java_script_feature.mm index 434fc9bf..ca891f2e 100644 --- a/ios/web/test/fakes/fake_java_script_feature.mm +++ b/ios/web/test/fakes/fake_java_script_feature.mm
@@ -33,8 +33,6 @@ // `kFakeJavaScriptFeatureScriptHandlerName`. const char kScriptReplyWithPostMessage[] = "javaScriptFeatureTest.replyWithPostMessage"; -const char kScriptReplyWithPostMessageCommonJS[] = - "javaScriptFeatureTest.replyWithPostMessageCommonHelper"; // The function exposed by the feature JS which returns the count of errors // received in the JS error listener. @@ -70,13 +68,6 @@ CallJavaScriptFunction(web_frame, kScriptReplyWithPostMessage, parameters); } -void FakeJavaScriptFeature::ReplyWithPostMessageCommonJS( - WebFrame* web_frame, - const base::Value::List& parameters) { - CallJavaScriptFunction(web_frame, kScriptReplyWithPostMessageCommonJS, - parameters); -} - void FakeJavaScriptFeature::GetErrorCount( WebFrame* web_frame, base::OnceCallback<void(const base::Value*)> callback) {
diff --git a/ios/web/test/resources/java_script_feature_test_inject_once.ts b/ios/web/test/resources/java_script_feature_test_inject_once.ts index 18e5eef..779cdf1 100644 --- a/ios/web/test/resources/java_script_feature_test_inject_once.ts +++ b/ios/web/test/resources/java_script_feature_test_inject_once.ts
@@ -27,12 +27,6 @@ sendWebKitMessage('FakeHandlerName', messageBody); } -// This function offers the same functionality as `replyWithPostMessage`, but -// uses the sendWebKitMessage implementation in __gCrWeb.common. -function replyWithPostMessageCommonHelper(messageBody: object) { - sendWebKitMessage('FakeHandlerName', messageBody); -} - const body = document.getElementsByTagName('body')[0]; if (body) { body.appendChild(document.createTextNode('injected_script_loaded')); @@ -42,6 +36,5 @@ errorReceivedCount, getErrorCount, replaceDivContents, - replyWithPostMessage, - replyWithPostMessageCommonHelper + replyWithPostMessage };
diff --git a/ios/web/web_state/js/resources/common.js b/ios/web/web_state/js/resources/common.js index 1977eef..b9f16610 100644 --- a/ios/web/web_state/js/resources/common.js +++ b/ios/web/web_state/js/resources/common.js
@@ -107,37 +107,3 @@ element.type === 'tel' || element.type === 'url' || element.type === 'number'; }; - -/** - * Trims any whitespace from the start and end of a string. - * Used in preference to String.prototype.trim as this can be overridden by - * sites. - * - * @param {string} str The string to be trimmed. - * @return {string} The string after trimming. - */ -__gCrWeb.common.trim = function(str) { - return str.replace(/^\s+|\s+$/g, ''); -}; - -/** - * Posts |message| to the webkit message handler specified by |handlerName|. - * DEPRECATED: This function will be removed soon. Instead, use the - * implementation at //ios/web/public/js_messaging/resources/utils.ts - * - * @param {string} handlerName The name of the webkit message handler. - * @param {Object} message The message to post to the handler. - */ -__gCrWeb.common.sendWebKitMessage = function(handlerName, message) { - try { - // A web page can override `window.webkit` with any value. Deleting the - // object ensures that original and working implementation of - // window.webkit is restored. - var oldWebkit = window.webkit; - delete window['webkit']; - window.webkit.messageHandlers[handlerName].postMessage(message); - window.webkit = oldWebkit; - } catch (err) { - // TODO(crbug.com/40269960): Report this fatal error - } -};
diff --git a/ios_internal b/ios_internal index 6444bdf..d2f432e 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 6444bdf131517e4efff8b82981cdc601b2e92e47 +Subproject commit d2f432ee9ef21f7d2fe9702faa2b390d90ebc370
diff --git a/media/gpu/h264_rate_controller.cc b/media/gpu/h264_rate_controller.cc index a58bc99..af64d6c5 100644 --- a/media/gpu/h264_rate_controller.cc +++ b/media/gpu/h264_rate_controller.cc
@@ -4,7 +4,10 @@ #include "media/gpu/h264_rate_controller.h" +#include <algorithm> #include <array> +#include <limits> +#include <memory> #include "base/logging.h" #include "base/time/time.h" @@ -336,7 +339,7 @@ H264RateController::FrameType::kPFrame) { // Limit QP for IDR frames based on the QP estimated for the previous P // frame. The offset for the minimum value is a constant, while the offset - // for the maximum value is calclated as a linear function of the frame + // for the maximum value is calculated as a linear function of the frame // rate. The constants are chosen arbitrarily, based on the analysis of // the real use cases. constexpr float kMinQPOffsetForIDR = -3.0f; @@ -513,7 +516,7 @@ FrameType frame_type, size_t frame_bytes, base::TimeDelta frame_timestamp) { - // Update HRDs for all temporal leyars. + // Update HRDs for all temporal layers. for (size_t tl = temporal_id; tl < num_temporal_layers_; ++tl) { temporal_layers_[tl]->AddFrameBytes(frame_bytes, frame_timestamp); temporal_layers_[tl]->update_last_frame_qp( @@ -525,7 +528,7 @@ void H264RateController::FinishLayerPreviousFrameTimestamp( size_t temporal_id, base::TimeDelta frame_timestamp) { - // Update timestamps for all tamporal layers. + // Update timestamps for all temporal layers. for (size_t tl = temporal_id; tl < num_temporal_layers_; ++tl) { temporal_layers_[tl]->update_previous_frame_timestamp(frame_timestamp); }
diff --git a/media/gpu/h264_rate_controller.h b/media/gpu/h264_rate_controller.h index b37ec7f..8e5262a6 100644 --- a/media/gpu/h264_rate_controller.h +++ b/media/gpu/h264_rate_controller.h
@@ -5,6 +5,7 @@ #ifndef MEDIA_GPU_H264_RATE_CONTROLLER_H_ #define MEDIA_GPU_H264_RATE_CONTROLLER_H_ +#include <memory> #include <vector> #include "base/moving_window.h" @@ -92,12 +93,12 @@ // video stream bitrate close to the target bitrate. The controller supports // up to two temporal layers, each with its own HRD buffer. The HRD buffer // stores the encoded frames from the current layer and all the lower layers -// that it depens on. +// that it depends on. // // The prediction of the QP parameter for intra encoded frames is based on the // R-D model, using the expected size of the encoded frame as an input. // For inter encoded frames, the QP is calculated based on the long-term and -// short-term statistics of the estamated QP and frame size, the prediction +// short-term statistics of the estimated QP and frame size, the prediction // error of the frame size prediction for the previously encoded frames, // and the HRD buffer fullness. // @@ -399,7 +400,7 @@ // frame_duration = 1 / frame_rate // // In overflow case - // owerflow_size = + // overflow_size = // frame_size_target + buffer_level_current - buffer_target_high // size_correction = // -overflow_size * frame_duration / size_correction_window
diff --git a/media/gpu/h264_rate_controller_unittest.cc b/media/gpu/h264_rate_controller_unittest.cc index ae66c15..4e6820fc 100644 --- a/media/gpu/h264_rate_controller_unittest.cc +++ b/media/gpu/h264_rate_controller_unittest.cc
@@ -5,6 +5,7 @@ #include "media/gpu/h264_rate_controller.h" #include <array> +#include <memory> #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" @@ -402,7 +403,7 @@ // The following use cases are tested: // 1. Start Limit Base QP procedure in ClipInterFrameQP(). The buffer size // gradually decreases and the Limit Base QP is turned off when the - // buffer fullness of the enhanched layer reaches 35%. + // buffer fullness of the enhanced layer reaches 35%. // 2. Adjusting the min_qp value in ClipInterFrameQP() method when the // buffer reaches full capacity. // 3. Setting the overshooting timestamp and increasing min_qp and max_qp in @@ -624,7 +625,7 @@ // Run test sequences 2 and 3 // The following use cases are tested: - // 1. The QP difference between enchanched and base layers is more than 4. + // 1. The QP difference between enhanced and base layers is more than 4. // This indicates the HRD overflow and the min_qp is increased. The // ClipInterFrameQP() method handles this scenario. // 2. The test sequence triggers the setting of undershoot_delta_qp. Under
diff --git a/media/gpu/h264_ratectrl_rtc.cc b/media/gpu/h264_ratectrl_rtc.cc index 40b6495..8646d667 100644 --- a/media/gpu/h264_ratectrl_rtc.cc +++ b/media/gpu/h264_ratectrl_rtc.cc
@@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "h264_ratectrl_rtc.h" +#include "media/gpu/h264_ratectrl_rtc.h" + +#include <memory> +#include <string> +#include <vector> #include "base/logging.h" #include "base/strings/string_number_conversions.h"
diff --git a/media/gpu/h264_ratectrl_rtc.h b/media/gpu/h264_ratectrl_rtc.h index 0f885da..40b2c76 100644 --- a/media/gpu/h264_ratectrl_rtc.h +++ b/media/gpu/h264_ratectrl_rtc.h
@@ -5,6 +5,8 @@ #ifndef MEDIA_GPU_H264_RATECTRL_RTC_H_ #define MEDIA_GPU_H264_RATECTRL_RTC_H_ +#include <memory> + #include "media/gpu/h264_rate_controller.h" #include "media/gpu/media_gpu_export.h"
diff --git a/media/gpu/mac/vt_video_encode_accelerator_mac.h b/media/gpu/mac/vt_video_encode_accelerator_mac.h index 606b15d..3113eef 100644 --- a/media/gpu/mac/vt_video_encode_accelerator_mac.h +++ b/media/gpu/mac/vt_video_encode_accelerator_mac.h
@@ -44,6 +44,8 @@ Client* client, std::unique_ptr<MediaLog> media_log = nullptr) override; void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; + void Encode(scoped_refptr<VideoFrame> frame, + const VideoEncoder::EncodeOptions& options) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange( const Bitrate& bitrate,
diff --git a/media/gpu/mac/vt_video_encode_accelerator_mac.mm b/media/gpu/mac/vt_video_encode_accelerator_mac.mm index 78a7ebd..78ac8a4 100644 --- a/media/gpu/mac/vt_video_encode_accelerator_mac.mm +++ b/media/gpu/mac/vt_video_encode_accelerator_mac.mm
@@ -7,6 +7,7 @@ #import <Foundation/Foundation.h> #include <memory> +#include <optional> #include "base/apple/bridging.h" #include "base/apple/foundation_util.h" @@ -59,6 +60,7 @@ constexpr size_t kMaxFrameRateDenominator = 1; constexpr size_t kNumInputBuffers = 3; constexpr gfx::Size kDefaultSupportedResolution = gfx::Size(640, 480); +constexpr int kH26xMaxQp = 51; #if SOFTWARE_ENCODING_SUPPORTED // The IDs of the encoders that may be selected when we enable low latency via @@ -168,6 +170,18 @@ return false; } +bool IsManualQpSupported(VideoCodec codec) { + // Querying `kVTCompressionPropertyKey_SupportsBaseFrameQP` is the + // way Apple recommends to test whether per frame QP is supported by a + // given encoder. Based on tests on Intel and Apple Silicon Macs, + // the property `kVTCompressionPropertyKey_SupportsBaseFrameQP` will + // only report `supported` for encoders created with + // `kVTVideoEncoderSpecification_EnableLowLatencyRateControl` set to + // `true`. Thus, we assume external mode is supported if SVC is + // supported. + return IsSVCSupported(codec); +} + static CFStringRef VideoCodecProfileToVTProfile(VideoCodecProfile profile) { switch (profile) { case H264PROFILE_BASELINE: @@ -395,6 +409,7 @@ constexpr uint8_t kFullFramerate = 255; info.fps_allocation[0] = {kFullFramerate}; } + CHECK(info.reports_average_qp); return info; } @@ -403,10 +418,12 @@ struct VTVideoEncodeAccelerator::InProgressFrameEncode { InProgressFrameEncode(scoped_refptr<VideoFrame> frame, - const gfx::ColorSpace& frame_cs) - : frame(frame), encoded_color_space(frame_cs) {} + const gfx::ColorSpace& frame_cs, + std::optional<int> frame_qp) + : frame(frame), encoded_color_space(frame_cs), qp(frame_qp) {} const scoped_refptr<VideoFrame> frame; const gfx::ColorSpace encoded_color_space; + const std::optional<int> qp; }; struct VTVideoEncodeAccelerator::EncodeOutput { @@ -418,7 +435,8 @@ : info(info_flags), sample_buffer(sbuf, base::scoped_policy::RETAIN), capture_timestamp(frame_info.frame->timestamp()), - encoded_color_space(frame_info.encoded_color_space) {} + encoded_color_space(frame_info.encoded_color_space), + qp(frame_info.qp) {} EncodeOutput(const EncodeOutput&) = delete; EncodeOutput& operator=(const EncodeOutput&) = delete; @@ -427,6 +445,7 @@ const base::apple::ScopedCFTypeRef<CMSampleBufferRef> sample_buffer; const base::TimeDelta capture_timestamp; const gfx::ColorSpace encoded_color_space; + const std::optional<int> qp; }; struct VTVideoEncodeAccelerator::BitstreamBufferRef { @@ -472,8 +491,9 @@ supported_profile.max_framerate_denominator = kMaxFrameRateDenominator; // Advertise VBR here, even though the peak bitrate is never actually used. // See RequestEncodingParametersChange() for more details. - supported_profile.rate_control_modes = VideoEncodeAccelerator::kConstantMode | - VideoEncodeAccelerator::kVariableMode; + const SupportedRateControlMode always_supported_rate_control_modes = + VideoEncodeAccelerator::kConstantMode | + VideoEncodeAccelerator::kVariableMode; // L1T1 = no additional spatial and temporal layer = always supported. const std::vector<SVCScalabilityMode> always_supported_scalability_modes{ SVCScalabilityMode::kL1T1}; @@ -497,10 +517,16 @@ supported_profile.min_resolution = min_resolution; supported_profile.is_software_codec = false; supported_profile.scalability_modes = always_supported_scalability_modes; + supported_profile.rate_control_modes = + always_supported_rate_control_modes; if (IsSVCSupported(codec)) { supported_profile.scalability_modes.push_back( SVCScalabilityMode::kL1T2); } + if (IsManualQpSupported(codec)) { + supported_profile.rate_control_modes |= + VideoEncodeAccelerator::kExternalMode; + } if (can_create_hardware_session[codec]) { supported_profiles.push_back(supported_profile); @@ -519,6 +545,8 @@ // and if you set `no-preference`, VT will always emit an error. Thus, // we should just re-use min resolutions of HW encoder for SW encoder. supported_profile.scalability_modes = always_supported_scalability_modes; + supported_profile.rate_control_modes = + always_supported_rate_control_modes; supported_profile.is_software_codec = true; supported_profiles.push_back(supported_profile); @@ -573,6 +601,18 @@ return false; } + if (config.bitrate.mode() == Bitrate::Mode::kExternal) { + if (!IsManualQpSupported(codec_)) { + MEDIA_LOG(ERROR, media_log) << "External bitrate mode is not supported."; + return false; + } + if (!require_low_delay_) { + MEDIA_LOG(INFO, media_log) + << "Force enable low delay encoding for external bitrate mode."; + require_low_delay_ = true; + } + } + if (!ResetCompressionSession()) { MEDIA_LOG(ERROR, media_log) << "Failed creating compression session."; return false; @@ -595,6 +635,12 @@ void VTVideoEncodeAccelerator::Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) { + Encode(std::move(frame), VideoEncoder::EncodeOptions(force_keyframe)); +} + +void VTVideoEncodeAccelerator::Encode( + scoped_refptr<VideoFrame> frame, + const VideoEncoder::EncodeOptions& options) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(compression_session_); DCHECK(frame); @@ -639,10 +685,21 @@ } } - NSDictionary* frame_props = @{ - CFToNSPtrCast(kVTEncodeFrameOptionKey_ForceKeyFrame) : force_keyframe ? @YES - : @NO - }; + NSMutableDictionary* frame_props = [NSMutableDictionary dictionary]; + frame_props[CFToNSPtrCast(kVTEncodeFrameOptionKey_ForceKeyFrame)] = + options.key_frame ? @YES : @NO; + + std::optional<int> frame_qp; + if (@available(macOS LOW_LATENCY_AND_SVC_AVAILABLE_VER, *)) { + if (IsManualQpSupported(codec_) && + bitrate_.mode() == Bitrate::Mode::kExternal && + options.quantizer.has_value()) { + DCHECK(require_low_delay_); + frame_qp = std::clamp(options.quantizer.value(), 1, kH26xMaxQp); + frame_props[CFToNSPtrCast(kVTEncodeFrameOptionKey_BaseFrameQP)] = + @(frame_qp.value()); + } + } // VideoToolbox uses timestamps for rate control purposes, but we can't rely // on real frame timestamps to be consistent with configured frame rate. @@ -658,7 +715,8 @@ // Wrap information we'll need after the frame is encoded in a heap object. // We'll get the pointer back from the VideoToolbox completion callback. auto request = std::make_unique<InProgressFrameEncode>( - std::move(frame), encoder_color_space_.value_or(gfx::ColorSpace())); + std::move(frame), encoder_color_space_.value_or(gfx::ColorSpace()), + frame_qp); // We can pass the ownership of |request| to the encode callback if // successful. Otherwise let it fall out of scope. @@ -753,7 +811,13 @@ {EncoderStatus::Codes::kSystemAPICallError, "Can't change frame rate"}); return; } - if (!session_property_setter.Set( + if (bitrate.mode() != bitrate_.mode()) { + NotifyErrorStatus({EncoderStatus::Codes::kEncoderUnsupportedConfig, + "Can't change bitrate mode after Initialize()"}); + return; + } + if (bitrate.mode() != Bitrate::Mode::kExternal && + !session_property_setter.Set( kVTCompressionPropertyKey_AverageBitRate, static_cast<int32_t>(bitrate.target_bps()))) { NotifyErrorStatus({EncoderStatus::Codes::kSystemAPICallError, @@ -933,6 +997,9 @@ } md.encoded_color_space = encode_output->encoded_color_space; + if (encode_output->qp.has_value()) { + md.qp = encode_output->qp.value(); + } client_->BitstreamBufferReady(buffer_ref->id, std::move(md)); MaybeRunFlushCallback();
diff --git a/media/gpu/windows/h264_video_rate_control_wrapper.cc b/media/gpu/windows/h264_video_rate_control_wrapper.cc index e5694104..00bdf155 100644 --- a/media/gpu/windows/h264_video_rate_control_wrapper.cc +++ b/media/gpu/windows/h264_video_rate_control_wrapper.cc
@@ -7,7 +7,7 @@ #pragma allow_unsafe_buffers #endif -#include "h264_video_rate_control_wrapper.h" +#include "media/gpu/windows/h264_video_rate_control_wrapper.h" #include "media/gpu/h264_ratectrl_rtc.h" @@ -36,13 +36,13 @@ constexpr base::TimeDelta kHRDBufferDelayDisplay = base::Milliseconds(3000); H264RateControlConfigRTC rc_config; - // Coded width and heght. + // Coded width and height. rc_config.frame_size.SetSize(config.width, config.height); // Maximum GOP duration in milliseconds. It is set to maximum value. rc_config.gop_max_duration = base::TimeDelta::Max(); // Source frame rate. rc_config.frame_rate_max = static_cast<float>(config.framerate); - // Number of temopral layers. + // Number of temporal layers. rc_config.num_temporal_layers = config.ts_number_layers; // Type of the video content (camera or display). rc_config.content_type = config.content_type; @@ -75,7 +75,6 @@ DCHECK_GT(rc_config.layer_settings[tid].avg_bitrate, rc_config.layer_settings[tid - 1].avg_bitrate); } - } return rc_config; }
diff --git a/net/base/base64.cc b/net/base/base64.cc index dcef801..b455801b 100644 --- a/net/base/base64.cc +++ b/net/base/base64.cc
@@ -25,9 +25,8 @@ // The input is not properly padded. return false; } - std::string_view bad_chars(base::kInfraAsciiWhitespace); - if (std::ranges::any_of(input, [&bad_chars](char c) { - return base::Contains(bad_chars, c); + if (std::ranges::any_of(input, [](char c) { + return base::Contains(base::kInfraAsciiWhitespace, c); })) { return false; }
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index 3d8367cc..59fed9ef 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -1284,8 +1284,8 @@ void HttpStreamFactory::Job::RecordPreconnectHistograms(int result) { CHECK(job_type_ == PRECONNECT || job_type_ == PRECONNECT_DNS_ALPN_H3); constexpr std::string_view kHistogramBase = - "Net.SessionCreate.GoogleSearch.Preconnect"; - if (!IsGoogleHost(destination_.host())) { + "Net.SessionCreate.GoogleSearch.Preconnect2"; + if (!IsGoogleHostWithAlpnH3(destination_.host())) { return; } bool is_session_reuse = false;
diff --git a/net/http/http_stream_pool_attempt_manager.cc b/net/http/http_stream_pool_attempt_manager.cc index 1f7593a..e74f93db 100644 --- a/net/http/http_stream_pool_attempt_manager.cc +++ b/net/http/http_stream_pool_attempt_manager.cc
@@ -814,9 +814,9 @@ } RequestPriority HttpStreamPool::AttemptManager::GetPriority() const { + // There are several cases where `jobs_` is empty (e.g. `this` only has + // preconnects, all jobs are already notified etc). Use IDLE for these cases. if (jobs_.empty()) { - CHECK(!preconnect_jobs_.empty()); - // Preconnets have IDLE priority. return RequestPriority::IDLE; } return static_cast<RequestPriority>(jobs_.FirstMax().priority());
diff --git a/net/http/http_stream_pool_attempt_manager_unittest.cc b/net/http/http_stream_pool_attempt_manager_unittest.cc index d0e02290..a6b0f29 100644 --- a/net/http/http_stream_pool_attempt_manager_unittest.cc +++ b/net/http/http_stream_pool_attempt_manager_unittest.cc
@@ -871,6 +871,40 @@ ASSERT_TRUE(stream); } +// Regression test for crbug.com/397403548. +// AttemptManager should return a valid priority even after Job (request) is +// notified. +TEST_F(HttpStreamPoolAttemptManagerTest, GetPriority) { + resolver() + ->AddFakeRequest() + ->add_endpoint(ServiceEndpointBuilder().add_v4("192.0.2.1").endpoint()) + .CompleteStartSynchronously(OK); + + SequencedSocketData data; + MockConnectCompleter completer; + data.set_connect_data(MockConnect(&completer)); + socket_factory()->AddSocketDataProvider(&data); + + // Request a stream with the HIGHEST priority. + StreamRequester requester; + requester.set_priority(RequestPriority::HIGHEST).RequestStream(pool()); + ASSERT_FALSE(requester.result().has_value()); + + // Ensure the corresponding attempt manager has the HIGHEST priority. + AttemptManager* manager = + pool() + .GetOrCreateGroupForTesting(requester.GetStreamKey()) + .GetAttemptManagerForTesting(); + ASSERT_EQ(manager->GetPriority(), RequestPriority::HIGHEST); + + // Complete the stream attempt and wait for request completion. The + // corresponding attempt manager should return IDLE priority. + completer.Complete(OK); + requester.WaitForResult(); + EXPECT_THAT(requester.result(), Optional(IsOk())); + ASSERT_EQ(manager->GetPriority(), RequestPriority::IDLE); +} + TEST_F(HttpStreamPoolAttemptManagerTest, TcpFailSync) { FakeServiceEndpointRequest* endpoint_request = resolver()->AddFakeRequest();
diff --git a/services/webnn/coreml/graph_builder_coreml.cc b/services/webnn/coreml/graph_builder_coreml.cc index 3d7bad4b..31697873 100644 --- a/services/webnn/coreml/graph_builder_coreml.cc +++ b/services/webnn/coreml/graph_builder_coreml.cc
@@ -252,8 +252,13 @@ CoreML::Specification::MILSpec::DataType::FLOAT32, CoreML::Specification::MILSpec::DataType::INT32}); +using MilDataTypes = + base::EnumSet<CoreML::Specification::MILSpec::DataType, + CoreML::Specification::MILSpec::DataType::UNUSED_TYPE, + CoreML::Specification::MILSpec::DataType::UINT3>; + // Maps to types defined in -// https://github.com/apple/coremltools/blob/b416f36054af9ca9d10b2d74ba215d0454677ca0/mlmodel/src/MILBlob/Blob/BlobDataType.hpp#L14 +// https://github.com/apple/coremltools/blob/605ac1c7f06c19a09853e1757f7f3379d7d4e9fd/mlmodel/src/MILBlob/Blob/BlobDataType.hpp#L16 enum class BlobDataType : uint32_t { Float16 = 1, Float32 = 2, @@ -262,6 +267,16 @@ BFloat16 = 5, Int16 = 6, UInt16 = 7, + Int4 = 8, + UInt1 = 9, + UInt2 = 10, + UInt4 = 11, + UInt3 = 12, + UInt6 = 13, + Int32 = 14, + UInt32 = 15, + Float8E4M3FN = 16, + Float8E5M2 = 17, }; // The weights format follows the definition in @@ -318,16 +333,20 @@ return BlobDataType::Float16; case OperandDataType::kFloat32: return BlobDataType::Float32; + case OperandDataType::kInt4: + return BlobDataType::Int4; + case OperandDataType::kUint4: + return BlobDataType::UInt4; case OperandDataType::kUint8: return BlobDataType::UInt8; case OperandDataType::kInt8: return BlobDataType::Int8; case OperandDataType::kInt32: + return BlobDataType::Int32; case OperandDataType::kUint32: + return BlobDataType::UInt32; case OperandDataType::kInt64: case OperandDataType::kUint64: - case OperandDataType::kInt4: - case OperandDataType::kUint4: return std::nullopt; } } @@ -351,8 +370,10 @@ return CoreML::Specification::MILSpec::DataType::INT8; case OperandDataType::kUint8: return CoreML::Specification::MILSpec::DataType::UINT8; - default: - NOTREACHED() << "Unsupported data type."; + case OperandDataType::kInt4: + return CoreML::Specification::MILSpec::DataType::INT4; + case OperandDataType::kUint4: + return CoreML::Specification::MILSpec::DataType::UINT4; } } @@ -377,7 +398,25 @@ return OperandDataType::kInt8; case CoreML::Specification::MILSpec::DataType::UINT8: return OperandDataType::kUint8; - default: + case CoreML::Specification::MILSpec::DataType::INT4: + return OperandDataType::kInt4; + case CoreML::Specification::MILSpec::DataType::UINT4: + return OperandDataType::kUint4; + case CoreML::Specification::MILSpec::UNUSED_TYPE: + case CoreML::Specification::MILSpec::BOOL: + case CoreML::Specification::MILSpec::STRING: + case CoreML::Specification::MILSpec::FLOAT8E4M3FN: + case CoreML::Specification::MILSpec::FLOAT8E5M2: + case CoreML::Specification::MILSpec::FLOAT64: + case CoreML::Specification::MILSpec::BFLOAT16: + case CoreML::Specification::MILSpec::INT16: + case CoreML::Specification::MILSpec::UINT16: + case CoreML::Specification::MILSpec::UINT2: + case CoreML::Specification::MILSpec::UINT1: + case CoreML::Specification::MILSpec::UINT6: + case CoreML::Specification::MILSpec::UINT3: + case CoreML::Specification::MILSpec::DataType_INT_MIN_SENTINEL_DO_NOT_USE_: + case CoreML::Specification::MILSpec::DataType_INT_MAX_SENTINEL_DO_NOT_USE_: NOTREACHED() << "Unsupported data type."; } } @@ -424,16 +463,6 @@ CoreML::Specification::MILSpec::DataType::INT32; }; template <> -struct MilDataTypeMap<int8_t> { - static constexpr CoreML::Specification::MILSpec::DataType value = - CoreML::Specification::MILSpec::DataType::INT8; -}; -template <> -struct MilDataTypeMap<uint8_t> { - static constexpr CoreML::Specification::MILSpec::DataType value = - CoreML::Specification::MILSpec::DataType::UINT8; -}; -template <> struct MilDataTypeMap<Float16> { static constexpr CoreML::Specification::MILSpec::DataType value = CoreML::Specification::MILSpec::DataType::FLOAT16; @@ -461,8 +490,8 @@ base::span<const DataType> value); // As per -// https://github.com/apple/coremltools/blob/bba83f43859e087d50c7d764cb132e7d4b427611/coremltools/converters/mil/backend/mil/helper.py#L23, -// float16, int8, uint8, uint32 are stored in bytes. +// https://github.com/apple/coremltools/blob/605ac1c7f06c19a09853e1757f7f3379d7d4e9fd/coremltools/converters/mil/mil/types/__init__.py#L79 +// float16 is stored in bytes. template <> void SetTensorValueForImmediateValue<Float16>( CoreML::Specification::MILSpec::TensorValue& tensor, @@ -470,13 +499,7 @@ tensor.mutable_bytes()->mutable_values()->assign( base::as_string_view(base::as_bytes(value))); } -template <> -void SetTensorValueForImmediateValue<int8_t>( - CoreML::Specification::MILSpec::TensorValue& tensor, - base::span<const int8_t> value) { - tensor.mutable_bytes()->mutable_values()->assign( - base::as_string_view(base::as_bytes(value))); -} + template <> void SetTensorValueForImmediateValue<uint8_t>( CoreML::Specification::MILSpec::TensorValue& tensor, @@ -544,6 +567,29 @@ value_type); } +CoreML::Specification::MILSpec::Value CreateTensorImmediateValueFromBytes( + base::span<const uint32_t> dimensions, + CoreML::Specification::MILSpec::DataType mil_data_type, + base::span<const uint8_t> value) { + // These types are stored in bytes. + // https://github.com/apple/coremltools/blob/605ac1c7f06c19a09853e1757f7f3379d7d4e9fd/coremltools/converters/mil/mil/types/__init__.py#L79 + static constexpr MilDataTypes kByteTypes{ + CoreML::Specification::MILSpec::DataType::FLOAT16, + CoreML::Specification::MILSpec::DataType::INT4, + CoreML::Specification::MILSpec::DataType::UINT4, + CoreML::Specification::MILSpec::DataType::INT8, + CoreML::Specification::MILSpec::DataType::UINT8, + CoreML::Specification::MILSpec::DataType::UINT32, + }; + CHECK(kByteTypes.Has(mil_data_type)); + + CoreML::Specification::MILSpec::Value immediate_value{}; + PopulateValueType(mil_data_type, dimensions, *immediate_value.mutable_type()); + auto* tensor = immediate_value.mutable_immediatevalue()->mutable_tensor(); + SetTensorValueForImmediateValue(*tensor, value); + return immediate_value; +} + template <typename DataType> requires internal::IsSupportedTensorType<DataType> CoreML::Specification::MILSpec::Value CreateTensorImmediateValue( @@ -754,14 +800,6 @@ } return CreateTensorImmediateValue<float>(dimensions, floats); } - case OperandDataType::kFloat16: { - base::FixedArray<Float16> float16s(value.size() / sizeof(Float16)); - for (size_t i = 0u; i < float16s.size(); ++i) { - float16s[i].data = base::U16FromNativeEndian( - value.subspan(i * sizeof(Float16)).first<2u>()); - } - return CreateTensorImmediateValue<Float16>(dimensions, float16s); - } case OperandDataType::kInt32: { base::FixedArray<int32_t> ints(value.size() / sizeof(int32_t)); for (size_t i = 0u; i < ints.size(); ++i) { @@ -770,27 +808,17 @@ } return CreateTensorImmediateValue<int32_t>(dimensions, ints); } - case OperandDataType::kInt8: { - base::FixedArray<int8_t> int8s(value.size() / sizeof(int8_t)); - for (size_t i = 0u; i < int8s.size(); ++i) { - int8s[i] = base::I8FromNativeEndian( - value.subspan(i * sizeof(int8_t)).first<1u>()); - } - return CreateTensorImmediateValue<int8_t>(dimensions, int8s); - } - case OperandDataType::kUint8: { - base::FixedArray<uint8_t> uint8s(value.size() / sizeof(uint8_t)); - for (size_t i = 0u; i < uint8s.size(); ++i) { - uint8s[i] = base::U8FromNativeEndian( - value.subspan(i * sizeof(uint8_t)).first<1u>()); - } - return CreateTensorImmediateValue<uint8_t>(dimensions, uint8s); - } + case OperandDataType::kFloat16: case OperandDataType::kUint32: - case OperandDataType::kInt64: - case OperandDataType::kUint64: + case OperandDataType::kInt8: + case OperandDataType::kUint8: case OperandDataType::kInt4: case OperandDataType::kUint4: { + return CreateTensorImmediateValueFromBytes( + dimensions, OperandTypeToMILDataType(data_type), value); + } + case OperandDataType::kInt64: + case OperandDataType::kUint64: { NOTREACHED() << "Unsupported data type."; } } @@ -888,14 +916,12 @@ : constant_operand.descriptor().shape(); // CoreML allows writing constants directly into the model file as - // `ImmediateValue` or to a separate weight file. It does not support int32 - // serialization to the weight file. Therefore, int32 values are written as - // `ImmediateValue`, as are scalar values for efficiency. + // `ImmediateValue` or to a separate weight file. Therefore write scalar + // values as `ImmediateValue`s for efficiency. // TODO(crbug.com/395934168): Consider also saving small constants as // immediate values. - if (constant_operand.descriptor().shape().empty() || - constant_operand.descriptor().data_type() == OperandDataType::kInt32) { + if (constant_operand.descriptor().shape().empty()) { return CreateConstantImmediateValue( dimensions, constant_operand.descriptor().data_type(), constant_operand.ByteSpan()); @@ -1074,6 +1100,11 @@ OperandDataType::kFloat32, OperandDataType::kInt32}; + static constexpr SupportedDataTypes kConstantSupportedDataTypes{ + OperandDataType::kFloat32, OperandDataType::kFloat16, + OperandDataType::kInt32, OperandDataType::kUint32, + OperandDataType::kInt8, OperandDataType::kUint8, + OperandDataType::kInt4, OperandDataType::kUint4}; static constexpr SupportedDataTypes kFloat16To32Int8To32AndUint8{ OperandDataType::kFloat32, OperandDataType::kFloat16, OperandDataType::kInt32, OperandDataType::kInt8, OperandDataType::kUint8}; @@ -1099,15 +1130,13 @@ static constexpr SupportedRanks kMaxRank = SupportedRanks::UpTo(5); static constexpr SupportedRanks kNonScalarMaxRank = SupportedRanks::NonScalarUpTo(5); - static constexpr SupportedDataTypes k8BitInts{OperandDataType::kInt8, - OperandDataType::kUint8}; // TODO: crbug.com/345271830 - specify data types for all parameters. ContextProperties properties( InputOperandLayout::kNchw, Resample2DAxes::kChannelsFirst, /*tensor_byte_length_limit=*/kTensorByteLengthLimit, {/*input=*/kFloatsAndInt32, - /*constant=*/kFloat16To32Int8To32AndUint8, + /*constant=*/kConstantSupportedDataTypes, // https://apple.github.io/coremltools/source/coremltools.converters.mil.mil.ops.defs.html#coremltools.converters.mil.mil.ops.defs.iOS15.reduction.reduce_argmax /*arg_min_max_input=*/ {arg_min_max_input_supported_data_types, kNonScalarMaxRank}, @@ -1132,10 +1161,11 @@ // input. // TODO(crbug.com/361603703): Support constant (u)int4 inputs via // https://apple.github.io/coremltools/source/coremltools.converters.mil.mil.ops.defs.html#coremltools.converters.mil.mil.ops.defs.iOS18.compression.constexpr_blockwise_shift_scale - /*dequantize_linear_input=*/{k8BitInts, kMaxRank}, + /*dequantize_linear_input=*/{DataTypeConstraint::kInts8, kMaxRank}, /*dequantize_linear_scale=*/ {DataTypeConstraint::kFloat16To32, SupportedRanks::UpTo(1)}, - /*dequantize_linear_zero_point=*/{k8BitInts, SupportedRanks::UpTo(1)}, + /*dequantize_linear_zero_point=*/ + {DataTypeConstraint::kInts8, SupportedRanks::UpTo(1)}, /*add_input=*/{kFloatsAndInt32, kMaxRank}, /*sub_input=*/{kFloatsAndInt32, kMaxRank}, /*mul_input=*/{kFloatsAndInt32, kMaxRank}, @@ -1312,8 +1342,11 @@ if (__builtin_available(macOS 15, *)) { properties.data_type_limits.dequantize_linear_scale.ranks = kMaxRank; properties.data_type_limits.dequantize_linear_zero_point.ranks = kMaxRank; + properties.data_type_limits.dequantize_linear_input.data_types = + DataTypeConstraint::kInts4ToInts8; + properties.data_type_limits.dequantize_linear_zero_point.data_types = + DataTypeConstraint::kInts4ToInts8; } - return properties; } @@ -2277,10 +2310,19 @@ CHECK_EQ(scale_operand_info.mil_data_type, GetOperandInfo(operation.output_operand_id).mil_data_type); + // TODO(crbug.com/338529226): Emulate unsupported paths when input is not + // constant. bool is_constant_input = constant_operands_->contains(operation.input_operand_id); - if (support_blockwise_dequantize_ && is_constant_input) { - return AddOperationForDequantizeLinearConstBlockwise(operation, block); + if (support_blockwise_dequantize_) { + if (is_constant_input) { + return AddOperationForDequantizeLinearConstBlockwise(operation, block); + } else if (input_operand_data_type == OperandDataType::kInt4 || + input_operand_data_type == OperandDataType::kUint4) { + return NewNotSupportedError( + "Unsupported input to dequantizeLinear. 'input' must be constant " + "for int4/uint4 types."); + } } if (scale_operand_info.dimensions.size() == 1 &&
diff --git a/storage/OWNERS b/storage/OWNERS index 1fdd44d..3e263769 100644 --- a/storage/OWNERS +++ b/storage/OWNERS
@@ -1,6 +1,7 @@ set noparent fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/storage/browser/file_system/OWNERS b/storage/browser/file_system/OWNERS index 79423b3c..b573829 100644 --- a/storage/browser/file_system/OWNERS +++ b/storage/browser/file_system/OWNERS
@@ -1,5 +1,6 @@ fergal@chromium.org horo@chromium.org +leimy@chromium.org mych@chromium.org rakina@chromium.org
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 79af3f11..f514f24 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -18905,21 +18905,6 @@ ] } ], - "QuickShareV2": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "QuickShareV2" - ] - } - ] - } - ], "RTCAlignReceivedEncodedVideoTransforms": [ { "platforms": [
diff --git a/third_party/angle b/third_party/angle index bc40362..f102ef0 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit bc40362b76d834549424022530a5e11933ff4862 +Subproject commit f102ef023fcb279daa667c7ab80d72c533869c98
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index c16ff5f..47f96b8 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -4705,6 +4705,9 @@ kPrivateNetworkAccessInsecureResourceNotKnownPrivate = 5319, kGeolocationGetCurrentPositionHighAccuracy = 5320, kGeolocationWatchPositionHighAccuracy = 5321, + kColumnPseudoElement = 5322, + kScrollButtonPseudoElement = 5323, + kScrollMarkerPseudoElement = 5324, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots. Also don't add extra
diff --git a/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom index ee745b3..e15f6010 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom
@@ -347,6 +347,10 @@ kMediaPlaybackQuality = 289, kWebgpu = 290, kZstd = 291, + kColumnPseudo = 292, + kInteractivity = 293, + kScrollButtons = 294, + kScrollMarkers = 295, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/core/clipboard/clipboard_utilities_test.cc b/third_party/blink/renderer/core/clipboard/clipboard_utilities_test.cc index 3ee0d664..6caf6e7 100644 --- a/third_party/blink/renderer/core/clipboard/clipboard_utilities_test.cc +++ b/third_party/blink/renderer/core/clipboard/clipboard_utilities_test.cc
@@ -4,7 +4,10 @@ #include "third_party/blink/renderer/core/clipboard/clipboard_utilities.h" +#include <string> + #include "base/containers/span.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/platform/image-encoders/image_encoder.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" @@ -64,9 +67,16 @@ Vector<uint8_t> png_data; EXPECT_TRUE(ImageEncoder::Encode(&png_data, pixmap, options)); - EXPECT_EQ( - R"HTML(<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAFCAYAAAB8ZH1oAAAADElEQVQYGWNgGEYAAADNAAGVVebMAAAAAElFTkSuQmCC" alt=""/>)HTML", - PNGToImageMarkup(png_data)); + std::string markup = PNGToImageMarkup(png_data).Utf8(); + + // The first 16 of a PNG file are always the same, so the + // `StartsWith`/`EndsWith`-based assertions below are expected to succeed + // regardless of the exact encoding settings or the encoding library used. + EXPECT_THAT( + markup, + testing::StartsWith( + R"HTML(<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhE)HTML")); + EXPECT_THAT(markup, testing::EndsWith(R"HTML(" alt=""/>)HTML")); } } // namespace blink
diff --git a/third_party/blink/renderer/core/css/remote_font_face_source.cc b/third_party/blink/renderer/core/css/remote_font_face_source.cc index 09b50e7..a7f3968 100644 --- a/third_party/blink/renderer/core/css/remote_font_face_source.cc +++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc
@@ -363,6 +363,10 @@ if (IsLoaded()) { return; } + // Skip loading if the document is for markup sanitization. + if (GetDocument() && GetDocument()->IsForMarkupSanitization()) { + return; + } ExecutionContext* const execution_context = font_selector_->GetExecutionContext(); if (!execution_context) {
diff --git a/third_party/blink/renderer/core/css/resolver/style_cascade.cc b/third_party/blink/renderer/core/css/resolver/style_cascade.cc index 5ca3925..4541d65 100644 --- a/third_party/blink/renderer/core/css/resolver/style_cascade.cc +++ b/third_party/blink/renderer/core/css/resolver/style_cascade.cc
@@ -98,6 +98,15 @@ return false; } +template <CSSParserTokenType... Types> +StringView ConsumeUntilPeekedTypeIs(CSSParserTokenStream& stream) { + wtf_size_t value_start_offset = stream.LookAheadOffset(); + stream.SkipUntilPeekedTypeIs<Types...>(); + wtf_size_t value_end_offset = stream.LookAheadOffset(); + return stream.StringRangeAt(value_start_offset, + value_end_offset - value_start_offset); +} + const CSSValue* Parse(const CSSProperty& property, CSSParserTokenStream& stream, const CSSParserContext* context) { @@ -1626,15 +1635,17 @@ if (stream.Peek().GetType() == kCommaToken) { stream.ConsumeIncludingWhitespace(); } - wtf_size_t value_start_offset = stream.LookAheadOffset(); - stream.SkipUntilPeekedTypeIs<kCommaToken>(); - wtf_size_t value_end_offset = stream.LookAheadOffset(); - argument_string = stream.StringRangeAt( - value_start_offset, value_end_offset - value_start_offset); - // Explicitly empty values, e.g. --foo(1,,3), are not allowed. - if (argument_string.empty()) { - return false; + // Handle {}-wrapper. + // https://drafts.csswg.org/css-values-5/#component-function-commas + if (stream.Peek().GetType() == kLeftBraceToken) { + CSSParserTokenStream::BlockGuard guard(stream); + stream.ConsumeWhitespace(); + DCHECK(!stream.AtEnd()); + argument_string = ConsumeUntilPeekedTypeIs<>(stream); + } else { + argument_string = ConsumeUntilPeekedTypeIs<kCommaToken>(stream); } + DCHECK(!argument_string.empty()); // Handled parse-time. } else if (parameter.default_value) { argument_string = parameter.default_value->OriginalText(); } else {
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc index 8e57aea..c57b27f 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -2635,12 +2635,14 @@ InitStyle(element, style_request, initial_style, state.ParentStyle(), state); + ExpandInheritedVisitedProperties(state); + // contenteditable attribute (implemented by -webkit-user-modify) should // be propagated from shadow host to distributed node. // - // This can be overridden by matched properties, so we don't want to do it - // when we have a cache hit; both this fixup and any overriding of it have - // already been applied in the cached data. + // This can be overridden by matched properties, so we don't want to do + // it when we have a cache hit; both this fixup and any overriding of it + // have already been applied in the cached data. if (!IsForPseudoElement(element, style_request) && element.AssignedSlot()) { if (Element* parent = element.parentElement()) { if (!RuntimeEnabledFeatures:: @@ -3028,6 +3030,35 @@ return GetDocument().InForcedColorsMode(); } +// Expand inherited visited properties at visited-link boundaries. +// +// This expansion normally happens cascade-time (see ExpandCascade), +// but for performance reasons we only do this when we're inside +// a visited link. This causes problems when inheriting colors (or +// other affected properties) into a visited link, since (once inside +// that visited link), we'll start using the visited color field +// for rendering, which wasn't expanded higher up in the ancestor chain. +void StyleResolver::ExpandInheritedVisitedProperties( + StyleResolverState& state) { + if (state.ParentStyle() && + state.ParentStyle()->InsideLink() == EInsideLink::kNotInsideLink && + state.InsideLink() == EInsideLink::kInsideVisitedLink) { + state.StyleBuilder().SetInternalVisitedColor(state.StyleBuilder().Color()); + state.StyleBuilder().SetInternalVisitedCaretColor( + state.StyleBuilder().CaretColor()); + state.StyleBuilder().SetInternalVisitedFillPaint( + state.StyleBuilder().FillPaint()); + state.StyleBuilder().SetInternalVisitedStrokePaint( + state.StyleBuilder().StrokePaint()); + state.StyleBuilder().SetInternalVisitedTextEmphasisColor( + state.StyleBuilder().TextEmphasisColor()); + state.StyleBuilder().SetInternalVisitedTextFillColor( + state.StyleBuilder().TextFillColor()); + state.StyleBuilder().SetInternalVisitedTextStrokeColor( + state.StyleBuilder().TextStrokeColor()); + } +} + ComputedStyleBuilder StyleResolver::CreateAnonymousStyleBuilderWithDisplay( const ComputedStyle& parent_style, EDisplay display) {
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.h b/third_party/blink/renderer/core/css/resolver/style_resolver.h index 64a3f53..a4dce18 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.h +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.h
@@ -361,6 +361,8 @@ bool IsForcedColorsModeEnabled() const; + void ExpandInheritedVisitedProperties(StyleResolverState& state); + enum UASheetCacheKeyIndex { kHTMLUASheet, kSVGUASheet,
diff --git a/third_party/blink/renderer/core/dom/column_pseudo_element.cc b/third_party/blink/renderer/core/dom/column_pseudo_element.cc index cb8a44d..53ad0cc 100644 --- a/third_party/blink/renderer/core/dom/column_pseudo_element.cc +++ b/third_party/blink/renderer/core/dom/column_pseudo_element.cc
@@ -4,8 +4,18 @@ #include "third_party/blink/renderer/core/dom/column_pseudo_element.h" +#include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" + namespace blink { +ColumnPseudoElement::ColumnPseudoElement(Element* originating_element, + wtf_size_t index) + : PseudoElement(originating_element, kPseudoIdColumn), index_(index) { + UseCounter::Count(GetDocument(), WebFeature::kColumnPseudoElement); +} + void ColumnPseudoElement::AttachLayoutTree(AttachContext& context) { // A ::column element can not have a box, but it may have a ::scroll-marker // child.
diff --git a/third_party/blink/renderer/core/dom/column_pseudo_element.h b/third_party/blink/renderer/core/dom/column_pseudo_element.h index 696241c..9434695c 100644 --- a/third_party/blink/renderer/core/dom/column_pseudo_element.h +++ b/third_party/blink/renderer/core/dom/column_pseudo_element.h
@@ -14,8 +14,7 @@ // will create one of these, during layout. class ColumnPseudoElement : public PseudoElement { public: - ColumnPseudoElement(Element* originating_element, wtf_size_t index) - : PseudoElement(originating_element, kPseudoIdColumn), index_(index) {} + ColumnPseudoElement(Element* originating_element, wtf_size_t index); bool IsColumnPseudoElement() const final { return true; } wtf_size_t Index() const { return index_; }
diff --git a/third_party/blink/renderer/core/dom/element_rare_data_field.h b/third_party/blink/renderer/core/dom/element_rare_data_field.h index c201f6b..aaedd43 100644 --- a/third_party/blink/renderer/core/dom/element_rare_data_field.h +++ b/third_party/blink/renderer/core/dom/element_rare_data_field.h
@@ -10,21 +10,11 @@ namespace blink { -class Node; - class ElementRareDataField : public GarbageCollectedMixin { public: void Trace(Visitor* visitor) const override {} }; -template <typename T> -struct ThreadingTrait< - T, - std::enable_if_t<std::is_base_of_v<blink::ElementRareDataField, T> && - !std::is_base_of_v<blink::Node, T>>> { - static constexpr ThreadAffinity kAffinity = kMainThreadOnly; -}; - } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_ELEMENT_RARE_DATA_FIELD_H_
diff --git a/third_party/blink/renderer/core/dom/scroll_button_pseudo_element.cc b/third_party/blink/renderer/core/dom/scroll_button_pseudo_element.cc index 99bce620..5f6550bc 100644 --- a/third_party/blink/renderer/core/dom/scroll_button_pseudo_element.cc +++ b/third_party/blink/renderer/core/dom/scroll_button_pseudo_element.cc
@@ -14,11 +14,13 @@ #include "third_party/blink/renderer/core/dom/focus_params.h" #include "third_party/blink/renderer/core/event_type_names.h" #include "third_party/blink/renderer/core/events/keyboard_event.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/scroll/scroll_alignment.h" #include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h" #include "third_party/blink/renderer/core/scroll/scroll_types.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/keyboard_codes.h" namespace blink { @@ -54,6 +56,7 @@ : PseudoElement(originating_element, pseudo_id), ScrollSnapshotClient(originating_element->GetDocument().GetFrame()) { SetTabIndexExplicitly(); + UseCounter::Count(GetDocument(), WebFeature::kScrollButtonPseudoElement); } void ScrollButtonPseudoElement::Trace(Visitor* v) const {
diff --git a/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.cc b/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.cc index a1ac0993..425d9c4e 100644 --- a/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.cc +++ b/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.cc
@@ -10,14 +10,23 @@ #include "third_party/blink/renderer/core/dom/focus_params.h" #include "third_party/blink/renderer/core/dom/scroll_marker_group_pseudo_element.h" #include "third_party/blink/renderer/core/events/keyboard_event.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/scroll/scroll_alignment.h" #include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h" #include "third_party/blink/renderer/core/style/computed_style.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/keyboard_codes.h" namespace blink { +ScrollMarkerPseudoElement::ScrollMarkerPseudoElement( + Element* originating_element) + : PseudoElement(originating_element, kPseudoIdScrollMarker) { + SetTabIndexExplicitly(); + UseCounter::Count(GetDocument(), WebFeature::kScrollMarkerPseudoElement); +} + void ScrollMarkerPseudoElement::DefaultEventHandler(Event& event) { bool is_click = event.IsMouseEvent() && event.type() == event_type_names::kClick;
diff --git a/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h b/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h index e6fac43..e5c7489 100644 --- a/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h +++ b/third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h
@@ -13,10 +13,7 @@ class ScrollMarkerPseudoElement : public PseudoElement { public: - explicit ScrollMarkerPseudoElement(Element* originating_element) - : PseudoElement(originating_element, kPseudoIdScrollMarker) { - SetTabIndexExplicitly(); - } + explicit ScrollMarkerPseudoElement(Element* originating_element); bool IsScrollMarkerPseudoElement() const final { return true; }
diff --git a/third_party/blink/renderer/core/dom/space_split_string.h b/third_party/blink/renderer/core/dom/space_split_string.h index e376c98..f0701d5 100644 --- a/third_party/blink/renderer/core/dom/space_split_string.h +++ b/third_party/blink/renderer/core/dom/space_split_string.h
@@ -151,18 +151,6 @@ CORE_EXPORT std::ostream& operator<<(std::ostream&, const SpaceSplitString&); -template <> -struct ThreadingTrait<SpaceSplitString> { - STATIC_ONLY(ThreadingTrait); - static constexpr ThreadAffinity kAffinity = kMainThreadOnly; -}; - -template <> -struct ThreadingTrait<SpaceSplitString::Data> { - STATIC_ONLY(ThreadingTrait); - static constexpr ThreadAffinity kAffinity = kMainThreadOnly; -}; - } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_SPACE_SPLIT_STRING_H_
diff --git a/third_party/blink/renderer/core/editing/serializers/serialization.cc b/third_party/blink/renderer/core/editing/serializers/serialization.cc index 6e07163..e3067ce5 100644 --- a/third_party/blink/renderer/core/editing/serializers/serialization.cc +++ b/third_party/blink/renderer/core/editing/serializers/serialization.cc
@@ -128,13 +128,14 @@ public: scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override { - // TODO(crbug.com/1413912): CreateSanitizedFragmentFromMarkupWithContext may + // TODO(crbug.com/1413912): CreateFragmentFromMarkupWithContext may // call this method for data: URL resources. But ResourceLoader::Start() // don't need to call GetURLLoaderFactory() for data: URL because // ResourceLoader handles the data: URL resource load without the returned // SharedURLLoaderFactory. - // Note: Non-data: URL resource can't be loaded because the CORS check in - // BaseFetchContext::CanRequestInternal fails for non-data: URL resources. + // Note: Non-data: URL resource can't be loaded because the security checks + // in BaseFetchContext::CanRequestInternal fails for non-data: URL + // resources. return base::MakeRefCounted<network::SingleRequestURLLoaderFactory>( WTF::BindOnce( [](const network::ResourceRequest& resource_request,
diff --git a/third_party/blink/renderer/core/editing/serializers/serialization_test.cc b/third_party/blink/renderer/core/editing/serializers/serialization_test.cc index 57eb0ea..b8fab2ab 100644 --- a/third_party/blink/renderer/core/editing/serializers/serialization_test.cc +++ b/third_party/blink/renderer/core/editing/serializers/serialization_test.cc
@@ -138,4 +138,22 @@ EXPECT_TRUE(strictly_processed_fragment); } +// Regression test for https://crbug.com/40840595 +TEST_F(SerializationTest, CSSFontFaceLoadCrash) { + const String markup = + "<style>" + " @font-face {" + " font-family: \"custom-font\";" + " src: " + "url(\"https://mdn.github.io/css-examples/web-fonts/VeraSeBd.ttf\");" + " }" + " </style>" + "<span style=\"font-family: custom-font\">lorem ipsum</span>"; + const String sanitized_markup = CreateStrictlyProcessedMarkupWithContext( + GetDocument(), markup, 0, markup.length(), KURL()); + // This is a crash test. We don't verify the content of the strictly processed + // markup as it is not interesting. + EXPECT_TRUE(sanitized_markup); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message_mojom_traits.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message_mojom_traits.cc index 19e527d..50a91ec 100644 --- a/third_party/blink/renderer/core/messaging/blink_transferable_message_mojom_traits.cc +++ b/third_party/blink/renderer/core/messaging/blink_transferable_message_mojom_traits.cc
@@ -60,7 +60,11 @@ blink::mojom::blink::SerializedStaticBitmapImage::NewAcceleratedImage( blink::AcceleratedImageInfo{ shared_image->Export(), cloned_image->GetSyncToken(), - cloned_image->GetSkImageInfo(), + SkImageInfo::Make(cloned_image->GetSize().width(), + cloned_image->GetSize().height(), + cloned_image->GetSkColorType(), + cloned_image->GetAlphaType(), + cloned_image->GetSkColorSpace()), WTF::BindOnce(&blink::StaticBitmapImage::UpdateSyncToken, std::move(cloned_image))}); return result;
diff --git a/third_party/blink/renderer/core/paint/rounded_border_geometry.cc b/third_party/blink/renderer/core/paint/rounded_border_geometry.cc index 0f1da36..eeaad21 100644 --- a/third_party/blink/renderer/core/paint/rounded_border_geometry.cc +++ b/third_party/blink/renderer/core/paint/rounded_border_geometry.cc
@@ -81,57 +81,33 @@ } // Each corner is rendered independently and its rendering should remain within -// the corner bounds. With low curvature values (curvature<2), as well as with -// elliptical corners, this creates an effect where lines/curves drawn at the +// the corner bounds. With low curvature values (curvature<2),this creates an +// effect where lines/curves drawn at the // border-width offset would seem thinner than the given border-width. To // correct this, while maintaining the rule of drawing only within the corners, -// the outer corner is inset by some offset, computed by the slope and different -// border-widths. The resulting smaller outer corner size creates the effect of -// having a larger border, which matches the specified border-width. Note that -// it's currently implemented for bevel (straight line), and for other -// curvatures it would have to use something equivalent to the tangent (the -// nearest control point). Note that some of this is an open spec issue: +// the outer corner is inset by some offset. +// Note that this doesn't account for elliptical corners, as those aren't +// corrected for ordinary rounded rects as well. See open spec issue: // https://github.com/w3c/csswg-drafts/issues/11610 gfx::SizeF InsetOuterCornerSizeForCurvature(const gfx::SizeF& corner_size, float curvature, float horizontal_border_width, float vertical_border_width) { - // TODO(noamr) implement for other curvatures. - if (curvature != FloatRoundedRect::CornerCurvature::kBevel) { + if (curvature >= 2) { return corner_size; } + if (curvature <= 0.5) { + return corner_size - + gfx::SizeF(vertical_border_width, horizontal_border_width); + } - CHECK(!corner_size.IsEmpty()); - - // The slope would be different for curvatures other than bevel. The slope - // would be based on the control point. - float slope = corner_size.height() / corner_size.width(); - - // compute two vector that would be perpendicular to the straight line, - // with the border widths as their sizes. - gfx::Vector2dF perpendicular_vector(-corner_size.height(), - corner_size.width()); - float magnitude = perpendicular_vector.Length(); - gfx::Vector2dF horizontal_side_translation = gfx::ScaleVector2d( - perpendicular_vector, horizontal_border_width / magnitude, - horizontal_border_width / magnitude); - gfx::Vector2dF vertical_side_translation = gfx::ScaleVector2d( - perpendicular_vector, vertical_border_width / magnitude, - vertical_border_width / magnitude); - - // Given the translations, compute the intercepts (b) of the wanted equation. - float vertical_side_intercept = - vertical_side_translation.y() - slope * vertical_side_translation.x(); - float horizontal_side_intercept = - horizontal_side_translation.y() - slope * horizontal_side_translation.x(); - - // The found intercepts are relative to the *inner* rect, as the requisited - // distance is relative to the inner rect. So correct using the border width, - // as the offset applies to the outer rect. - return gfx::SizeF( - corner_size.width() + vertical_border_width - vertical_side_intercept, - corner_size.height() + horizontal_border_width - - horizontal_side_intercept); + // The offset from the inner edge is sqrt(2 / curvature). + // This would result in an offset of sqrt(2) for bevel, and and offset of 2 + // for scoop. We then subtract it by 1 to get the offset from the outer edge. + float offset_from_outer_edge = std::sqrt(2. / curvature) - 1; + return corner_size - + gfx::SizeF(vertical_border_width * offset_from_outer_edge, + horizontal_border_width * offset_from_outer_edge); } FloatRoundedRect RoundedBorderGeometry::PixelSnappedRoundedBorder(
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index 340c9d6b..dffb75d 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -2705,6 +2705,7 @@ friend class LayoutTheme; friend class StyleAdjuster; friend class StyleResolverState; + friend class StyleResolver; // Access to UserModify(). friend class MatchedPropertiesCache;
diff --git a/third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc b/third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc index 441779b6..265a1d3 100644 --- a/third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc +++ b/third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
@@ -32,6 +32,7 @@ #include "third_party/blink/renderer/core/svg/svg_element.h" #include "third_party/blink/renderer/core/svg/svg_length_functions.h" #include "third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h" +#include "third_party/blink/renderer/core/svg/svg_view_spec.h" #include "third_party/blink/renderer/platform/graphics/filters/filter.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h" @@ -140,8 +141,14 @@ return nullptr; } if (auto* svg_image = DynamicTo<SVGImage>(*image_)) { + const SVGImageViewInfo* view_info = nullptr; + const SVGViewSpec* view_spec = + SVGViewSpec::CreateFromAspectRatio(preserve_aspect_ratio_); + if (view_spec) { + view_info = MakeGarbageCollected<SVGImageViewInfo>(view_spec, nullptr); + } return SVGImageForContainer::Create( - *svg_image, container_size, GetFilter()->Scale(), nullptr, + *svg_image, container_size, GetFilter()->Scale(), view_info, mojom::blink::PreferredColorScheme::kLight); } return image_;
diff --git a/third_party/blink/renderer/core/svg/svg_view_spec.cc b/third_party/blink/renderer/core/svg/svg_view_spec.cc index 15c5bb7..ad725a21 100644 --- a/third_party/blink/renderer/core/svg/svg_view_spec.cc +++ b/third_party/blink/renderer/core/svg/svg_view_spec.cc
@@ -32,8 +32,6 @@ namespace blink { -SVGViewSpec::SVGViewSpec() : zoom_and_pan_(kSVGZoomAndPanUnknown) {} - void SVGViewSpec::Trace(Visitor* visitor) const { visitor->Trace(view_box_); visitor->Trace(preserve_aspect_ratio_); @@ -61,6 +59,16 @@ return view_spec; } +const SVGViewSpec* SVGViewSpec::CreateFromAspectRatio( + const SVGPreserveAspectRatio* preserve_aspect_ratio) { + if (!preserve_aspect_ratio) { + return nullptr; + } + SVGViewSpec* view_spec = MakeGarbageCollected<SVGViewSpec>(); + view_spec->preserve_aspect_ratio_ = preserve_aspect_ratio; + return view_spec; +} + bool SVGViewSpec::ParseViewSpec(const String& spec) { if (spec.empty()) return false; @@ -151,15 +159,21 @@ if (zoom_and_pan_ == kSVGZoomAndPanUnknown) return false; break; - case kPreserveAspectRatio: - preserve_aspect_ratio_ = MakeGarbageCollected<SVGPreserveAspectRatio>(); - if (!preserve_aspect_ratio_->Parse(ptr, end, false)) + case kPreserveAspectRatio: { + auto* preserve_aspect_ratio = + MakeGarbageCollected<SVGPreserveAspectRatio>(); + if (!preserve_aspect_ratio->Parse(ptr, end, false)) { return false; + } + preserve_aspect_ratio_ = preserve_aspect_ratio; break; - case kTransform: - transform_ = MakeGarbageCollected<SVGTransformList>(); - transform_->Parse(ptr, end); + } + case kTransform: { + auto* transform = MakeGarbageCollected<SVGTransformList>(); + transform->Parse(ptr, end); + transform_ = transform; break; + } default: NOTREACHED(); }
diff --git a/third_party/blink/renderer/core/svg/svg_view_spec.h b/third_party/blink/renderer/core/svg/svg_view_spec.h index 7631f2a..798684f 100644 --- a/third_party/blink/renderer/core/svg/svg_view_spec.h +++ b/third_party/blink/renderer/core/svg/svg_view_spec.h
@@ -35,8 +35,8 @@ public: static const SVGViewSpec* CreateFromFragment(const String&); static const SVGViewSpec* CreateForViewElement(const SVGViewElement&); - - SVGViewSpec(); + static const SVGViewSpec* CreateFromAspectRatio( + const SVGPreserveAspectRatio*); const SVGRect* ViewBox() const { return view_box_.Get(); } const SVGPreserveAspectRatio* PreserveAspectRatio() const { @@ -52,10 +52,10 @@ template <typename CharType> bool ParseViewSpecInternal(const CharType* ptr, const CharType* end); - Member<SVGRect> view_box_; - Member<SVGPreserveAspectRatio> preserve_aspect_ratio_; - Member<SVGTransformList> transform_; - SVGZoomAndPanType zoom_and_pan_; + Member<const SVGRect> view_box_; + Member<const SVGPreserveAspectRatio> preserve_aspect_ratio_; + Member<const SVGTransformList> transform_; + SVGZoomAndPanType zoom_and_pan_ = kSVGZoomAndPanUnknown; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc b/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc index c7135a7a..64409da 100644 --- a/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc +++ b/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc
@@ -224,7 +224,7 @@ const bool context_alpha = GetParam().alpha; - auto canvas_resource = CanvasResourceSharedBitmap::Create( + auto canvas_resource = CanvasResourceSharedImage::CreateSoftware( offscreen_canvas().Size(), viz::SinglePlaneFormat::kRGBA_8888, kPremul_SkAlphaType, gfx::ColorSpace::CreateSRGB(), /*provider=*/nullptr, shared_image_interface_provider()); @@ -250,7 +250,7 @@ SkIRect::MakeWH(10, 10)); platform->RunUntilIdle(); - auto canvas_resource2 = CanvasResourceSharedBitmap::Create( + auto canvas_resource2 = CanvasResourceSharedImage::CreateSoftware( offscreen_canvas().Size(), viz::SinglePlaneFormat::kRGBA_8888, kPremul_SkAlphaType, gfx::ColorSpace::CreateSRGB(), /*provider=*/nullptr, shared_image_interface_provider());
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index b050a77d..e713856 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -6449,7 +6449,7 @@ // ignored. Set `adjusted_params` such that no conversions will be made using // that state. params.unpack_premultiply_alpha = - static_bitmap_image->GetSkImageInfo().alphaType() == kPremul_SkAlphaType; + static_bitmap_image->GetAlphaType() == kPremul_SkAlphaType; params.unpack_flip_y = false; const bool image_has_flip_y = false; // TODO(kbr): make this work for sub-rectangles of ImageBitmaps.
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.cc b/third_party/blink/renderer/platform/graphics/canvas_resource.cc index 7401995..4574ba90 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.cc
@@ -279,10 +279,10 @@ color_space_.ToSkColorSpace()); } -// CanvasResourceSharedBitmap +// CanvasResourceSharedImage //============================================================================== -CanvasResourceSharedBitmap::CanvasResourceSharedBitmap( +CanvasResourceSharedImage::CanvasResourceSharedImage( gfx::Size size, viz::SharedImageFormat format, SkAlphaType alpha_type, @@ -294,7 +294,9 @@ size, format, alpha_type, - color_space) { + color_space), + is_accelerated_(false), + use_oop_rasterization_(false) { if (!shared_image_interface_provider) { return; } @@ -304,41 +306,23 @@ return; } - shared_image_ = + owning_thread_data().client_shared_image = shared_image_interface->CreateSharedImageForSoftwareCompositor( {viz::SinglePlaneFormat::kBGRA_8888, size, gfx::ColorSpace(), gpu::SHARED_IMAGE_USAGE_CPU_WRITE_ONLY, - "CanvasResourceSharedBitmap"}); + "CanvasResourceSharedImage"}); - // This class doesn't currently have a way of verifying the sync token at the - // time of vending it in GetSyncTokenWithOptionalVerification(), so we - // instead ensure that it is verified now. - sync_token_ = shared_image_interface->GenVerifiedSyncToken(); + // This class doesn't currently have a way of verifying the sync token for + // software SharedImages at the time of vending it in + // GetSyncTokenWithOptionalVerification(), so we instead ensure that it is + // verified now. + owning_thread_data().sync_token = + shared_image_interface->GenVerifiedSyncToken(); + owning_thread_data().mailbox_needs_new_sync_token = false; } -CanvasResourceSharedBitmap::~CanvasResourceSharedBitmap() { - if (is_cross_thread()) { - // Destroyed on wrong thread. This can happen when the thread of origin was - // torn down, in which case the GPU context owning any underlying resources - // no longer exists and it is not possible to do cleanup of any GPU - // context-associated state. - return; - } - - if (Provider()) { - Provider()->OnDestroyResource(); - } -} - -bool CanvasResourceSharedBitmap::IsValid() const { - return !!shared_image_; -} - -scoped_refptr<StaticBitmapImage> CanvasResourceSharedBitmap::Bitmap() { - return CreateUnacceleratedBitmap(); -} - -scoped_refptr<CanvasResourceSharedBitmap> CanvasResourceSharedBitmap::Create( +scoped_refptr<CanvasResourceSharedImage> +CanvasResourceSharedImage::CreateSoftware( gfx::Size size, viz::SharedImageFormat format, SkAlphaType alpha_type, @@ -346,19 +330,12 @@ base::WeakPtr<CanvasResourceProvider> provider, base::WeakPtr<WebGraphicsSharedImageInterfaceProvider> shared_image_interface_provider) { - auto resource = AdoptRef(new CanvasResourceSharedBitmap( + auto resource = AdoptRef(new CanvasResourceSharedImage( size, format, alpha_type, color_space, std::move(provider), std::move(shared_image_interface_provider))); return resource->IsValid() ? resource : nullptr; } -void CanvasResourceSharedBitmap::NotifyResourceLost() { - is_lost_ = true; -} - -// CanvasResourceSharedImage -//============================================================================== - CanvasResourceSharedImage::CanvasResourceSharedImage( gfx::Size size, viz::SharedImageFormat format, @@ -674,6 +651,16 @@ const gpu::SyncToken CanvasResourceSharedImage::GetSyncTokenWithOptionalVerification( bool needs_verified_token) { + if (GetClientSharedImage()->is_software()) { + // This class doesn't currently have a way of verifying the sync token + // within this call for software SharedImages, so it instead ensures that it + // is verified at the time of generation. + DCHECK(!mailbox_needs_new_sync_token()); + DCHECK(sync_token().verified_flush()); + + return sync_token(); + } + if (is_cross_thread()) { // Sync token should be generated at Transfer time, which must always be // called before cross-thread usage. And since we don't allow writes on
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.h b/third_party/blink/renderer/platform/graphics/canvas_resource.h index 55fdda9..ad8707e 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.h +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.h
@@ -230,60 +230,17 @@ bool is_origin_clean_ = true; }; -// Resource type for SharedBitmaps -class PLATFORM_EXPORT CanvasResourceSharedBitmap final : public CanvasResource { - public: - static scoped_refptr<CanvasResourceSharedBitmap> Create( - gfx::Size size, - viz::SharedImageFormat format, - SkAlphaType alpha_type, - const gfx::ColorSpace& color_space, - base::WeakPtr<CanvasResourceProvider>, - base::WeakPtr<WebGraphicsSharedImageInterfaceProvider>); - ~CanvasResourceSharedBitmap() override; - bool IsRecycleable() const final { return !is_lost_; } - bool IsValid() const final; - bool CreatesAcceleratedTransferableResources() const final { return false; } - scoped_refptr<gpu::ClientSharedImage> GetClientSharedImage() final { - return shared_image_; - } - - const gpu::SyncToken GetSyncTokenWithOptionalVerification( - bool needs_verified_token) final { - // This class doesn't currently have a way of verifying the sync token - // within this call, so it instead ensures that it is verified at the time - // of generation. - CHECK(sync_token_.verified_flush()); - return sync_token_; - } - - base::WeakPtr<WebGraphicsContext3DProviderWrapper> ContextProviderWrapper() - const override { - return nullptr; - } - - scoped_refptr<StaticBitmapImage> Bitmap() final; - void NotifyResourceLost() override; - - private: - CanvasResourceSharedBitmap( - gfx::Size size, - viz::SharedImageFormat format, - SkAlphaType alpha_type, - const gfx::ColorSpace& color_space, - base::WeakPtr<CanvasResourceProvider>, - base::WeakPtr<WebGraphicsSharedImageInterfaceProvider>); - - bool UsesAcceleratedRaster() const final { return false; } - - scoped_refptr<gpu::ClientSharedImage> shared_image_; - gpu::SyncToken sync_token_; - bool is_lost_ = false; -}; - // Resource type for SharedImage class PLATFORM_EXPORT CanvasResourceSharedImage final : public CanvasResource { public: + static scoped_refptr<CanvasResourceSharedImage> CreateSoftware( + gfx::Size size, + viz::SharedImageFormat format, + SkAlphaType alpha_type, + const gfx::ColorSpace& color_space, + base::WeakPtr<CanvasResourceProvider>, + base::WeakPtr<WebGraphicsSharedImageInterfaceProvider>); + static scoped_refptr<CanvasResourceSharedImage> Create( gfx::Size size, viz::SharedImageFormat format, @@ -296,7 +253,9 @@ ~CanvasResourceSharedImage() override; bool IsRecycleable() const final { return !IsLost(); } - bool CreatesAcceleratedTransferableResources() const override { return true; } + bool CreatesAcceleratedTransferableResources() const override { + return !GetClientSharedImage()->is_software(); + } bool IsValid() const final; scoped_refptr<StaticBitmapImage> Bitmap() final; void Transfer() final; @@ -361,6 +320,14 @@ bool needs_verified_token) override; bool UsesAcceleratedRaster() const final { return is_accelerated_; } + CanvasResourceSharedImage( + gfx::Size size, + viz::SharedImageFormat format, + SkAlphaType alpha_type, + const gfx::ColorSpace& color_space, + base::WeakPtr<CanvasResourceProvider>, + base::WeakPtr<WebGraphicsSharedImageInterfaceProvider>); + CanvasResourceSharedImage(gfx::Size size, viz::SharedImageFormat format, SkAlphaType alpha_type,
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc index ce1a8c9..7218802 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc
@@ -367,7 +367,7 @@ CreateCompositorFrameSink_(viz::FrameSinkId(kClientId, kSinkId))); platform->RunUntilIdle(); - auto canvas_resource = CanvasResourceSharedBitmap::Create( + auto canvas_resource = CanvasResourceSharedImage::CreateSoftware( GetSize(), viz::SinglePlaneFormat::kRGBA_8888, kPremul_SkAlphaType, gfx::ColorSpace::CreateSRGB(), /*provider=*/nullptr, shared_image_interface_provider()); @@ -411,7 +411,8 @@ EXPECT_EQ(texture_quad->uv_top_left, gfx::PointF(0.0f, 0.0f)); EXPECT_EQ(texture_quad->uv_bottom_right, gfx::PointF(1.0f, 1.0f)); - // CanvasResourceSharedBitmap origin is top-left. + // CanvasResourceSharedImage::CreateSoftware() creates a resource + // whose origin is top-left. EXPECT_EQ(frame->resource_list.front().origin, kTopLeft_GrSurfaceOrigin); })));
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index 42c2496..6d3e695 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -266,9 +266,9 @@ format = GetN32FormatForCanvas(); } - return CanvasResourceSharedBitmap::Create(Size(), format, GetAlphaType(), - GetColorSpace(), CreateWeakPtr(), - shared_image_interface_provider_); + return CanvasResourceSharedImage::CreateSoftware( + Size(), format, GetAlphaType(), GetColorSpace(), CreateWeakPtr(), + shared_image_interface_provider_); } scoped_refptr<CanvasResource> ProduceCanvasResource( @@ -280,9 +280,9 @@ FlushCanvas(reason); - // Note that the resource *must* be a CanvasResourceSharedBitmap as this - // class creates CanvasResourceSharedBitmap instances exclusively. - static_cast<CanvasResourceSharedBitmap*>(output_resource.get()) + // Note that the resource *must* be a CanvasResourceSharedImage as this + // class creates CanvasResourceSharedImage instances exclusively. + static_cast<CanvasResourceSharedImage*>(output_resource.get()) ->UploadSoftwareRenderingResults(GetSkSurface()); return output_resource;
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc index 22de8a4..94324f14 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc
@@ -22,7 +22,7 @@ namespace blink { -TEST(CanvasResourceTest, PrepareTransferableResource_SharedBitmap) { +TEST(CanvasResourceTest, PrepareTransferableResource_Software) { test::TaskEnvironment task_environment; std::unique_ptr<WebGraphicsSharedImageInterfaceProvider> test_web_shared_image_interface_provider = @@ -31,7 +31,7 @@ test_web_shared_image_interface_provider->GetWeakPtr(); scoped_refptr<CanvasResource> canvas_resource = - CanvasResourceSharedBitmap::Create( + CanvasResourceSharedImage::CreateSoftware( gfx::Size(10, 10), viz::SinglePlaneFormat::kRGBA_8888, kPremul_SkAlphaType, gfx::ColorSpace::CreateSRGB(), /*CanvasResourceProvider=*/nullptr, shared_image_interface_provider);
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc index cae174a..c356bc5 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
@@ -194,12 +194,10 @@ bool is_overlay_candidate = shared_image->usage().Has(gpu::SHARED_IMAGE_USAGE_SCANOUT); - SkColorType color_type = image_for_compositor->GetSkImageInfo().colorType(); *out_resource = viz::TransferableResource::MakeGpu( shared_image, shared_image->GetTextureTarget(), image_for_compositor->GetSyncToken(), size, - viz::SkColorTypeToSinglePlaneSharedImageFormat(color_type), - is_overlay_candidate, + image_for_compositor->GetSharedImageFormat(), is_overlay_candidate, viz::TransferableResource::ResourceSource::kImageLayerBridge); out_resource->origin = image_for_compositor->IsOriginTopLeft() ? kTopLeft_GrSurfaceOrigin
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h index bc11110..b2a70400 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
@@ -7,6 +7,7 @@ #include "base/memory/weak_ptr.h" #include "base/notreached.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/client/client_shared_image.h" #include "gpu/command_buffer/common/mailbox_holder.h" #include "gpu/command_buffer/common/shared_image_usage.h" @@ -112,12 +113,17 @@ Vector<uint8_t> CopyImageData(const SkImageInfo& info, bool apply_orientation); - // Return the SkImageInfo of the internal representation of this image. - virtual SkImageInfo GetSkImageInfo() const = 0; gfx::Size GetSize() const { return gfx::Size(GetSkImageInfo().width(), GetSkImageInfo().height()); } SkAlphaType GetAlphaType() { return GetSkImageInfo().alphaType(); } + SkColorType GetSkColorType() { return GetSkImageInfo().colorType(); } + sk_sp<SkColorSpace> GetSkColorSpace() { + return GetSkImageInfo().refColorSpace(); + } + viz::SharedImageFormat GetSharedImageFormat() { + return viz::SkColorTypeToSinglePlaneSharedImageFormat(GetSkColorType()); + } protected: // Helper for sub-classes @@ -139,6 +145,10 @@ // AcceleratedStaticBitmapImage. To change this property, the call site would // have to call SetOriginClean(). bool is_origin_clean_ = true; + + private: + // Return the SkImageInfo of the internal representation of this image. + virtual SkImageInfo GetSkImageInfo() const = 0; }; template <>
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc index 7c3e6e5..5617a49d 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc
@@ -120,7 +120,6 @@ scoped_refptr<StaticBitmapImage> source, const StaticBitmapImageTransform::Params& options) { auto source_paint_image = source->PaintImageForCurrentFrame(); - auto source_info = source->GetSkImageInfo(); const auto source_orientation = GetSourceOrientation(source, options); // Compute the unoriented source and dest rects and sizes. @@ -145,12 +144,10 @@ } const auto bm_color_space = options.dest_color_space ? options.dest_color_space - : source_info.refColorSpace(); - const auto bm_info = - source_info.makeDimensions(source_rect.size()) - .makeAlphaType(bm_alpha_type) - .makeColorType(GetDestColorType(source_info.colorType())) - .makeColorSpace(bm_color_space); + : source->GetSkColorSpace(); + const auto bm_info = SkImageInfo::Make( + source_rect.size(), GetDestColorType(source->GetSkColorType()), + bm_alpha_type, bm_color_space); if (!bm.tryAllocPixels(bm_info)) { return nullptr; } @@ -313,7 +310,7 @@ return nullptr; } - const auto source_info = source->GetSkImageInfo(); + const auto source_color_space = source->GetSkColorSpace(); const bool needs_flip = options.flip_y; const bool needs_crop = options.source_rect != gfx::Rect(GetSourceSize(source, options)); @@ -323,8 +320,8 @@ const bool needs_convert_color_space = options.dest_color_space && !SkColorSpace::Equals(options.dest_color_space.get(), - source_info.colorSpace() - ? source_info.colorSpace() + source_color_space + ? source_color_space.get() : SkColorSpace::MakeSRGB().get()); const bool needs_alpha_change = (source->GetAlphaType() == kUnpremul_SkAlphaType) !=
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index baf476b..0875ef98 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1320,7 +1320,7 @@ { // https://drafts.csswg.org/css-shapes-2/#shape-function name: "CSSShapeFunction", - status: "experimental", + status: "stable", }, { name: "CSSShapeFunctionCompositeAnimation",
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 3c21857c..de4aac05 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3370,7 +3370,6 @@ crbug.com/626703 external/wpt/css/css-text-decor/text-shadow/svg-stroke.html [ Failure ] crbug.com/626703 external/wpt/quirks/line-height-preserved-segment-break.html [ Failure ] crbug.com/626703 external/wpt/svg/render/order/z-index.svg [ Failure ] -crbug.com/626703 external/wpt/svg/styling/color-inherit-link-visited.svg [ Failure ] crbug.com/626703 external/wpt/webrtc/RTCIceTransport.html [ Skip Timeout ] crbug.com/626703 [ Win11-arm64 ] external/wpt/gamepad/gamepad-secure-context.html [ Failure Timeout ] crbug.com/626703 [ Win11-arm64 ] virtual/fenced-frame-mparch/external/wpt/fenced-frame/default-enabled-features-allow-all.https.html [ Timeout ] @@ -3406,7 +3405,6 @@ crbug.com/626703 external/wpt/png/apng/fcTL-dispose-background.html [ Timeout ] crbug.com/626703 external/wpt/screen-orientation/lock-unlock-check.html [ Failure Pass Timeout ] crbug.com/626703 external/wpt/html/rendering/widgets/input-checkbox-switch-rtl.tentative.html [ Failure ] -crbug.com/626703 external/wpt/svg/color-inherit-link-visited.svg [ Failure ] crbug.com/626703 external/wpt/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.html [ Failure ] crbug.com/626703 external/wpt/html/semantics/selectors/pseudo-classes/input-checkbox-switch.tentative.window.html [ Failure ] crbug.com/626703 external/wpt/html/rendering/widgets/input-checkbox-switch-indeterminate.tentative.html [ Failure ]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-borders/tentative/corner-shape/corner-shape-render-ref.html b/third_party/blink/web_tests/external/wpt/css/css-borders/tentative/corner-shape/corner-shape-render-ref.html index 8bce3eca..8ae6ca5 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-borders/tentative/corner-shape/corner-shape-render-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-borders/tentative/corner-shape/corner-shape-render-ref.html
@@ -48,26 +48,22 @@ } const ctx = canvas.getContext("2d"); - +const keywords = {bevel: 1, round: 2}; // Adjust outer width for curvature const outer_width = ["top", "bottom"].flatMap((vSide) => ["left", "right"].map((hSide) => { const corner = `${vSide}-${hSide}`; - const shape = style[`corner-${corner}-shape`]; + let shape = style[`corner-${corner}-shape`]; + shape = keywords[shape] || shape; const radius = style[`border-${corner}-radius`]; - if (radius[0] === 0 || radius[1] === 0) return [0, 0]; - if (shape === "round") return [...radius]; - const hWidth = style[`border-${hSide}-width`]; const vWidth = style[`border-${vSide}-width`]; - let slope = radius[1] / radius[0]; - let perp = [-radius[0], radius[1]]; - const mag = Math.hypot(...radius); - const translateX = [(perp[0] * hWidth) / mag, (perp[1] * hWidth) / mag]; - const translateY = [(perp[0] * vWidth) / mag, (perp[1] * vWidth) / mag]; - const vIntercept = Math.max(0, translateY[1] - slope * translateY[0]); - const hIntercept = Math.max(0, translateX[1] - slope * translateX[0]); - return [radius[0] + vWidth - vIntercept, radius[1] + hWidth - hIntercept]; + if (shape >= 2.) + return radius; + if (shape <= 0.5) + return [radius[0] - vWidth, radius[1] - hWidth]; + const offset = Math.sqrt(2. / shape) - 1; + return [radius[0] - vWidth * offset, radius[1] - hWidth * offset]; }) ); let cursor = [];
diff --git a/third_party/blink/web_tests/external/wpt/css/css-mixins/dashed-function-eval.html b/third_party/blink/web_tests/external/wpt/css/css-mixins/dashed-function-eval.html index 7726e83..edb560cc 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-mixins/dashed-function-eval.html +++ b/third_party/blink/web_tests/external/wpt/css/css-mixins/dashed-function-eval.html
@@ -678,6 +678,83 @@ </style> </template> +<!-- + {}-wrappers. + + https://drafts.csswg.org/css-values-5/#component-function-commas +--> + +<template data-name="Passing list as only argument"> + <style> + @function --f(--x) { + result: var(--x); + } + #target { + --actual: --f({1px,2px}); + --expected: 1px,2px; + } + </style> +</template> + +<template data-name="Passing list as first argument"> + <style> + @function --f(--x, --y) { + result: var(--x) | var(--y); + } + #target { + --actual: --f({1px, 2px}, 3px); + --expected: 1px, 2px | 3px; + } + </style> +</template> + +<template data-name="Passing list as second argument"> + <style> + @function --f(--x, --y) { + result: var(--x) | var(--y); + } + #target { + --actual: --f(1px, {2px, 3px}); + --expected: 1px | 2px, 3px; + } + </style> +</template> + +<template data-name="Passing comma as argument"> + <style> + @function --f(--x) { + result: var(--x); + } + #target { + --actual: --f({,}); + --expected: ,; + } + </style> +</template> + +<template data-name="Passing {} as argument"> + <style> + @function --f(--x) { + result: var(--x); + } + #target { + --actual: --f({{}}); + --expected: {}; + } + </style> +</template> + +<template data-name="Passing non-whole-value {} as argument"> + <style> + @function --f(--x) { + result: var(--x); + } + #target { + --actual: --f({foo{}}); + --expected: foo{}; + } + </style> +</template> <script> test_all_templates();
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-feimage-005.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-feimage-005.html new file mode 100644 index 0000000..21846db3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/svg-feimage-005.html
@@ -0,0 +1,20 @@ +<!doctype html> +<title><feImage> with overriding preserveAspectRatio=none</title> +<link rel="help" href="https://drafts.fxtf.org/filter-effects/#feImageElement"> +<link rel="match" href="reference/green-100x100.html"> +<style> +#target { + filter: url(#f); + width: 100px; + height: 100px; +} +</style> +<div id="target"></div> +<svg> + <filter id="f" primitiveUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="0" y="0" width="1" height="1"> + <feImage x="0" y="0" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'> + <rect width='1' height='1' fill='green'/> + </svg>" preserveAspectRatio="none" width=".5" height="1"/> + <feTile/> + </filter> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance-ref.html b/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance-ref.html new file mode 100644 index 0000000..4d066db --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance-ref.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + caret-color: orange; + } +[contenteditable] { + outline: none; + } +</style> +<main> +<a id="link" style="caret-color:orange;" contenteditable href="">link</a> +</main> +<script> + window.onload = function() { + document.getElementById("link").focus(); + } +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance.html b/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance.html new file mode 100644 index 0000000..4d13d59f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/caret-color-visited-inheritance.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="match" href="caret-color-visited-inheritance-ref.html"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + caret-color: orange; + } +[contenteditable] { + outline: none; + } +</style> +<main> +<a id="link" contenteditable href="">link</a> +</main> +<script> + window.onload = function() { + document.getElementById("link").focus(); + } +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance-ref.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance-ref.html new file mode 100644 index 0000000..500e3a9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance-ref.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + } +</style> +<main> +<a href=""> + Simply <em style="text-emphasis-style: '!'; text-emphasis-color: green;">UNACCEPTABLE</em>. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance.html new file mode 100644 index 0000000..37ee4701 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-emphasis-visited-inheritance.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="match" href="text-emphasis-visited-inheritance-ref.html"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + text-emphasis-color: green; + } + em { + text-emphasis-style: "!"; /* (Should appear green). */ + } +</style> +<main> +<a href=""> + Simply <em>UNACCEPTABLE</em>. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance-ref.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance-ref.html new file mode 100644 index 0000000..e674df2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance-ref.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + } +</style> +<main> +<a href="" style="-webkit-text-fill-color: green;"> + Sample Paragraph. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance.html new file mode 100644 index 0000000..45d02e1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-fill-color-visited-inheritance.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="match" href="text-fill-color-visited-inheritance-ref.html"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + -webkit-text-fill-color: green; + } +</style> +<main> +<a href=""> + Sample Paragraph. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance-ref.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance-ref.html new file mode 100644 index 0000000..5f8afde --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance-ref.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + } +</style> +<main> +<a href="" style="-webkit-text-stroke-color:2px green;"> + The stroke colour in this sentence should be green. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance.html b/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance.html new file mode 100644 index 0000000..20c7cd6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/selectors/text-stroke-color-visited-inheritance.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="author" title="Divyansh Mangal" href="mailto:dmangal@microsoft.com"> +<link rel="match" href="text-stroke-color-visited-inheritance-ref.html"> +<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"> +<style> + :root { + font-size: 50px; + -webkit-text-stroke-color:2px green; + } +</style> +<main> +<a href=""> + The stroke colour in this sentence should be green. +</a> +</main>
diff --git a/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/resource.py b/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/resource.py similarity index 100% rename from third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/resource.py rename to third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/resource.py
diff --git a/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/helper.js b/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/helper.js index 29ed6449..94aa7b9 100644 --- a/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/helper.js +++ b/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/helper.js
@@ -37,7 +37,7 @@ data.type ??= "application/javascript"; data.counter = counter; let params = new URLSearchParams(data); - return "./resource.py?" + params.toString(); + return "/subresource-integrity/signatures/resource.py?" + params.toString(); } function generate_fetch_test(request_data, integrity, expectation, description) {
diff --git a/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/path.window.js b/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/path.window.js index f84fdfe..8927f80 100644 --- a/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/path.window.js +++ b/third_party/blink/web_tests/external/wpt/subresource-integrity/signatures/tentative/path.window.js
@@ -22,9 +22,6 @@ // // {"hello": "world"} // ``` -// -// TODO: When we remove the `tentative` label from the path, we'll need to -// regenerate the expected signatures below, as the signature base will change. // Metadata from the response above: const kRequestsWithValidSignature = [ @@ -32,26 +29,26 @@ // // ``` // "unencoded-digest";sf: sha-256=:PZJ+9CdAAIacg7wfUe4t/RkDQJVKM0mCZ2K7qiRhHFc=: - // "@path";req: /subresource-integrity/signatures/tentative/resource.py + // "@path";req: /subresource-integrity/signatures/resource.py // "@signature-params": ("unencoded-digest";sf "@path";req);keyid="JrQLj5P/89iXES9+vFgrIy29clF9CC/oPPsw3c5D0bs=";tag="sri" // ``` { body: "window.hello = `world`;", digest: "sha-256=:PZJ+9CdAAIacg7wfUe4t/RkDQJVKM0mCZ2K7qiRhHFc=:", - signature: `signature=:7tDPtzmoGvVu/qv3xJgdlyy5ss6FobmL0aR7Gzez3BvyTMSlIOb4ErCNRDyCMK4UesKSwfOrIH1y7xgAdr/OBw==:`, + signature: `signature=:+sRkplliS3TanqASHirBTokxhOn6fRTodc7i6Q6PUMsSPP0RJ2Xdb/woWz0+JXaBXAfa55qj+N9paXP5j7DFCw==:`, signatureInput: `signature=("unencoded-digest";sf "@path";req);keyid="${kValidKeys['rfc']}";tag="sri"` }, // `@path` then `unencoded-digest`, with the following signature base: // // ``` - // "@path";req: /subresource-integrity/signatures/tentative/resource.py + // "@path";req: /subresource-integrity/signatures/resource.py // "unencoded-digest";sf: sha-256=:PZJ+9CdAAIacg7wfUe4t/RkDQJVKM0mCZ2K7qiRhHFc=: // "@signature-params": ("@path";req "unencoded-digest";sf);keyid="JrQLj5P/89iXES9+vFgrIy29clF9CC/oPPsw3c5D0bs=";tag="sri" // ``` { body: "window.hello = `world`;", digest: "sha-256=:PZJ+9CdAAIacg7wfUe4t/RkDQJVKM0mCZ2K7qiRhHFc=:", - signature: `signature=:nw0vxi/Gj/UDbKTFddPEwKYAP5crT1sE916F+/rjb55LUaoxJcXDFPfUINzMOpHI5i6g6pn9tCOoFb6KwjXGDQ==:`, + signature: `signature=:YPH2/cRdbR+DPhb1hVG1BgwCpzPLECsAyBavmb7QaXtCF1Hx2QyYp0ki1mi7UftMOnLVpBJdfdLb99Nzf0XqDg==:`, signatureInput: `signature=("@path";req "unencoded-digest";sf);keyid="${kValidKeys['rfc']}";tag="sri"` } ];
diff --git a/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited-ref.svg b/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited-ref.svg new file mode 100644 index 0000000..c23a982e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited-ref.svg
@@ -0,0 +1,3 @@ +<svg width="100" height="100" stroke="red" fill="none" xmlns="http://www.w3.org/2000/svg"> + <rect width="100" height="100" stroke-width="5"></rect> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited.svg b/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited.svg new file mode 100644 index 0000000..274573d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/styling/stroke-color-inherit-link-visited.svg
@@ -0,0 +1,8 @@ +<svg width="100" height="100" stroke="red" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/1999/xhtml"> + <html:link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector"/> + <html:link rel="match" href="stroke-color-inherit-link-visited-ref.svg"/> + <html:meta name="assert" content="Tests that stroke is correctly inherited in the presence of visited link"/> + <a xlink:href=""> + <rect width="100" height="100" stroke-width="5"></rect> + </a> +</svg>
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/virtual/stable/inspector-protocol/dom-snapshot/dom-snapshot-captureSnapshot-details-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/virtual/stable/inspector-protocol/dom-snapshot/dom-snapshot-captureSnapshot-details-expected.txt deleted file mode 100644 index e24f3b6..0000000 --- a/third_party/blink/web_tests/flag-specific/highdpi/virtual/stable/inspector-protocol/dom-snapshot/dom-snapshot-captureSnapshot-details-expected.txt +++ /dev/null
@@ -1,344 +0,0 @@ -Tests that DOMSnapshot.captureSnapshot fills document details: title, size, etc. -{ - documents : [ - [0] : { - baseURL : 1 - contentHeight : 3000 - contentLanguage : 3 - contentWidth : 3000 - documentURL : <number> - encodingName : 4 - frameId : <number> - layout : { - bounds : [ - [0] : [ - [0] : 0 - [1] : 0 - [2] : 1200 - [3] : 900 - ] - [1] : [ - [0] : 0 - [1] : 0 - [2] : 1178 - [3] : 3000 - ] - [2] : [ - [0] : 0 - [1] : 0 - [2] : 1178 - [3] : 3000 - ] - [3] : [ - [0] : 0 - [1] : 0 - [2] : 3000 - [3] : 3000 - ] - [4] : [ - [0] : 0 - [1] : 0 - [2] : 285 - [3] : 15 - ] - ] - nodeIndex : [ - [0] : 0 - [1] : 2 - [2] : 15 - [3] : 17 - [4] : 18 - ] - stackingContexts : { - index : [ - [0] : 0 - [1] : 1 - ] - } - styles : [ - [0] : [ - ] - [1] : [ - ] - [2] : [ - ] - [3] : [ - ] - [4] : [ - ] - ] - text : [ - [0] : -1 - [1] : -1 - [2] : -1 - [3] : -1 - [4] : 31 - ] - } - nodes : { - attributes : [ - [0] : [ - ] - [1] : [ - ] - [2] : [ - ] - [3] : [ - ] - [4] : [ - ] - [5] : [ - ] - [6] : [ - ] - [7] : [ - ] - [8] : [ - [0] : 16 - [1] : 17 - [2] : 18 - [3] : 19 - ] - [9] : [ - ] - [10] : [ - [0] : 16 - [1] : 20 - [2] : 18 - [3] : 3 - ] - [11] : [ - ] - [12] : [ - [0] : 22 - [1] : 1 - ] - [13] : [ - ] - [14] : [ - ] - [15] : [ - [0] : 25 - [1] : 26 - [2] : 27 - [3] : 28 - ] - [16] : [ - ] - [17] : [ - [0] : 25 - [1] : 30 - ] - [18] : [ - ] - [19] : [ - ] - ] - backendNodeId : <object> - contentDocumentIndex : { - index : [ - ] - value : [ - ] - } - currentSourceURL : { - index : [ - ] - value : [ - ] - } - inputChecked : { - index : [ - ] - } - inputValue : { - index : [ - ] - value : [ - ] - } - isClickable : { - index : [ - ] - } - nodeName : [ - [0] : 8 - [1] : 9 - [2] : 10 - [3] : 11 - [4] : 12 - [5] : 14 - [6] : 12 - [7] : 12 - [8] : 15 - [9] : 12 - [10] : 15 - [11] : 12 - [12] : 21 - [13] : 12 - [14] : 12 - [15] : 24 - [16] : 12 - [17] : 29 - [18] : 12 - [19] : 12 - ] - nodeType : [ - [0] : 9 - [1] : 10 - [2] : 1 - [3] : 1 - [4] : 3 - [5] : 1 - [6] : 3 - [7] : 3 - [8] : 1 - [9] : 3 - [10] : 1 - [11] : 3 - [12] : 1 - [13] : 3 - [14] : 3 - [15] : 1 - [16] : 3 - [17] : 1 - [18] : 3 - [19] : 3 - ] - nodeValue : [ - [0] : -1 - [1] : -1 - [2] : -1 - [3] : -1 - [4] : 13 - [5] : -1 - [6] : 2 - [7] : 13 - [8] : -1 - [9] : 13 - [10] : -1 - [11] : 13 - [12] : -1 - [13] : 23 - [14] : 23 - [15] : -1 - [16] : 13 - [17] : -1 - [18] : 31 - [19] : 32 - ] - optionSelected : { - index : [ - ] - } - originURL : { - index : [ - ] - value : [ - ] - } - parentIndex : [ - [0] : -1 - [1] : 0 - [2] : 0 - [3] : 2 - [4] : 3 - [5] : 3 - [6] : 5 - [7] : 3 - [8] : 3 - [9] : 3 - [10] : 3 - [11] : 3 - [12] : 3 - [13] : 3 - [14] : 2 - [15] : 2 - [16] : 15 - [17] : 15 - [18] : 17 - [19] : 15 - ] - pseudoIdentifier : { - index : [ - ] - value : [ - ] - } - pseudoType : { - index : [ - ] - value : [ - ] - } - shadowRootType : <object> - textValue : { - index : [ - ] - value : [ - ] - } - } - publicId : 6 - scrollOffsetX : 450 - scrollOffsetY : 600 - systemId : 7 - textBoxes : { - bounds : [ - [0] : [ - [0] : 0 - [1] : 0 - [2] : 285 - [3] : 15 - ] - ] - layoutIndex : [ - [0] : 4 - ] - length : [ - [0] : 19 - ] - start : [ - [0] : 7 - ] - } - title : 2 - } - ] - strings : [ - [0] : - [1] : http://example.com/ - [2] : Document Title - [3] : nl-NL - [4] : UTF-8 - [5] : - [6] : -//W3C//DTD HTML 4.01//EN - [7] : http://www.w3.org/TR/html4/strict.dtd - [8] : #document - [9] : html - [10] : HTML - [11] : HEAD - [12] : #text - [13] : - [14] : TITLE - [15] : META - [16] : http-equiv - [17] : Content-Type - [18] : content - [19] : text/html; charset=utf-8 - [20] : Content-Language - [21] : BASE - [22] : href - [23] : - [24] : BODY - [25] : style - [26] : margin: 0px - [27] : onload - [28] : window.scrollTo(300, 400) - [29] : DIV - [30] : width: 2000px; height: 2000px; font: 10px Ahem; - [31] : Een heel grote div. - [32] : - ] -} -
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt index 585f5a9..b6ba13f 100644 --- a/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt
@@ -8,18 +8,18 @@ [FAIL] dequantizeLinear int8 4D constant tensor with block_size = [3, 2] promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'dequantizeLinear' on 'MLGraphBuilder': Unsupported rank 2 for argument zeroPoint (must be at most 1)." [FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." [FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int4 must be one of [int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_cpu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_cpu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_cpu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_cpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any_cpu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gather.https.any_cpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_cpu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_cpu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_cpu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_cpu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_cpu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_cpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any_cpu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/gatherND.https.any_cpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_cpu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_cpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any_cpu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/tile.https.any_cpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any.worker_cpu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any.worker_cpu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any_cpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any_cpu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-on-cpu/external/wpt/webnn/validation_tests/constant.https.any_cpu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_gpu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_gpu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_gpu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any.worker_gpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any_gpu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gather.https.any_gpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_gpu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_gpu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_gpu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherElements.https.any_gpu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_gpu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_gpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any_gpu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gatherND.https.any_gpu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_gpu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any.worker_gpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any_gpu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tile.https.any_gpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any.worker_gpu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any.worker_gpu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any_gpu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/validation_tests/constant.https.any_gpu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any.worker_npu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt index 4ddaa6f9..130b7cf 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/dequantizeLinear.https.any_npu-expected.txt
@@ -1,19 +1,5 @@ This is a testharness.js-based test. [FAIL] dequantizeLinear int8 0D tensor with float32 scalar scale promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type int8 must be one of [float32,float16,int32]." -[FAIL] dequantizeLinear uint4 1D tensor with even input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 1D tensor with odd input size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 4D constant tensor broadcasting zeroPoint - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear uint4 3D input with block_size = [1, 1, 2] - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with even size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] dequantizeLinear int4 1D tensor with odd size - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." -[FAIL] per-tensor dequantizeLinear for int4 4D constant - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type int4 must be one of [float32,float16,int32,int8,uint8]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any.worker_npu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any.worker_npu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any_npu-expected.txt index 3cf80d70..3e57c18 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gather.https.any_npu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gather float32 1D tensor and uint32 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gather float32 1D tensor and int64 0D scalar indices default options - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gather float32 2D tensor and int32 0D out-of-bound positive indices default options assert_true: assert_array_approx_equals_ulp: test gather float32 actual -66.05901336669922 should be close enough to expected 90.2870101928711 by the acceptable 0 ULP distance, but they have 2150659260 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_npu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any.worker_npu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any_npu-expected.txt index d2895fc..0e98da8 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherElements.https.any_npu-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. [FAIL] gatherElements float32 2D input and uint32 indices options.axis=1 - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherElements float32 3D input and int32 negative indices assert_true: assert_array_approx_equals_ulp: test gatherElements float32 actual -66.05901336669922 should be close enough to expected 89.0337142944336 by the acceptable 0 ULP distance, but they have 2150494988 ULP distance expected true got false [FAIL] gatherElements float32 1D input and int32 out-of-bounds indices
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_npu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any.worker_npu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any_npu-expected.txt index a4f6fb5..905cd01 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/gatherND.https.any_npu-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. [FAIL] gatherND float32 4D input and 1D uint32 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'indices' data type uint32 must be one of [int32]." [FAIL] gatherND float32 4D input and 1D int64 indices - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'indices' data type int64 must be one of [float32,float16,int32,uint32,int8,uint8,int4,uint4]." [FAIL] gatherND float32 2D input and 2D negative indices assert_true: assert_array_approx_equals_ulp: test gatherND float32 actual -66.05901336669922 should be close enough to expected 44.92119598388672 by the acceptable 0 ULP distance, but they have 2142212375 ULP distance expected true got false [FAIL] gatherND float32 1D input and 2D out-of-bounds indices
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any.worker_npu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any.worker_npu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any_npu-expected.txt index 97701a6..d5894b1 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/conformance_tests/tile.https.any_npu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. [FAIL] tile uint32 2D tensor - promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, constant 'input' data type uint32 must be one of [float32,float16,int32,int8,uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Unsupported data type, input 'input' data type uint32 must be one of [float32,float16,int32]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any.worker_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any.worker_npu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any.worker_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any.worker_npu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any_npu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any_npu-expected.txt index 4329157..d3114f5 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any_npu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-npu/external/wpt/webnn/validation_tests/constant.https.any_npu-expected.txt
@@ -1,9 +1,7 @@ This is a testharness.js-based test. -[FAIL] [constant] Test building a constant with uint32 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint32 for constant, must be one of [float32, float16, int32, int8, uint8]." [FAIL] [constant] Test building a constant with int64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type int64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." [FAIL] [constant] Test building a constant with uint64 data type - promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, int8, uint8]." + promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'constant' on 'MLGraphBuilder': Unsupported data type uint64 for constant, must be one of [float32, float16, int32, uint32, int8, uint8, int4, uint4]." Harness: the test ran to completion.
diff --git a/third_party/chromite b/third_party/chromite index ac866df..12ceb77 160000 --- a/third_party/chromite +++ b/third_party/chromite
@@ -1 +1 @@ -Subproject commit ac866df70cfddf7ff80b63533a30748532e5f8bf +Subproject commit 12ceb773ef2dd7811e99028fcae74b162abe78c3
diff --git a/third_party/crossbench b/third_party/crossbench index c93bea8..83b2874 160000 --- a/third_party/crossbench +++ b/third_party/crossbench
@@ -1 +1 @@ -Subproject commit c93bea889b459f2b52c7c50dd1b4256364eededf +Subproject commit 83b2874726e75c60c99970ed87e862ca05302b28
diff --git a/third_party/dawn b/third_party/dawn index 18f45d0..c77cb9b 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 18f45d0373057395c9875b455035ef19ca6a655c +Subproject commit c77cb9bbcd295604893576d3f3377d61ca916243
diff --git a/third_party/depot_tools b/third_party/depot_tools index e69b086..ee429f3 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit e69b086c0f3764fe1211435b297f793e02ecd13e +Subproject commit ee429f3694c51421c8b2f2af52049102ef43bca9
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index ee8f643..f9f582e 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit ee8f643d9a460e41a2e2d480f2e502c17c86fb00 +Subproject commit f9f582e701a85326159c113c22d3a3e4a5f20e1d
diff --git a/third_party/libc++/src b/third_party/libc++/src index d3d825f..e36be67 160000 --- a/third_party/libc++/src +++ b/third_party/libc++/src
@@ -1 +1 @@ -Subproject commit d3d825f7b3bb685545dcfa6c9d797631a49ade61 +Subproject commit e36be6784f33c592ecc89da2a829807920d374ef
diff --git a/third_party/llvm-libc/src b/third_party/llvm-libc/src index d499ef8..99782c3 160000 --- a/third_party/llvm-libc/src +++ b/third_party/llvm-libc/src
@@ -1 +1 @@ -Subproject commit d499ef8787d8b9183a3a715c9073b366344fba47 +Subproject commit 99782c3117bf68302f6d9080d70ac5bd86fa72f6
diff --git a/third_party/perfetto b/third_party/perfetto index 26425fc..dfcfdc9c 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit 26425fcdd18c91a10f59740765c53c5079cf61e3 +Subproject commit dfcfdc9c283446ef3ad6036398790c842d458bb0
diff --git a/third_party/webrtc b/third_party/webrtc index 4aaaa684..69dc7f7 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 4aaaa6848bc2521f0ab75a46c4bfeaf68b8b9ffb +Subproject commit 69dc7f7576d5d26252124dde2b762af4dd22d7db
diff --git a/tools/metrics/histograms/metadata/blink/enums.xml b/tools/metrics/histograms/metadata/blink/enums.xml index f124242..e274c7b 100644 --- a/tools/metrics/histograms/metadata/blink/enums.xml +++ b/tools/metrics/histograms/metadata/blink/enums.xml
@@ -5922,6 +5922,9 @@ label="PrivateNetworkAccessInsecureResourceNotKnownPrivate"/> <int value="5320" label="GeolocationGetCurrentPositionHighAccuracy"/> <int value="5321" label="GeolocationWatchPositionHighAccuracy"/> + <int value="5322" label="ColumnPseudoElement"/> + <int value="5323" label="ScrollButtonPseudoElement"/> + <int value="5324" label="ScrollMarkerPseudoElement"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom:WebFeature) --> @@ -7836,6 +7839,10 @@ <int value="289" label="MediaPlaybackQuality"/> <int value="290" label="Webgpu"/> <int value="291" label="Zstd"/> + <int value="292" label="ColumnPseudo"/> + <int value="293" label="Interactivity"/> + <int value="294" label="ScrollButtons"/> + <int value="295" label="ScrollMarkers"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom:WebDXFeature) -->
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index 1cb23ae..83b04b1 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -26,8 +26,6 @@ <variant name="ConnectionError" summary="Connection error"/> <variant name="Disabled" summary="Disabled"/> <variant name="Enrollment" summary="Enrollment"/> - <variant name="MachineInfoRetrievalError" - summary="Machine info retrieval error"/> <variant name="NoEnrollment" summary="No enrollment"/> <variant name="ServerError" summary="Server error"/> <variant name="StateKeysRetrievalError" summary="State keys retrieval error"/>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index 9fa9a709..3fd7e842 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -5900,7 +5900,7 @@ </histogram> <histogram name="Media.VideoCapture.CreateDeviceSuccessLatency" units="ms" - expires_after="2025-03-30"> + expires_after="2026-02-15"> <owner>herre@google.com</owner> <owner>video-cmi-apis@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 29938b0..71c3a6f6 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -2923,10 +2923,13 @@ <histogram name="Prerender.CanceledForInactivePageRestriction.DisallowActivationReason{PreloadingTriggerType}" - enum="InactiveFrameDisallowActivationReason" expires_after="2024-03-01"> + enum="InactiveFrameDisallowActivationReason" expires_after="2025-08-01"> <owner>lingqi@chromium.org</owner> <owner>chrome-prerendering@chromium.org</owner> <summary> + Warning: this histogram was expired from 2024-03-01 to 2025-02-20; data may + be missing. + Tracks the prerender cancellations caused by inactive RenderFrameHosts' restrictions, recording the reason passed to RenderFrameHost::IsInactiveAndDisallowActivation calls. @@ -3021,7 +3024,7 @@ <histogram name="Prerender.Experimental.CrossOriginRedirectionProtocolChange{PreloadingTriggerType}" enum="PrerenderCrossOriginRedirectionProtocolChange" - expires_after="2025-03-01"> + expires_after="2025-08-01"> <owner>lingqi@chromium.org</owner> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> @@ -3149,7 +3152,7 @@ <histogram name="Prerender.Experimental.PrerenderCrossOriginRedirectionMismatch{PreloadingTriggerType}" - enum="PrerenderCrossOriginRedirectionMismatch" expires_after="2025-03-01"> + enum="PrerenderCrossOriginRedirectionMismatch" expires_after="2025-08-01"> <owner>lingqi@chromium.org</owner> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index 745ee7c..aa15d4e 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -5541,7 +5541,7 @@ </histogram> <histogram - name="Net.SessionCreate.GoogleSearch.Preconnect.Quic.CompletionResult{JobType}" + name="Net.SessionCreate.GoogleSearch.Preconnect2.Quic.CompletionResult{JobType}" enum="NetErrorCodes" expires_after="2025-07-27"> <owner>suzukikeita@chromium.org</owner> <owner>blink-network-stack@google.com</owner> @@ -5559,8 +5559,8 @@ </histogram> <histogram - name="Net.SessionCreate.GoogleSearch.Preconnect.{ProtocolType}.IsSessionReused" - enum="Boolean" expires_after="2025-06-30"> + name="Net.SessionCreate.GoogleSearch.Preconnect2.{ProtocolType}.IsSessionReused" + enum="Boolean" expires_after="2025-07-27"> <owner>suzukikeita@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 1a8de0f1..f756090e 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -558,6 +558,21 @@ </summary> </histogram> +<histogram name="ServiceWorker.GetClients.ExtensionController.{type}" + units="clients" expires_after="2025-10-01"> + <owner>yyanagisawa@chromium.org</owner> + <owner>chrome-worker@google.com</owner> + <summary> + The number of clients controlled by the Chrome Extension. It has been + measured when `Clients.matchAll()` is called by the Extension ServiceWorker. + This is a metrics that is counted for {type}. + </summary> + <token key="type"> + <variant name="AllClients" summary="all clients"/> + <variant name="WindowClients" summary="window clients"/> + </token> +</histogram> + <histogram name="ServiceWorker.InstallEvent.All.FetchCount" units="fetches" expires_after="2023-10-01"> <owner>yyanagisawa@chromium.org</owner>
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc index da874b0a..823fdf2 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc
@@ -666,20 +666,6 @@ if (FAILED(hr)) return E_FAIL; - if (attribute_id == UIA_AnnotationTypesAttributeId && - current_value.Type() == VT_EMPTY) { - // This attribute UIA_AnnotationTypesAttributeId is different than others - // in the sense that its default value is null. When it gets queried for a - // text range that contains both a spelling error and other words without - // annotations, the returned value should solely be the spelling - // annotation, not the mixed attribute. - // - // Example: "The quik[spelling error] brown fox.". This text range - // contains only one annotation (quik) because the other segments would - // return VT_EMPTY. - continue; - } - if (attribute_value.Type() == VT_EMPTY) { attribute_value = std::move(current_value); } else if (attribute_value != current_value) {
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc index 2e67457..7c8329bb 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc
@@ -4514,18 +4514,15 @@ // |text_node| has a grammar error on "some text", a highlight for the // first word, a spelling error for the second word, a "spelling-error" // highlight for the fourth word, and a "grammar-error" highlight for the - // fifth word. So the range has both spelling and grammar error and also - // highlighted text. + // fifth word. So the range has mixed attributes. base::win::ScopedVariant annotation_types_variant; EXPECT_HRESULT_SUCCEEDED(text_range_provider->GetAttributeValue( UIA_AnnotationTypesAttributeId, annotation_types_variant.Receive())); - EXPECT_EQ(annotation_types_variant.type(), VT_ARRAY | VT_I4); - std::vector<int> expected_annotations = {AnnotationType_SpellingError, - AnnotationType_GrammarError, - AnnotationType_Highlighted}; - EXPECT_UIA_SAFEARRAY_EQ(V_ARRAY(annotation_types_variant.ptr()), - expected_annotations); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, + L"some text and some other text"); + EXPECT_UIA_TEXTATTRIBUTE_MIXED(text_range_provider, + UIA_AnnotationTypesAttributeId); } { @@ -4636,15 +4633,15 @@ { // |heading_text_node| has a a spelling error for one word, and no - // annotations for the remaining text, so the range has spelling error. + // annotations for the remaining text, so the entire range has mixed + // annotations. base::win::ScopedVariant annotation_types_variant; EXPECT_HRESULT_SUCCEEDED(heading_text_range_provider->GetAttributeValue( UIA_AnnotationTypesAttributeId, annotation_types_variant.Receive())); - EXPECT_EQ(annotation_types_variant.type(), VT_ARRAY | VT_I4); - std::vector<int> expected_annotations = {AnnotationType_SpellingError}; - EXPECT_UIA_SAFEARRAY_EQ(V_ARRAY(annotation_types_variant.ptr()), - expected_annotations); + EXPECT_UIA_TEXTRANGE_EQ(heading_text_range_provider, L"more text"); + EXPECT_UIA_TEXTATTRIBUTE_MIXED(heading_text_range_provider, + UIA_AnnotationTypesAttributeId); } { @@ -4675,9 +4672,9 @@ // |heading_text_node| = "more text" (without quotes) // In this, 'text' is annotated with a spelling error. // - // We want to test for spelling errors in 'text' selection combined with - // character(s) from adjacent anchor(s) which do not have any such - // annotations. + // We want to test for mixed annotation in 'text' selection for spelling + // error text combined with character(s) from adjacent anchor(s) which do + // not have any such annotations. // // start: TextPosition, anchor_id=4, text_offset=5, // annotated_text=more <t>ext marked text @@ -4685,21 +4682,17 @@ // annotated_text=more text m<a>rked text AXPlatformNodeWin* owner = static_cast<AXPlatformNodeWin*>( AXPlatformNodeFromNode(heading_text_node)); - ComPtr<AXPlatformNodeTextRangeProviderWin> range_with_annotations; + ComPtr<AXPlatformNodeTextRangeProviderWin> mixed_text_range_provider; CreateTextRangeProviderWin( - range_with_annotations, owner, + mixed_text_range_provider, owner, /*start_anchor=*/heading_text_node, /*start_offset=*/5, /*start_affinity*/ ax::mojom::TextAffinity::kDownstream, - /*end_anchor=*/mark_text_node, /*end_offset=*/1, + /*end_anchor=*/mark_text_node, /*end_offset=*/4, /*end_affinity*/ ax::mojom::TextAffinity::kDownstream); - base::win::ScopedVariant annotation_types_variant; - EXPECT_HRESULT_SUCCEEDED(range_with_annotations->GetAttributeValue( - UIA_AnnotationTypesAttributeId, annotation_types_variant.Receive())); - - std::vector<int> expected_annotations = {AnnotationType_SpellingError}; - EXPECT_UIA_SAFEARRAY_EQ(V_ARRAY(annotation_types_variant.ptr()), - expected_annotations); + EXPECT_UIA_TEXTRANGE_EQ(mixed_text_range_provider, L"textmark"); + EXPECT_UIA_TEXTATTRIBUTE_MIXED(mixed_text_range_provider, + UIA_AnnotationTypesAttributeId); } {
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc index e337ef8..4300ffa 100644 --- a/ui/accessibility/platform/ax_platform_node_win.cc +++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -6347,7 +6347,8 @@ sort_ranges_by_start_offset); // Validate that the desired range has instance of MarkerType. - bool has_marker_in_desired_range = false; + int desired_start = start_offset.value_or(0); + int desired_end = end_offset.value_or(GetTextContentLengthUTF16()); for (const std::pair<int, int>& range : relevant_ranges) { if (end_offset && range.first >= end_offset.value()) { break; @@ -6356,15 +6357,16 @@ continue; } - has_marker_in_desired_range = true; - break; + if (range.first <= desired_start && range.second >= desired_end) { + // Marker covers the desired range perfectly. + return MarkerTypeRangeResult::kMatch; + } else { + // Marker only partially covers the desired range. + return MarkerTypeRangeResult::kMixed; + } } - if (!has_marker_in_desired_range) { - return MarkerTypeRangeResult::kNone; - } - - return MarkerTypeRangeResult::kMatch; + return MarkerTypeRangeResult::kNone; } // IRawElementProviderSimple support methods.
diff --git a/ui/native_theme/native_theme_features.cc b/ui/native_theme/native_theme_features.cc index 5aaea04..30f676a 100644 --- a/ui/native_theme/native_theme_features.cc +++ b/ui/native_theme/native_theme_features.cc
@@ -51,7 +51,7 @@ // development and disabled by default. BASE_FEATURE(kFluentScrollbar, "FluentScrollbar", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // Makes all native scrollbars behave as overlay scrollbars styled to fit the // Fluent design language.
diff --git a/ui/webui/resources/js/ios/web_ui.js b/ui/webui/resources/js/ios/web_ui.js index 20c2a52..86b5a3a 100644 --- a/ui/webui/resources/js/ios/web_ui.js +++ b/ui/webui/resources/js/ios/web_ui.js
@@ -12,8 +12,16 @@ * @param {Array=} args optional. */ window['chrome']['send'] = function(message, args) { - __gCrWeb.common.sendWebKitMessage('WebUIMessage', { - 'message': message, - 'arguments': args || [], - }); + try { + // A web page can override `window.webkit` with any value. Deleting the + // object ensures that original and working implementation of + // window.webkit is restored. + const oldWebkit = window.webkit; + delete window['webkit']; + window.webkit.messageHandlers['WebUIMessage'].postMessage( + {'message': message, 'arguments': args || []}); + window.webkit = oldWebkit; + } catch (err) { + // TODO(crbug.com/40269960): Report this fatal error + } };
diff --git a/v8 b/v8 index d0992c4..74791e7 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit d0992c4954f47858b3996d9cd34e0f948be36a1e +Subproject commit 74791e7b7c09202a9104057e21f96f871d697c51