diff --git a/DEPS b/DEPS index 744b71d..1289889 100644 --- a/DEPS +++ b/DEPS
@@ -359,7 +359,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': '6972331010a288991a1544be4df7892e3bc8801a', + 'devtools_frontend_revision': '8a1afd340d4cefeff093902107269a2483ed5a98', # 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. @@ -395,7 +395,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': 'c4f0232de2dc5901f6c13d7693964387a22b507e', + 'dawn_revision': '0e414c57045668bf6343215a3fc7db6a5a76680b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -1554,7 +1554,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'd86457ab539f83842f0e6c891c459bd764267b8d', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'dd682e48aa77446c4bec51af0f08421d1a2bac47', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1724,7 +1724,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '6c0f3bab40dead9e205a95ef64ad8f912c694a1d', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'c931f708967382050f111bfdd73ff689f7f3b190', + Var('webrtc_git') + '/src.git' + '@' + '1c5808145e8b151800b0320b8a7316a09b706488', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1797,7 +1797,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f47334ee66859e1916d798d190153381efae888d', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@28b82e7e8f39aa2ea2202676cc4c20d62bb23766', 'condition': 'checkout_src_internal', }, @@ -1849,7 +1849,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'T7kIh1oWOuKNns_uhf8PbXJ34OM3cOUXvKzTCxAIA6EC', + 'version': 'C_W-d-5MCa4aXPlaRI94F399ZFFKha1JNPSQOh3p-IAC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/ash/components/arc/net/always_on_vpn_manager.cc b/ash/components/arc/net/always_on_vpn_manager.cc index a7782e3..dfd196a 100644 --- a/ash/components/arc/net/always_on_vpn_manager.cc +++ b/ash/components/arc/net/always_on_vpn_manager.cc
@@ -10,7 +10,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/values.h" -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/network/network_handler.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/ash/components/arc/net/arc_net_host_impl.cc b/ash/components/arc/net/arc_net_host_impl.cc index 1b9bce841..43536be 100644 --- a/ash/components/arc/net/arc_net_host_impl.cc +++ b/ash/components/arc/net/arc_net_host_impl.cc
@@ -25,11 +25,11 @@ #include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h"
diff --git a/ash/components/arc/net/arc_net_host_impl.h b/ash/components/arc/net/arc_net_host_impl.h index 241cd4c..216981a 100644 --- a/ash/components/arc/net/arc_net_host_impl.h +++ b/ash/components/arc/net/arc_net_host_impl.h
@@ -20,7 +20,7 @@ #include "base/threading/thread_checker.h" #include "base/values.h" #include "chromeos/ash/components/dbus/patchpanel/patchpanel_service.pb.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler_observer.h" #include "components/keyed_service/core/keyed_service.h"
diff --git a/ash/components/tether/asynchronous_shutdown_object_container_impl.h b/ash/components/tether/asynchronous_shutdown_object_container_impl.h index f911e34..fe5875c 100644 --- a/ash/components/tether/asynchronous_shutdown_object_container_impl.h +++ b/ash/components/tether/asynchronous_shutdown_object_container_impl.h
@@ -16,7 +16,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/ash/components/network/managed_network_configuration_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state_handler.h"
diff --git a/ash/components/tether/fake_tether_connector.h b/ash/components/tether/fake_tether_connector.h index 93a00fa..705f7e34 100644 --- a/ash/components/tether/fake_tether_connector.h +++ b/ash/components/tether/fake_tether_connector.h
@@ -7,7 +7,7 @@ #include "ash/components/tether/tether_connector.h" #include "base/callback_forward.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/fake_tether_disconnector.h b/ash/components/tether/fake_tether_disconnector.h index 4483401..338114a 100644 --- a/ash/components/tether/fake_tether_disconnector.h +++ b/ash/components/tether/fake_tether_disconnector.h
@@ -8,7 +8,7 @@ #include "ash/components/tether/tether_disconnector.h" #include "ash/components/tether/tether_session_completion_logger.h" #include "base/callback_forward.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/network_connection_handler_tether_delegate.h b/ash/components/tether/network_connection_handler_tether_delegate.h index 136d81a..405a69ed 100644 --- a/ash/components/tether/network_connection_handler_tether_delegate.h +++ b/ash/components/tether/network_connection_handler_tether_delegate.h
@@ -8,7 +8,7 @@ #include <unordered_map> #include "base/memory/weak_ptr.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/network_connection_handler_tether_delegate_unittest.cc b/ash/components/tether/network_connection_handler_tether_delegate_unittest.cc index d5aa15b..6e265f80 100644 --- a/ash/components/tether/network_connection_handler_tether_delegate_unittest.cc +++ b/ash/components/tether/network_connection_handler_tether_delegate_unittest.cc
@@ -13,7 +13,7 @@ #include "ash/components/tether/tether_session_completion_logger.h" #include "base/bind.h" #include "base/memory/ptr_util.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "testing/gtest/include/gtest/gtest.h" namespace ash {
diff --git a/ash/components/tether/synchronous_shutdown_object_container_impl.h b/ash/components/tether/synchronous_shutdown_object_container_impl.h index 7c28d96..6e5faa7 100644 --- a/ash/components/tether/synchronous_shutdown_object_container_impl.h +++ b/ash/components/tether/synchronous_shutdown_object_container_impl.h
@@ -11,11 +11,11 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "ash/services/secure_channel/public/cpp/client/secure_channel_client.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" class PrefService;
diff --git a/ash/components/tether/tether_component_impl.h b/ash/components/tether/tether_component_impl.h index a0a42ce..56e2f86 100644 --- a/ash/components/tether/tether_component_impl.h +++ b/ash/components/tether/tether_component_impl.h
@@ -15,9 +15,9 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/ash/components/network/managed_network_configuration_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state_handler.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/ash/components/tether/tether_connector.h b/ash/components/tether/tether_connector.h index 1bae209..d67a8a48 100644 --- a/ash/components/tether/tether_connector.h +++ b/ash/components/tether/tether_connector.h
@@ -6,7 +6,7 @@ #define ASH_COMPONENTS_TETHER_TETHER_CONNECTOR_H_ #include "base/callback_forward.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/tether_connector_impl.h b/ash/components/tether/tether_connector_impl.h index 4c5bd8c..54559f1f 100644 --- a/ash/components/tether/tether_connector_impl.h +++ b/ash/components/tether/tether_connector_impl.h
@@ -12,7 +12,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "base/memory/weak_ptr.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state_handler.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/ash/components/tether/tether_connector_impl_unittest.cc b/ash/components/tether/tether_connector_impl_unittest.cc index 28f1833..814fceae 100644 --- a/ash/components/tether/tether_connector_impl_unittest.cc +++ b/ash/components/tether/tether_connector_impl_unittest.cc
@@ -26,8 +26,8 @@ #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/ash/components/tether/tether_disconnector.h b/ash/components/tether/tether_disconnector.h index dbd9c72..8d55b72 100644 --- a/ash/components/tether/tether_disconnector.h +++ b/ash/components/tether/tether_disconnector.h
@@ -11,7 +11,7 @@ #include "ash/components/tether/tether_session_completion_logger.h" #include "base/callback_forward.h" #include "base/memory/weak_ptr.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/tether_disconnector_impl.cc b/ash/components/tether/tether_disconnector_impl.cc index c48a311..5b5ab18 100644 --- a/ash/components/tether/tether_disconnector_impl.cc +++ b/ash/components/tether/tether_disconnector_impl.cc
@@ -13,7 +13,7 @@ #include "ash/components/tether/wifi_hotspot_disconnector.h" #include "base/metrics/histogram_macros.h" #include "base/values.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/components/tether/wifi_hotspot_connector.cc b/ash/components/tether/wifi_hotspot_connector.cc index 176e95a6..9adbd47 100644 --- a/ash/components/tether/wifi_hotspot_connector.cc +++ b/ash/components/tether/wifi_hotspot_connector.cc
@@ -13,7 +13,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/time/default_clock.h" #include "chromeos/ash/components/network/device_state.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/components/tether/wifi_hotspot_connector.h b/ash/components/tether/wifi_hotspot_connector.h index 55180b3..8755663 100644 --- a/ash/components/tether/wifi_hotspot_connector.h +++ b/ash/components/tether/wifi_hotspot_connector.h
@@ -14,7 +14,7 @@ #include "base/timer/timer.h" #include "base/values.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state.h" // TODO(https://crbug.com/1164001): move to forward declaration
diff --git a/ash/components/tether/wifi_hotspot_connector_unittest.cc b/ash/components/tether/wifi_hotspot_connector_unittest.cc index 7e633bde..ad6bd88 100644 --- a/ash/components/tether/wifi_hotspot_connector_unittest.cc +++ b/ash/components/tether/wifi_hotspot_connector_unittest.cc
@@ -17,8 +17,8 @@ #include "base/test/test_simple_task_runner.h" #include "base/timer/mock_timer.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/ash/components/network/network_state_test_helper.h" -#include "chromeos/network/network_connect.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/shill_property_util.h"
diff --git a/ash/components/tether/wifi_hotspot_disconnector.h b/ash/components/tether/wifi_hotspot_disconnector.h index 2198ec7..6ab4cfb 100644 --- a/ash/components/tether/wifi_hotspot_disconnector.h +++ b/ash/components/tether/wifi_hotspot_disconnector.h
@@ -6,7 +6,7 @@ #define ASH_COMPONENTS_TETHER_WIFI_HOTSPOT_DISCONNECTOR_H_ #include "base/callback.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" namespace ash {
diff --git a/ash/components/tether/wifi_hotspot_disconnector_impl.cc b/ash/components/tether/wifi_hotspot_disconnector_impl.cc index 7a29e38..2c386c76 100644 --- a/ash/components/tether/wifi_hotspot_disconnector_impl.cc +++ b/ash/components/tether/wifi_hotspot_disconnector_impl.cc
@@ -10,7 +10,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/ash/components/tether/wifi_hotspot_disconnector_impl.h b/ash/components/tether/wifi_hotspot_disconnector_impl.h index 82f2f00..fac897c 100644 --- a/ash/components/tether/wifi_hotspot_disconnector_impl.h +++ b/ash/components/tether/wifi_hotspot_disconnector_impl.h
@@ -8,7 +8,7 @@ #include "ash/components/tether/wifi_hotspot_disconnector.h" #include "base/memory/weak_ptr.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/network/network_state_handler.h"
diff --git a/ash/components/tether/wifi_hotspot_disconnector_impl_unittest.cc b/ash/components/tether/wifi_hotspot_disconnector_impl_unittest.cc index c2b3a438..8c090f7 100644 --- a/ash/components/tether/wifi_hotspot_disconnector_impl_unittest.cc +++ b/ash/components/tether/wifi_hotspot_disconnector_impl_unittest.cc
@@ -11,8 +11,8 @@ #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "components/sync_preferences/testing_pref_service_syncable.h"
diff --git a/ash/services/cellular_setup/esim_manager.h b/ash/services/cellular_setup/esim_manager.h index f0dbbaf..b996096 100644 --- a/ash/services/cellular_setup/esim_manager.h +++ b/ash/services/cellular_setup/esim_manager.h
@@ -20,7 +20,7 @@ #include "chromeos/dbus/hermes/hermes_manager_client.h" #include "chromeos/dbus/hermes/hermes_profile_client.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chromeos/network/network_state_handler.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/ash/services/cellular_setup/esim_profile.cc b/ash/services/cellular_setup/esim_profile.cc index 945030a..a2de3db 100644 --- a/ash/services/cellular_setup/esim_profile.cc +++ b/ash/services/cellular_setup/esim_profile.cc
@@ -18,10 +18,10 @@ #include "chromeos/ash/components/network/cellular_esim_uninstall_handler.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/hermes_metrics_util.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" #include "chromeos/dbus/hermes/hermes_profile_client.h" #include "chromeos/dbus/hermes/hermes_response_status.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/services/cellular_setup/esim_test_base.cc b/ash/services/cellular_setup/esim_test_base.cc index 25c1f61..3e0234fd 100644 --- a/ash/services/cellular_setup/esim_test_base.cc +++ b/ash/services/cellular_setup/esim_test_base.cc
@@ -14,13 +14,13 @@ #include "chromeos/ash/components/network/cellular_esim_uninstall_handler.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/fake_network_connection_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" #include "chromeos/dbus/hermes/hermes_manager_client.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/services/cellular_setup/esim_test_base.h b/ash/services/cellular_setup/esim_test_base.h index 9a11dcf..53a69121 100644 --- a/ash/services/cellular_setup/esim_test_base.h +++ b/ash/services/cellular_setup/esim_test_base.h
@@ -21,7 +21,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration. #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chromeos/network/network_device_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration.
diff --git a/ash/services/cellular_setup/euicc.cc b/ash/services/cellular_setup/euicc.cc index d7609162..42c4717 100644 --- a/ash/services/cellular_setup/euicc.cc +++ b/ash/services/cellular_setup/euicc.cc
@@ -20,7 +20,7 @@ #include "chromeos/ash/components/network/cellular_esim_profile.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/hermes_metrics_util.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state_handler.h" #include "components/device_event_log/device_event_log.h"
diff --git a/ash/services/cellular_setup/ota_activator_impl.cc b/ash/services/cellular_setup/ota_activator_impl.cc index a0c550f..9cf6c5e 100644 --- a/ash/services/cellular_setup/ota_activator_impl.cc +++ b/ash/services/cellular_setup/ota_activator_impl.cc
@@ -13,9 +13,9 @@ #include "base/metrics/histogram_functions.h" #include "chromeos/ash/components/network/cellular_utils.h" #include "chromeos/ash/components/network/device_state.h" +#include "chromeos/ash/components/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/shill/shill_device_client.h" -#include "chromeos/network/network_activation_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/services/cellular_setup/ota_activator_impl.h b/ash/services/cellular_setup/ota_activator_impl.h index c014afd5..729ca24 100644 --- a/ash/services/cellular_setup/ota_activator_impl.h +++ b/ash/services/cellular_setup/ota_activator_impl.h
@@ -16,9 +16,9 @@ #include "base/time/time.h" #include "base/timer/timer.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_activation_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chromeos/network/network_state.h" // TODO(https://crbug.com/1164001): move to forward declaration.
diff --git a/ash/services/cellular_setup/ota_activator_impl_unittest.cc b/ash/services/cellular_setup/ota_activator_impl_unittest.cc index 2de61528..d724d41a 100644 --- a/ash/services/cellular_setup/ota_activator_impl_unittest.cc +++ b/ash/services/cellular_setup/ota_activator_impl_unittest.cc
@@ -14,8 +14,8 @@ #include "base/test/test_simple_task_runner.h" #include "chromeos/ash/components/network/fake_network_activation_handler.h" #include "chromeos/ash/components/network/fake_network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state_handler.h" #include "mojo/public/cpp/bindings/remote.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/strings/ash_strings_km.xtb b/ash/strings/ash_strings_km.xtb index 6532901..2f115a6 100644 --- a/ash/strings/ash_strings_km.xtb +++ b/ash/strings/ash_strings_km.xtb
@@ -152,6 +152,7 @@ <translation id="1771761307086386028">រំកិលទៅស្តាំ</translation> <translation id="1774796056689732716">ប្រតិទិន, <ph name="CURRENT_MONTH_YEAR" />, បច្ចុប្បន្នបានជ្រើសរើសថ្ងៃទី <ph name="DATE" />។</translation> <translation id="1787955149152357925">បិទ</translation> +<translation id="1797271123677381264">ភ្លេចពាក្យសម្ងាត់</translation> <translation id="181103072419391116">កម្លាំងរលកសញ្ញា <ph name="SIGNAL_STRENGTH" />, គ្រប់គ្រងដោយអ្នកគ្រប់គ្រងរបស់អ្នក</translation> <translation id="1812997170047690955">តើមានអ្វីនៅលើអេក្រង់របស់ខ្ញុំ?</translation> <translation id="1823873187264960516">អ៊ីសឺរណិត៖ <ph name="ADDRESS" /></translation> @@ -609,6 +610,7 @@ <translation id="4479639480957787382">ខ្សែអ៊ីនធឺណិត</translation> <translation id="4481530544597605423">ឧបករណ៍ដែលឈប់ផ្គូផ្គង</translation> <translation id="4505050298327493054">តុសកម្ម។</translation> +<translation id="450584155212756404">បណ្តាញអ្នកអភិវឌ្ឍន៍</translation> <translation id="4513946894732546136">មតិ</translation> <translation id="4518404433291145981">ដើម្បីដោះសោ Chromebook របស់អ្នក សូមដោះសោទូរសព្ទរបស់អ្នកជាមុនសិន</translation> <translation id="4527045527269911712">ឧបករណ៍ប៊្លូធូស "<ph name="DEVICE_NAME" />" ចង់សុំការអនុញ្ញាតដើម្បីភ្ជាប់។</translation> @@ -876,6 +878,7 @@ <translation id="6062360702481658777">អ្នកនឹងចាកចេញដោយស្វ័យប្រវត្តិក្នុង <ph name="LOGOUT_TIME_LEFT" />។</translation> <translation id="6064463340679478396">ប្រើឯកសារនេះរួចហើយ</translation> <translation id="6073451960410192870">បញ្ឈប់ការថត</translation> +<translation id="6074087755403037157">បណ្ដាញបេតា</translation> <translation id="6099678161144790572">បានកែកាលពីខែមុន</translation> <translation id="6103838137565245112">ប្រព័ន្ធ</translation> <translation id="6114505516289286752">បានទាញយកឯកសារនៃការនិយាយជាភាសា<ph name="LANGUAGE" /></translation> @@ -1226,6 +1229,7 @@ <translation id="8200772114523450471">បន្ត</translation> <translation id="8203795194971602413">ចុចកណ្ដុរខាងស្ដាំ</translation> <translation id="8209010265547628927">កំណត់ឡើងវិញ</translation> +<translation id="8214996719228530800">បណ្តាញ Canary</translation> <translation id="8219451629189078428">Chromebook របស់អ្នកត្រូវបន្តបើក និងភ្ជាប់ទៅថាមពលនៅអំឡុងពេលនេះ។ ត្រូវប្រាកដថា ខ្សែសាក ឬឆ្នាំងសាកត្រូវបានដោតត្រឹមត្រូវ ទាំងនៅលើ Chromebook របស់អ្នក និងព្រីភ្លើង។ សូមកុំបិទ Chromebook របស់អ្នក។</translation> <translation id="8236042855478648955">ដល់ពេលសម្រាកហើយ</translation> <translation id="8247060538831475781"><ph name="CONNECTION_STATUS" />, កម្លាំងរលកសញ្ញា <ph name="SIGNAL_STRENGTH" />, ថ្មទូរសព្ទ <ph name="BATTERY_STATUS" /></translation>
diff --git a/ash/strings/ash_strings_ky.xtb b/ash/strings/ash_strings_ky.xtb index 8098749..d2cc24d 100644 --- a/ash/strings/ash_strings_ky.xtb +++ b/ash/strings/ash_strings_ky.xtb
@@ -713,7 +713,7 @@ <translation id="5117590920725113268">Кийинки айды көрсөтүү</translation> <translation id="5136175204352732067">Башка баскычтоп туташтырылды</translation> <translation id="5147567197700016471">Кулпусу ачык</translation> -<translation id="5150070631291639005">Купуялык жөндөөлөрү</translation> +<translation id="5150070631291639005">Купуялык параметрлери</translation> <translation id="5155897006997040331">Окуу ылдамдыгы</translation> <translation id="5166007464919321363">Иш тактаны үлгү катары сактоо</translation> <translation id="5168181903108465623">Тышкы экранга чыгаруу түзмөктөрү жеткиликтүү</translation>
diff --git a/ash/strings/ash_strings_uz.xtb b/ash/strings/ash_strings_uz.xtb index 718970e..269bdcf 100644 --- a/ash/strings/ash_strings_uz.xtb +++ b/ash/strings/ash_strings_uz.xtb
@@ -152,6 +152,7 @@ <translation id="1771761307086386028">Oʻngga aylantirish</translation> <translation id="1774796056689732716">Taqvim, <ph name="CURRENT_MONTH_YEAR" />, hozir <ph name="DATE" /> tanlangan.</translation> <translation id="1787955149152357925">Yoqilmagan</translation> +<translation id="1797271123677381264">Parolni unutdim</translation> <translation id="181103072419391116">Signal darajasi: <ph name="SIGNAL_STRENGTH" />, Administrator boshqaruvida</translation> <translation id="1812997170047690955">Ekranda nimalar bor?</translation> <translation id="1823873187264960516">Ethernet: <ph name="ADDRESS" /></translation> @@ -609,6 +610,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4481530544597605423">Uzilgan qurilmalar</translation> <translation id="4505050298327493054">Faol ish stoli.</translation> +<translation id="450584155212756404">Dasturchilar kanali</translation> <translation id="4513946894732546136">Fikr-mulohaza</translation> <translation id="4518404433291145981">Chromebook qulfini ochish uchun telefon qulfini yeching</translation> <translation id="4527045527269911712">“<ph name="DEVICE_NAME" />” qurilmasi Bluetooth orqali bog‘lanishga ruxsat so‘ramoqda.</translation> @@ -876,6 +878,7 @@ <translation id="6062360702481658777"><ph name="LOGOUT_TIME_LEFT" />dan keyin tizimdan avtomatik ravishda chiqiladi.</translation> <translation id="6064463340679478396">Bu fayldan foydalanmayman</translation> <translation id="6073451960410192870">Yozuvni toʻxtatish</translation> +<translation id="6074087755403037157">Beta kanal</translation> <translation id="6099678161144790572">Oxirgi oyda tahrirlangan</translation> <translation id="6103838137565245112">tizim</translation> <translation id="6114505516289286752"><ph name="LANGUAGE" /> nutq fayllari yuklab olindi</translation> @@ -1226,6 +1229,7 @@ <translation id="8200772114523450471">Davom ettirish</translation> <translation id="8203795194971602413">Oʻng klik</translation> <translation id="8209010265547628927">Asliga qaytarish</translation> +<translation id="8214996719228530800">Canary kanali</translation> <translation id="8219451629189078428">Bu vaqt orasida Chromebook yoniq va quvvat manbasiga ulangan boʻlishi kerak. Quvvatlagich va kabel adapterlari Chromebook va rozetkaga ulanganini tekshiring. Chromebook qurilmasini oʻchirmang.</translation> <translation id="8236042855478648955">Tanaffus qilish vaqti keldi</translation> <translation id="8247060538831475781">Ulanish: <ph name="CONNECTION_STATUS" />, Signal darajasi: <ph name="SIGNAL_STRENGTH" />, Telefon quvvati: <ph name="BATTERY_STATUS" /></translation>
diff --git a/ash/strings/ash_strings_zh-HK.xtb b/ash/strings/ash_strings_zh-HK.xtb index 437125e..9a9953c 100644 --- a/ash/strings/ash_strings_zh-HK.xtb +++ b/ash/strings/ash_strings_zh-HK.xtb
@@ -612,7 +612,7 @@ <translation id="4513946894732546136">意見反映</translation> <translation id="4518404433291145981">如要解鎖 Chromebook,請先解鎖手機</translation> <translation id="4527045527269911712">藍牙裝置「<ph name="DEVICE_NAME" />」要求配對權限。</translation> -<translation id="4533343294786968049">延長電池續航力。電池電量將在<ph name="FULLY_CHARGE_TIME" /> 充飽。</translation> +<translation id="4533343294786968049">正在延長電池壽命。電池將會在<ph name="FULLY_CHARGE_TIME" /> 時完全充滿。</translation> <translation id="453661520163887813">還有 <ph name="TIME" />便完成充電</translation> <translation id="4538824937723742295">擷取全螢幕截圖</translation> <translation id="4544483149666270818">選取要錄影的視窗</translation>
diff --git a/ash/system/network/auto_connect_notifier.cc b/ash/system/network/auto_connect_notifier.cc index 5d2961b..2b4ca90d 100644 --- a/ash/system/network/auto_connect_notifier.cc +++ b/ash/system/network/auto_connect_notifier.cc
@@ -14,7 +14,7 @@ #include "base/logging.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/system/network/auto_connect_notifier.h b/ash/system/network/auto_connect_notifier.h index 03d6edb..756b639 100644 --- a/ash/system/network/auto_connect_notifier.h +++ b/ash/system/network/auto_connect_notifier.h
@@ -10,7 +10,7 @@ #include "ash/ash_export.h" #include "chromeos/ash/components/network/auto_connect_handler.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_state_handler_observer.h" namespace base {
diff --git a/ash/system/network/auto_connect_notifier_unittest.cc b/ash/system/network/auto_connect_notifier_unittest.cc index ceec050..1ea6737b 100644 --- a/ash/system/network/auto_connect_notifier_unittest.cc +++ b/ash/system/network/auto_connect_notifier_unittest.cc
@@ -16,9 +16,9 @@ #include "base/run_loop.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/network/auto_connect_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/system_token_cert_db_storage.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
diff --git a/ash/system/network/cellular_setup_notifier_unittest.cc b/ash/system/network/cellular_setup_notifier_unittest.cc index f667792..efb115e 100644 --- a/ash/system/network/cellular_setup_notifier_unittest.cc +++ b/ash/system/network/cellular_setup_notifier_unittest.cc
@@ -12,9 +12,9 @@ #include "base/bind.h" #include "base/run_loop.h" #include "base/timer/mock_timer.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/shill/shill_clients.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/system_token_cert_db_storage.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
diff --git a/ash/system/network/network_detailed_view_controller.cc b/ash/system/network/network_detailed_view_controller.cc index b19d9aa8..0caeff45 100644 --- a/ash/system/network/network_detailed_view_controller.cc +++ b/ash/system/network/network_detailed_view_controller.cc
@@ -16,7 +16,7 @@ #include "ash/system/network/tray_network_state_model.h" #include "ash/system/tray/detailed_view_delegate.h" #include "base/metrics/user_metrics.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/ash/system/network/network_detailed_view_controller_unittest.cc b/ash/system/network/network_detailed_view_controller_unittest.cc index 364543d..2dc00f1 100644 --- a/ash/system/network/network_detailed_view_controller_unittest.cc +++ b/ash/system/network/network_detailed_view_controller_unittest.cc
@@ -13,7 +13,7 @@ #include "ash/test/ash_test_helper.h" #include "base/test/metrics/user_action_tester.h" #include "base/test/scoped_feature_list.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/services/bluetooth_config/fake_adapter_state_controller.h"
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc index dbce20d7..dff0366 100644 --- a/ash/system/network/network_state_list_detailed_view.cc +++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -20,7 +20,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "net/base/ip_address.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/ash/system/network/vpn_list_view.cc b/ash/system/network/vpn_list_view.cc index 02dc280..e86232f 100644 --- a/ash/system/network/vpn_list_view.cc +++ b/ash/system/network/vpn_list_view.cc
@@ -30,7 +30,7 @@ #include "base/bind.h" #include "base/metrics/user_metrics.h" #include "base/strings/utf_string_conversions.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "components/onc/onc_constants.h"
diff --git a/ash/webui/camera_app_ui/resources/strings/camera_strings_zh-HK.xtb b/ash/webui/camera_app_ui/resources/strings/camera_strings_zh-HK.xtb index 32f1a827..4c872e6 100644 --- a/ash/webui/camera_app_ui/resources/strings/camera_strings_zh-HK.xtb +++ b/ash/webui/camera_app_ui/resources/strings/camera_strings_zh-HK.xtb
@@ -72,7 +72,7 @@ <translation id="3838931309141338733">掃描條碼</translation> <translation id="3892148308691398805">複製文字</translation> <translation id="4061162772429051350"><ph name="MAGAPIXELS_AMOUNT" /> 百萬像素</translation> -<translation id="4096701159033358951">正在下載文件掃描功能</translation> +<translation id="4096701159033358951">正在下載文件掃瞄功能</translation> <translation id="4118525110028899586">暫停錄影</translation> <translation id="4121305183798804752">偵測到文件</translation> <translation id="414641094616694804">此相機無法變更解像度</translation>
diff --git a/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc b/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc index 59de623..431123d 100644 --- a/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc +++ b/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc
@@ -13,11 +13,11 @@ #include "base/test/task_environment.h" #include "base/values.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/dbus/shill/shill_ipconfig_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/ash/webui/shimless_rma/DEPS b/ash/webui/shimless_rma/DEPS index 34d10467..5db3523 100644 --- a/ash/webui/shimless_rma/DEPS +++ b/ash/webui/shimless_rma/DEPS
@@ -2,7 +2,7 @@ "+chromeos/dbus", "+chromeos/dbus/power", "+chromeos/ash/components/dbus/rmad", - "+chromeos/dbus/update_engine", + "+chromeos/ash/components/dbus/update_engine", "+chromeos/dbus/util", "+chromeos/login/login_state", "+chromeos/services/network_config",
diff --git a/ash/webui/shimless_rma/backend/BUILD.gn b/ash/webui/shimless_rma/backend/BUILD.gn index 066fe666..c7a703ec 100644 --- a/ash/webui/shimless_rma/backend/BUILD.gn +++ b/ash/webui/shimless_rma/backend/BUILD.gn
@@ -20,10 +20,10 @@ "//ash/webui/shimless_rma/mojom", "//chromeos/ash/components/dbus/rmad", "//chromeos/ash/components/dbus/rmad:rmad_proto", + "//chromeos/ash/components/dbus/update_engine", + "//chromeos/ash/components/dbus/update_engine:proto", "//chromeos/dbus", "//chromeos/dbus/power", - "//chromeos/dbus/update_engine", - "//chromeos/dbus/update_engine:proto", "//chromeos/dbus/util", "//chromeos/network:network", "//chromeos/services/network_config:in_process_instance", @@ -48,9 +48,9 @@ "//base/test:test_support", "//chromeos/ash/components/dbus/rmad", "//chromeos/ash/components/dbus/rmad:rmad_proto", + "//chromeos/ash/components/dbus/update_engine:update_engine", "//chromeos/ash/components/network:test_support", "//chromeos/dbus:test_support", - "//chromeos/dbus/update_engine:update_engine", "//chromeos/login/login_state:login_state", "//chromeos/network:network", "//chromeos/services/network_config/public/cpp:test_support",
diff --git a/ash/webui/shimless_rma/backend/shimless_rma_service.h b/ash/webui/shimless_rma/backend/shimless_rma_service.h index 01ca418..dddf80e5 100644 --- a/ash/webui/shimless_rma/backend/shimless_rma_service.h +++ b/ash/webui/shimless_rma/backend/shimless_rma_service.h
@@ -14,7 +14,7 @@ #include "base/containers/flat_set.h" #include "chromeos/ash/components/dbus/rmad/rmad.pb.h" #include "chromeos/ash/components/dbus/rmad/rmad_client.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
diff --git a/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc b/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc index 94e2357..523117e 100644 --- a/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc +++ b/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc
@@ -19,13 +19,13 @@ #include "base/test/task_environment.h" #include "chromeos/ash/components/dbus/rmad/fake_rmad_client.h" #include "chromeos/ash/components/dbus/rmad/rmad_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_type_pattern.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" @@ -120,7 +120,7 @@ void SetUp() override { chromeos::DBusThreadManager::Initialize(); // VersionUpdater depends on UpdateEngineClient. - chromeos::UpdateEngineClient::InitializeFake(); + UpdateEngineClient::InitializeFake(); SetupFakeNetwork(); FakeRmadClientForTest::Initialize(); @@ -145,7 +145,7 @@ NetworkHandler::Shutdown(); cros_network_config_test_helper_.reset(); chromeos::LoginState::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + UpdateEngineClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/ash/webui/shimless_rma/backend/version_updater.cc b/ash/webui/shimless_rma/backend/version_updater.cc index f7065c0..eabe016 100644 --- a/ash/webui/shimless_rma/backend/version_updater.cc +++ b/ash/webui/shimless_rma/backend/version_updater.cc
@@ -5,8 +5,8 @@ #include "ash/webui/shimless_rma/backend/version_updater.h" #include "base/logging.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_type_pattern.h" @@ -199,7 +199,7 @@ void VersionUpdater::OnRequestUpdateCheck( UpdateEngineClient::UpdateCheckResult result) { - if (result != chromeos::UpdateEngineClient::UPDATE_RESULT_SUCCESS) { + if (result != UpdateEngineClient::UPDATE_RESULT_SUCCESS) { LOG(ERROR) << "OS update request failed."; ReportUpdateFailure(status_callback_, update_engine::REPORTING_ERROR_EVENT, update_engine::ErrorCode::kDownloadTransferError);
diff --git a/ash/webui/shimless_rma/backend/version_updater.h b/ash/webui/shimless_rma/backend/version_updater.h index ebfc008f..25aa389 100644 --- a/ash/webui/shimless_rma/backend/version_updater.h +++ b/ash/webui/shimless_rma/backend/version_updater.h
@@ -8,8 +8,8 @@ #include <string> #include "base/callback.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" namespace ash { namespace shimless_rma { @@ -17,7 +17,7 @@ // TODO(gavindodd): Consider if this can be shared with // chrome/browser/ash/login/version_updater/version_updater -class VersionUpdater : public chromeos::UpdateEngineClient::Observer { +class VersionUpdater : public UpdateEngineClient::Observer { public: typedef base::RepeatingCallback<void(update_engine::Operation operation, double progress, @@ -44,8 +44,7 @@ private: // Callback from UpdateEngineClient::RequestUpdateCheck(). - void OnRequestUpdateCheck( - chromeos::UpdateEngineClient::UpdateCheckResult result); + void OnRequestUpdateCheck(UpdateEngineClient::UpdateCheckResult result); // UpdateEngineClient::Observer implementation. void UpdateStatusChanged(const update_engine::StatusResult& status) override;
diff --git a/ash/webui/shimless_rma/backend/version_updater_unittest.cc b/ash/webui/shimless_rma/backend/version_updater_unittest.cc index c6f5fc4..6f876963 100644 --- a/ash/webui/shimless_rma/backend/version_updater_unittest.cc +++ b/ash/webui/shimless_rma/backend/version_updater_unittest.cc
@@ -8,17 +8,17 @@ #include "base/bind.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_certificate_handler.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/ash/webui/shimless_rma/mojom/BUILD.gn b/ash/webui/shimless_rma/mojom/BUILD.gn index 91f81c5..f08f8dbc 100644 --- a/ash/webui/shimless_rma/mojom/BUILD.gn +++ b/ash/webui/shimless_rma/mojom/BUILD.gn
@@ -97,14 +97,14 @@ traits_headers = [ "shimless_rma_mojom_traits.h", "//chromeos/ash/components/dbus/rmad/rmad.pb.h", - "//chromeos/dbus/update_engine/update_engine.pb.h", - "//chromeos/dbus/update_engine/update_engine_client.h", + "//chromeos/ash/components/dbus/update_engine/update_engine.pb.h", + "//chromeos/ash/components/dbus/update_engine/update_engine_client.h", ] traits_sources = [ "shimless_rma_mojom_traits.cc" ] traits_public_deps = [ "//chromeos/ash/components/dbus/rmad:rmad_proto", - "//chromeos/dbus/update_engine:proto", - "//chromeos/dbus/update_engine:update_engine", + "//chromeos/ash/components/dbus/update_engine:proto", + "//chromeos/ash/components/dbus/update_engine:update_engine", "//dbus", ] }, @@ -122,7 +122,7 @@ "//base/test:test_support", "//chromeos/ash/components/dbus/rmad", "//chromeos/ash/components/dbus/rmad:rmad_proto", - "//chromeos/dbus/update_engine", + "//chromeos/ash/components/dbus/update_engine", "//content/test:test_support", "//services/data_decoder/public/cpp:test_support", "//services/device/public/cpp:test_support",
diff --git a/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.cc b/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.cc index 4ff89ba..b1d4f1a 100644 --- a/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.cc +++ b/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.cc
@@ -8,8 +8,8 @@ #include "base/notreached.h" #include "chromeos/ash/components/dbus/rmad/rmad.pb.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "mojo/public/cpp/bindings/enum_traits.h" namespace mojo {
diff --git a/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.h b/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.h index 87ceb83..9954df72 100644 --- a/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.h +++ b/ash/webui/shimless_rma/mojom/shimless_rma_mojom_traits.h
@@ -7,8 +7,8 @@ #include "ash/webui/shimless_rma/mojom/shimless_rma.mojom.h" #include "chromeos/ash/components/dbus/rmad/rmad.pb.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "mojo/public/cpp/bindings/enum_traits.h" namespace mojo {
diff --git a/base/allocator/partition_allocator/address_pool_manager.h b/base/allocator/partition_allocator/address_pool_manager.h index b6871be7..ed674cc3 100644 --- a/base/allocator/partition_allocator/address_pool_manager.h +++ b/base/allocator/partition_allocator/address_pool_manager.h
@@ -21,13 +21,6 @@ #include "base/allocator/partition_allocator/partition_lock.h" #include "build/build_config.h" -namespace base { - -template <typename Type> -struct LazyInstanceTraitsBase; - -} // namespace base - namespace partition_alloc { class AddressSpaceStatsDumper; @@ -166,8 +159,6 @@ #endif // defined(PA_HAS_64_BITS_POINTERS) static AddressPoolManager singleton_; - - friend struct base::LazyInstanceTraitsBase<AddressPoolManager>; }; PA_ALWAYS_INLINE pool_handle GetRegularPool() {
diff --git a/base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h b/base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h index ee0cb382..695d977 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h +++ b/base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h
@@ -9,12 +9,6 @@ class LapTimer; -template <typename Type, typename Traits> -class LazyInstance; - -template <typename Type> -struct LazyInstanceTraitsBase; - } // namespace base namespace partition_alloc::internal::base { @@ -22,8 +16,6 @@ // TODO(https://crbug.com/1288247): Remove these 'using' declarations once // the migration to the new namespaces gets done. using ::base::LapTimer; -using ::base::LazyInstance; -using ::base::LazyInstanceTraitsBase; } // namespace partition_alloc::internal::base
diff --git a/base/allocator/partition_allocator/partition_alloc_base/time/time_win.cc b/base/allocator/partition_allocator/partition_alloc_base/time/time_win.cc index e36aeb6..7deae93 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/time/time_win.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/time/time_win.cc
@@ -327,7 +327,7 @@ // "rollover" counter. union LastTimeAndRolloversState { // The state as a single 32-bit opaque value. - std::atomic<int32_t> as_opaque_32; + std::atomic<int32_t> as_opaque_32{0}; // The state as usable values. struct {
diff --git a/base/third_party/libevent/BUILD.gn b/base/third_party/libevent/BUILD.gn deleted file mode 100644 index c66c345..0000000 --- a/base/third_party/libevent/BUILD.gn +++ /dev/null
@@ -1,8 +0,0 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("libevent") { - # TODO(https://crbug.com/1335194): Remove this when WebRTC migrates. - public_deps = [ "//third_party/libevent" ] -}
diff --git a/base/third_party/libevent/event.h b/base/third_party/libevent/event.h deleted file mode 100644 index 8f2a899..0000000 --- a/base/third_party/libevent/event.h +++ /dev/null
@@ -1,11 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// TODO(https://crbug.com/1335194): Remove this when WebRTC migrates. -#ifndef BASE_THIRD_PARTY_LIBEVENT_EVENT_H_ -#define BASE_THIRD_PARTY_LIBEVENT_EVENT_H_ - -#include "third_party/libevent/event.h" - -#endif // BASE_THIRD_PARTY_LIBEVENT_EVENT_H_
diff --git a/cc/paint/oop_pixeltest.cc b/cc/paint/oop_pixeltest.cc index 16ba3386..dc214fd 100644 --- a/cc/paint/oop_pixeltest.cc +++ b/cc/paint/oop_pixeltest.cc
@@ -2236,13 +2236,24 @@ SkBitmap expected_bitmap; expected_bitmap.allocN32Pixels(options.resource_size.width(), options.resource_size.height()); + + for (auto& backend : backend_textures) { + GrGLTextureInfo info; + if (backend.getGLTextureInfo(&info)) { + gl->BeginSharedImageAccessDirectCHROMIUM( + info.fID, GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM); + } + } + expected_image->readPixels(expected_bitmap.pixmap(), 0, 0); ExpectEquals(actual_bitmap, expected_bitmap); for (auto& backend : backend_textures) { GrGLTextureInfo info; - if (backend.getGLTextureInfo(&info)) + if (backend.getGLTextureInfo(&info)) { + gl->EndSharedImageAccessDirectCHROMIUM(info.fID); gl->DeleteTextures(1, &info.fID); + } } gpu::SyncToken sync_token; @@ -2356,13 +2367,24 @@ SkBitmap expected_bitmap; expected_bitmap.allocN32Pixels(options.resource_size.width(), options.resource_size.height()); + + for (auto& backend : backend_textures) { + GrGLTextureInfo info; + if (backend.getGLTextureInfo(&info)) { + gl->BeginSharedImageAccessDirectCHROMIUM( + info.fID, GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM); + } + } + expected_image->readPixels(expected_bitmap.pixmap(), 0, 0); ExpectEquals(actual_bitmap, expected_bitmap); for (auto& backend : backend_textures) { GrGLTextureInfo info; - if (backend.getGLTextureInfo(&info)) + if (backend.getGLTextureInfo(&info)) { + gl->EndSharedImageAccessDirectCHROMIUM(info.fID); gl->DeleteTextures(1, &info.fID); + } } gpu::SyncToken sync_token;
diff --git a/chrome/VERSION b/chrome/VERSION index 4aedad7..522efe0 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=105 MINOR=0 -BUILD=5159 +BUILD=5160 PATCH=0
diff --git a/chrome/android/features/tab_ui/BUILD.gn b/chrome/android/features/tab_ui/BUILD.gn index da3f84f..ece1aaa2 100644 --- a/chrome/android/features/tab_ui/BUILD.gn +++ b/chrome/android/features/tab_ui/BUILD.gn
@@ -105,6 +105,7 @@ "java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardView.java", "java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewBinder.java", "java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java", + "java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewUtils.java", "java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java", "java/src/org/chromium/chrome/browser/tasks/tab_management/MultiThumbnailCardProvider.java", "java/src/org/chromium/chrome/browser/tasks/tab_management/NewTabTileCoordinator.java",
diff --git a/chrome/android/features/tab_ui/java/res/layout/large_message_card_item.xml b/chrome/android/features/tab_ui/java/res/layout/large_message_card_item.xml index 7398459..967c636c 100644 --- a/chrome/android/features/tab_ui/java/res/layout/large_message_card_item.xml +++ b/chrome/android/features/tab_ui/java/res/layout/large_message_card_item.xml
@@ -18,6 +18,7 @@ android:id="@+id/large_message_linear_layout" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginBottom="16dp" android:orientation="vertical"> <org.chromium.chrome.browser.tasks.tab_management.PriceCardView android:id="@+id/price_info_box" @@ -62,12 +63,19 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" android:layout_marginStart="24dp" android:layout_marginEnd="24dp" android:layout_gravity="center" android:paddingTop="8dp" android:paddingBottom="8dp" /> + <org.chromium.ui.widget.ButtonCompat + android:id="@+id/secondary_action_button" + style="@style/TextButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginTop="8dp" + android:visibility="gone" /> </LinearLayout> <org.chromium.ui.widget.ChromeImageView android:id="@+id/close_button"
diff --git a/chrome/android/features/tab_ui/java/res/values/dimens.xml b/chrome/android/features/tab_ui/java/res/values/dimens.xml index 14195a21..f085615 100644 --- a/chrome/android/features/tab_ui/java/res/values/dimens.xml +++ b/chrome/android/features/tab_ui/java/res/values/dimens.xml
@@ -23,8 +23,8 @@ <dimen name="tab_grid_iph_dialog_text_top_margin_landscape">8dp</dimen> <dimen name="tab_grid_iph_dialog_text_top_margin_portrait">16dp</dimen> <dimen name="tab_grid_iph_dialog_text_side_margin">32dp</dimen> - <dimen name="tab_grid_merge_threshold">45dp</dimen> <dimen name="tab_grid_large_message_side_padding_landscape">114dp</dimen> + <dimen name="tab_grid_merge_threshold">45dp</dimen> <dimen name="tab_grid_thumbnail_card_default_size">152dp</dimen> <dimen name="tab_grid_thumbnail_favicon_frame_corner_radius">7dp</dimen> <dimen name="tab_grid_thumbnail_favicon_frame_size">24dp</dimen>
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardView.java index 8b0a449..11c6db3 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardView.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.tasks.tab_management; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -20,7 +21,10 @@ import org.chromium.chrome.browser.tab.state.ShoppingPersistedTabData; import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; import org.chromium.chrome.tab_ui.R; +import org.chromium.components.browser_ui.styles.ChromeColors; +import org.chromium.components.browser_ui.widget.MaterialCardViewNoShadow; import org.chromium.components.browser_ui.widget.textbubble.TextBubble; +import org.chromium.ui.base.ViewUtils; import org.chromium.ui.widget.ButtonCompat; import org.chromium.ui.widget.ChromeImageView; import org.chromium.ui.widget.ViewRectProvider; @@ -36,11 +40,13 @@ private final Context mContext; private final int mLandscapeSidePadding; + private MaterialCardViewNoShadow mMaterialCardViewNoShadow; private PriceCardView mPriceInfoBox; private ChromeImageView mIcon; private TextView mTitle; private TextView mDescription; private ButtonCompat mActionButton; + private ButtonCompat mSecondaryActionButton; private ChromeImageView mCloseButton; public LargeMessageCardView(Context context, AttributeSet attrs) { @@ -54,11 +60,13 @@ protected void onFinishInflate() { super.onFinishInflate(); + mMaterialCardViewNoShadow = findViewById(R.id.large_message_card_view); mPriceInfoBox = findViewById(R.id.price_info_box); mIcon = findViewById(R.id.icon); mTitle = findViewById(R.id.title); mDescription = findViewById(R.id.description); mActionButton = findViewById(R.id.action_button); + mSecondaryActionButton = findViewById(R.id.secondary_action_button); mCloseButton = findViewById(R.id.close_button); if (sCloseButtonBitmapWeakRef == null || sCloseButtonBitmapWeakRef.get() == null) { @@ -102,6 +110,17 @@ } /** + * Set text for the secondary action button and toggles the visibility to VISIBLE if GONE. + * @param secondaryActionText Text to be displayed. + */ + void setSecondaryActionText(String secondaryActionText) { + if (mSecondaryActionButton.getVisibility() == View.GONE) { + mSecondaryActionButton.setVisibility(View.VISIBLE); + } + mSecondaryActionButton.setText(secondaryActionText); + } + + /** * Set click listener for the action button. * @param listener {@link android.view.View.OnClickListener} for the action button. */ @@ -110,6 +129,14 @@ } /** + * Set click listener for the secondary action button. + * @param listener {@link android.view.View.OnClickListener} for the secondary action button. + */ + void setSecondaryActionButtonOnClickListener(OnClickListener listener) { + mSecondaryActionButton.setOnClickListener(listener); + } + + /** * Set content description for dismiss button. * @param description The content description. */ @@ -157,6 +184,18 @@ } } + /** + * Set close button visibility. + * @param visible Whether icon is visible. + */ + void setCloseButtonVisibility(boolean visible) { + if (visible) { + mCloseButton.setVisibility(View.VISIBLE); + } else { + mCloseButton.setVisibility(View.GONE); + } + } + @VisibleForTesting void updateWidthWithOrientation(int orientation) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { @@ -181,4 +220,57 @@ textBubble.setDismissOnTouchInteraction(true); textBubble.show(); } + + /** + * Update Message Card when switching between normal mode and incognito mode. + * + * @param isIncognito Whether it is in the incognito mode. + */ + void updateMessageCardColor(boolean isIncognito) { + setBackground(isIncognito); + MessageCardViewUtils.setTitleTextAppearance( + mTitle, isIncognito, /*isLargeMessageCard=*/true); + MessageCardViewUtils.setDescriptionTextAppearance( + mDescription, isIncognito, /*isLargeMessageCard=*/true); + MessageCardViewUtils.setActionButtonTextAppearance( + mActionButton, isIncognito, /*isLargeMessageCard=*/true); + MessageCardViewUtils.setSecondaryActionButtonColor(mSecondaryActionButton, isIncognito); + MessageCardViewUtils.setCloseButtonTint(mCloseButton, isIncognito); + } + + /** + * Update the icon's width. + * + * TODO(crbug.com/1227656): Confirm with UX, whether large message card can follow a general + * icon size for all clients. If so, then remove this method. + * + * @param width The desired width to set. + */ + void updateIconWidth(int width) { + mIcon.getLayoutParams().width = ViewUtils.dpToPx(mContext, width); + } + + /** + * Update the icon's height. + * + * TODO(crbug.com/1227656): Confirm with UX, whether large message card can follow a general + * icon size for all clients. If so, then remove this method. + * + * @param height The desired height to set. + */ + void updateIconHeight(int height) { + mIcon.getLayoutParams().height = ViewUtils.dpToPx(mIcon.getContext(), height); + } + + /** + * Set background resource. + * + * @param isIncognito Whether the resource is used for incognito mode. + */ + private void setBackground(boolean isIncognito) { + ColorStateList backgroundTint = ColorStateList.valueOf((isIncognito) + ? mContext.getColor(R.color.incognito_card_bg_color) + : ChromeColors.getSurfaceColor(mContext, R.dimen.card_elevation)); + mMaterialCardViewNoShadow.setBackgroundTintList(backgroundTint); + } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinder.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinder.java index 64c14bc..1ee4b849 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinder.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinder.java
@@ -34,6 +34,12 @@ model.get(MessageCardViewProperties.DISMISS_BUTTON_CONTENT_DESCRIPTION)); itemView.setDismissButtonOnClickListener( v -> { LargeMessageCardViewBinder.handleDismissActionButton(model); }); + } else if (MessageCardViewProperties.SECONDARY_ACTION_TEXT == propertyKey) { + itemView.setSecondaryActionText( + model.get(MessageCardViewProperties.SECONDARY_ACTION_TEXT)); + } else if (MessageCardViewProperties.SECONDARY_ACTION_BUTTON_CLICK_HANDLER == propertyKey) { + itemView.setSecondaryActionButtonOnClickListener( + model.get(MessageCardViewProperties.SECONDARY_ACTION_BUTTON_CLICK_HANDLER)); } else if (MessageCardViewProperties.PRICE_DROP == propertyKey) { itemView.setupPriceInfoBox(model.get(MessageCardViewProperties.PRICE_DROP)); } else if (MessageCardViewProperties.ICON_PROVIDER == propertyKey) { @@ -43,6 +49,15 @@ itemView.setIconVisibility(model.get(MessageCardViewProperties.IS_ICON_VISIBLE)); } else if (CARD_ALPHA == propertyKey) { itemView.setAlpha(model.get(CARD_ALPHA)); + } else if (MessageCardViewProperties.IS_CLOSE_BUTTON_VISIBLE == propertyKey) { + itemView.setCloseButtonVisibility( + model.get(MessageCardViewProperties.IS_CLOSE_BUTTON_VISIBLE)); + } else if (MessageCardViewProperties.IS_INCOGNITO == propertyKey) { + itemView.updateMessageCardColor(model.get(MessageCardViewProperties.IS_INCOGNITO)); + } else if (MessageCardViewProperties.ICON_WIDTH == propertyKey) { + itemView.updateIconWidth(model.get(MessageCardViewProperties.ICON_WIDTH)); + } else if (MessageCardViewProperties.ICON_HEIGHT == propertyKey) { + itemView.updateIconHeight(model.get(MessageCardViewProperties.ICON_HEIGHT)); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardView.java index 09778d20..5fe4e29 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardView.java
@@ -12,7 +12,6 @@ import android.util.AttributeSet; import android.widget.LinearLayout; -import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.tab_ui.R; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.widget.text.TemplatePreservingTextView; @@ -166,42 +165,15 @@ } /** - * Set text appearance for description. - * @param isIncognito Whether the text appearance is used for incognito mode. - */ - private void setDescriptionTextAppearance(boolean isIncognito) { - ApiCompatibilityUtils.setTextAppearance(mDescription, - TabUiThemeProvider.getMessageCardDescriptionTextAppearance(isIncognito)); - } - - /** - * Set text appearance for action button. - * @param isIncognito Whether the text appearance is used for incognito mode. - */ - private void setActionButtonTextAppearance(boolean isIncognito) { - ApiCompatibilityUtils.setTextAppearance(mActionButton, - TabUiThemeProvider.getMessageCardActionButtonTextAppearance(isIncognito)); - } - - /** - * Set tint for close button. - * @param isIncognito Whether the tint is used for incognito mode. - */ - private void setCloseButtonTint(boolean isIncognito) { - ApiCompatibilityUtils.setImageTintList(mCloseButton, - TabUiThemeProvider.getMessageCardCloseButtonTintList( - mCloseButton.getContext(), isIncognito)); - } - - /** * Update Message Card when switching between normal mode and incognito mode. * @param isIncognito Whether it is in the incognito mode. */ void updateMessageCardColor(boolean isIncognito) { setBackground(isIncognito); - setDescriptionTextAppearance(isIncognito); - setActionButtonTextAppearance(isIncognito); - // TODO(crbug.com/1139194): Set action button ripple color. - setCloseButtonTint(isIncognito); + MessageCardViewUtils.setDescriptionTextAppearance( + mDescription, isIncognito, /*isLargeMessageCard=*/false); + MessageCardViewUtils.setActionButtonTextAppearance( + mActionButton, isIncognito, /*isLargeMessageCard=*/false); + MessageCardViewUtils.setCloseButtonTint(mCloseButton, isIncognito); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java index 12715ad..d14ed27 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java
@@ -7,6 +7,8 @@ import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_ALPHA; import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_TYPE; +import android.view.View.OnClickListener; + import org.chromium.chrome.browser.tab.state.ShoppingPersistedTabData; import org.chromium.ui.modelutil.PropertyKey; import org.chromium.ui.modelutil.PropertyModel; @@ -23,6 +25,8 @@ new PropertyModel.ReadableIntPropertyKey(); public static final PropertyModel.WritableObjectPropertyKey<String> ACTION_TEXT = new PropertyModel.WritableObjectPropertyKey<>(); + public static final PropertyModel.WritableObjectPropertyKey<String> SECONDARY_ACTION_TEXT = + new PropertyModel.WritableObjectPropertyKey<>(); public static final PropertyModel.WritableObjectPropertyKey<String> DESCRIPTION_TEXT = new PropertyModel.WritableObjectPropertyKey<>(); public static final PropertyModel.WritableObjectPropertyKey<String> DESCRIPTION_TEXT_TEMPLATE = @@ -36,6 +40,9 @@ public static final PropertyModel .WritableObjectPropertyKey<MessageCardView.DismissActionProvider> UI_DISMISS_ACTION_PROVIDER = new PropertyModel.WritableObjectPropertyKey<>(); + public static final PropertyModel + .WritableObjectPropertyKey<OnClickListener> SECONDARY_ACTION_BUTTON_CLICK_HANDLER = + new PropertyModel.WritableObjectPropertyKey<>(); public static final PropertyModel.WritableObjectPropertyKey< MessageCardView.ReviewActionProvider> MESSAGE_SERVICE_ACTION_PROVIDER = new PropertyModel.WritableObjectPropertyKey<>(); @@ -47,8 +54,14 @@ new PropertyModel.WritableObjectPropertyKey<>(); public static final PropertyModel.WritableBooleanPropertyKey SHOULD_KEEP_AFTER_REVIEW = new PropertyModel.WritableBooleanPropertyKey(); + public static final PropertyModel.WritableBooleanPropertyKey IS_CLOSE_BUTTON_VISIBLE = + new PropertyModel.WritableBooleanPropertyKey(); public static final PropertyModel.WritableBooleanPropertyKey IS_ICON_VISIBLE = new PropertyModel.WritableBooleanPropertyKey(); + public static final PropertyModel.WritableIntPropertyKey ICON_WIDTH = + new PropertyModel.WritableIntPropertyKey(); + public static final PropertyModel.WritableIntPropertyKey ICON_HEIGHT = + new PropertyModel.WritableIntPropertyKey(); public static final PropertyModel.WritableBooleanPropertyKey IS_INCOGNITO = new PropertyModel.WritableBooleanPropertyKey(); public static final PropertyModel.WritableObjectPropertyKey<String> TITLE_TEXT = @@ -60,10 +73,12 @@ .WritableObjectPropertyKey<ShoppingPersistedTabData.PriceDrop> PRICE_DROP = new PropertyModel.WritableObjectPropertyKey<>(); - public static final PropertyKey[] ALL_KEYS = new PropertyKey[] {ACTION_TEXT, DESCRIPTION_TEXT, - DESCRIPTION_TEXT_TEMPLATE, MESSAGE_TYPE, MESSAGE_IDENTIFIER, ICON_PROVIDER, - UI_ACTION_PROVIDER, UI_DISMISS_ACTION_PROVIDER, MESSAGE_SERVICE_ACTION_PROVIDER, + public static final PropertyKey[] ALL_KEYS = new PropertyKey[] {ACTION_TEXT, + SECONDARY_ACTION_TEXT, DESCRIPTION_TEXT, DESCRIPTION_TEXT_TEMPLATE, MESSAGE_TYPE, + MESSAGE_IDENTIFIER, ICON_PROVIDER, UI_ACTION_PROVIDER, UI_DISMISS_ACTION_PROVIDER, + SECONDARY_ACTION_BUTTON_CLICK_HANDLER, MESSAGE_SERVICE_ACTION_PROVIDER, MESSAGE_SERVICE_DISMISS_ACTION_PROVIDER, DISMISS_BUTTON_CONTENT_DESCRIPTION, - SHOULD_KEEP_AFTER_REVIEW, IS_ICON_VISIBLE, CARD_TYPE, CARD_ALPHA, IS_INCOGNITO, - TITLE_TEXT, SHOULD_SHOW_IN_INCOGNITO, PRICE_DROP}; + SHOULD_KEEP_AFTER_REVIEW, IS_CLOSE_BUTTON_VISIBLE, IS_ICON_VISIBLE, ICON_WIDTH, + ICON_HEIGHT, CARD_TYPE, CARD_ALPHA, IS_INCOGNITO, TITLE_TEXT, SHOULD_SHOW_IN_INCOGNITO, + PRICE_DROP}; }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewUtils.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewUtils.java new file mode 100644 index 0000000..db2e155e --- /dev/null +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewUtils.java
@@ -0,0 +1,102 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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.tasks.tab_management; + +import android.widget.TextView; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.ui.widget.ButtonCompat; +import org.chromium.ui.widget.ChromeImageView; + +/** + * A common utils class for Message cards for updating the look of different UI elements present + * inside the message card view. + */ +public class MessageCardViewUtils { + /** + * Set text appearance for title. + * + * @param title The title whose text appearance we want to modify. + * @param isIncognito Whether the text appearance is used for incognito mode. + * @param isLargeMessageCard Whether the message card view requesting is a large message card. + */ + public static void setTitleTextAppearance( + TextView title, boolean isIncognito, boolean isLargeMessageCard) { + int titleTextAppearance = (isLargeMessageCard) + ? TabUiThemeProvider.getLargeMessageCardTitleTextAppearance(isIncognito) + : TabUiThemeProvider.getMessageCardTitleTextAppearance(isIncognito); + ApiCompatibilityUtils.setTextAppearance(title, titleTextAppearance); + } + + /** + * Set text appearance for description. + * + * @param description The description whose text appearance we want to modify. + * @param isIncognito Whether the text appearance is used for incognito mode. + * @param isLargeMessageCard Whether the message card view requesting is a large message card. + */ + public static void setDescriptionTextAppearance( + TextView description, boolean isIncognito, boolean isLargeMessageCard) { + int descriptionTextAppearance = (isLargeMessageCard) + ? TabUiThemeProvider.getLargeMessageCardDescriptionTextAppearance(isIncognito) + : TabUiThemeProvider.getMessageCardDescriptionTextAppearance(isIncognito); + ApiCompatibilityUtils.setTextAppearance(description, descriptionTextAppearance); + } + + /** + * Set text appearance for action button. + * + * @param actionButton The button whose text appearance we want to modify. + * @param isIncognito Whether the text appearance is used for incognito mode. + * @param isLargeMessageCard Whether the message card view requesting is a large message card. + */ + public static void setActionButtonTextAppearance( + ButtonCompat actionButton, boolean isIncognito, boolean isLargeMessageCard) { + int actionButtonTextAppearance = (isLargeMessageCard) + ? TabUiThemeProvider.getLargeMessageCardActionButtonTextAppearance(isIncognito) + : TabUiThemeProvider.getMessageCardActionButtonTextAppearance(isIncognito); + + ApiCompatibilityUtils.setTextAppearance(actionButton, actionButtonTextAppearance); + } + + /** + * Set text appearance for secondary action button. + * + * @param secondaryActionButton The button whose text appearance we want to modify. + * @param isIncognito Whether the text appearance is used for incognito mode. + */ + public static void setSecondaryActionButtonColor( + ButtonCompat secondaryActionButton, boolean isIncognito) { + secondaryActionButton.setTextColor( + TabUiThemeProvider.getMessageCardSecondaryActionButtonColor( + secondaryActionButton.getContext(), isIncognito)); + } + + /** + * Set background color for action button. + * + * @param actionButton The button whose background color we want to modify. + * @param isIncognito Whether the background color is used for incognito mode. + */ + public static void setActionButtonBackgroundColor( + ButtonCompat actionButton, boolean isIncognito) { + actionButton.setButtonColor(TabUiThemeProvider.getToggleActionButtonCheckedDrawableTintList( + actionButton.getContext(), isIncognito)); + } + + /** + * Set tint for close button. + * + * TODO(crbug.com/1139194): Set action button ripple color. + * + * @param closeButton The close button image view whose tint we want to set. + * @param isIncognito Whether the tint is used for incognito mode. + */ + public static void setCloseButtonTint(ChromeImageView closeButton, boolean isIncognito) { + ApiCompatibilityUtils.setImageTintList(closeButton, + TabUiThemeProvider.getMessageCardCloseButtonTintList( + closeButton.getContext(), isIncognito)); + } +}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java index d145093..db28e197 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java
@@ -456,7 +456,18 @@ } /** - * Returns the text appearance for the message card description based on the incognito mode. + * Returns the text appearance for the message card title based on the incognito mode. + * + * @param isIncognito Whether the text appearance is used for incognito mode. + * @return The text appearance for the message card title. + */ + public static int getMessageCardTitleTextAppearance(boolean isIncognito) { + return isIncognito ? R.style.TextAppearance_TextLarge_Primary_Baseline_Light + : R.style.TextAppearance_TextLarge_Primary; + } + + /** + * Returns the text appearance for message card description based on the incognito mode. * * @param isIncognito Whether the text appearance is used for incognito mode. * @return The text appearance for the message card description. @@ -478,6 +489,55 @@ } /** + * Returns the text appearance for the message card title based on the incognito mode. + * + * @param isIncognito Whether the text appearance is used for incognito mode. + * @return The text appearance for the message card title. + */ + public static int getLargeMessageCardTitleTextAppearance(boolean isIncognito) { + return isIncognito ? R.style.TextAppearance_TextLarge_Primary_Baseline_Light + : R.style.TextAppearance_TextLarge_Primary; + } + + /** + * Returns the text appearance for large message card description based on the incognito mode. + * + * @param isIncognito Whether the text appearance is used for incognito mode. + * @return The text appearance for the message card description. + */ + public static int getLargeMessageCardDescriptionTextAppearance(boolean isIncognito) { + return isIncognito ? R.style.TextAppearance_TextMedium_Secondary_Baseline_Light + : R.style.TextAppearance_TextMedium_Secondary; + } + + /** + * Returns the text appearance for the large message card action button based on the incognito + * mode. + * + * @param isIncognito Whether the text appearance is used for incognito mode. + * @return The text appearance for the message card action button. + */ + public static int getLargeMessageCardActionButtonTextAppearance(boolean isIncognito) { + return isIncognito ? R.style.TextAppearance_Button_Text_Blue_Dark + : R.style.TextAppearance_Button_Text_Filled; + } + + /** + * Returns the text color for the message card secondary action button based on the + * incognito mode. + * + * @param context The {@link Context} to use to fetch the resources. + * @param isIncognito Whether the text appearance is used for incognito mode. + * + * @return The {@link ColorInt} to set for the message card secondary action button. + */ + public static @ColorInt int getMessageCardSecondaryActionButtonColor( + Context context, boolean isIncognito) { + return isIncognito ? context.getColor(R.color.default_text_color_link_light) + : SemanticColorUtils.getDefaultTextColorLink(context); + } + + /** * Returns the {@link ColorStateList} to use for the message card close button based on * incognito mode. *
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java index 806c0c8..76f6199a 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java
@@ -4,13 +4,19 @@ package org.chromium.chrome.browser.tasks.tab_management; +import static android.view.View.GONE; +import static android.view.View.VISIBLE; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.chromium.base.test.util.Batch.UNIT_TESTS; + import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.view.View; +import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.TextView; @@ -22,6 +28,7 @@ import org.junit.runner.RunWith; import org.chromium.base.test.UiThreadTest; +import org.chromium.base.test.util.Batch; import org.chromium.chrome.browser.tab.state.ShoppingPersistedTabData; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -38,15 +45,18 @@ * Tests for {@link LargeMessageCardViewBinder}. */ @RunWith(ChromeJUnit4ClassRunner.class) +@Batch(UNIT_TESTS) public class LargeMessageCardViewBinderTest extends BlankUiTestActivityTestCase { private static final String TITLE_TEXT = "titleText"; private static final String ACTION_TEXT = "actionText"; private static final String DESCRIPTION_TEXT = "descriptionText"; + private static final String SECONDARY_ACTION_TEXT = "secondaryActionText"; private static final String DISMISS_BUTTON_CONTENT_DESCRIPTION = "dismiss"; private static final String PRICE = "$300"; private static final String PREVIOUS_PRICE = "$400"; private final AtomicBoolean mReviewButtonClicked = new AtomicBoolean(); + private final AtomicBoolean mSecondaryActionButtonClicked = new AtomicBoolean(); private final AtomicBoolean mDismissButtonClicked = new AtomicBoolean(); private final AtomicBoolean mMessageServiceReviewCallbackRan = new AtomicBoolean(); private final AtomicBoolean mMessageServiceDismissCallbackRan = new AtomicBoolean(); @@ -59,11 +69,14 @@ () -> mMessageServiceReviewCallbackRan.set(true); private final MessageCardView.DismissActionProvider mMessageServiceDismissHandler = (int messageType) -> mMessageServiceDismissCallbackRan.set(true); + private final OnClickListener mSecondaryActionButtonClickListener = + view -> mSecondaryActionButtonClicked.set(true); private ChromeImageView mIcon; private TextView mTitle; private TextView mDescription; private ButtonCompat mActionButton; + private ButtonCompat mSecondaryActionButton; private ChromeImageView mCloseButton; private PriceCardView mPriceInfoBox; private LargeMessageCardView mItemView; @@ -88,6 +101,7 @@ mTitle = mItemView.findViewById(R.id.title); mDescription = mItemView.findViewById(R.id.description); mActionButton = mItemView.findViewById(R.id.action_button); + mSecondaryActionButton = mItemView.findViewById(R.id.secondary_action_button); mCloseButton = mItemView.findViewById(R.id.close_button); mItemViewModel = @@ -113,6 +127,10 @@ assertEquals(ACTION_TEXT, mActionButton.getText().toString()); assertEquals(DESCRIPTION_TEXT, mDescription.getText().toString()); assertEquals(DISMISS_BUTTON_CONTENT_DESCRIPTION, mCloseButton.getContentDescription()); + assertEquals("Secondary action button should be gone by default.", GONE, + mSecondaryActionButton.getVisibility()); + assertEquals("Close button should be visible by default.", VISIBLE, + mCloseButton.getVisibility()); } @Test @@ -131,30 +149,61 @@ @UiThreadTest @SmallTest public void testSetIconVisibility() { - assertEquals(View.GONE, mIcon.getVisibility()); + assertEquals(GONE, mIcon.getVisibility()); mItemViewModel.set(MessageCardViewProperties.IS_ICON_VISIBLE, true); - assertEquals(View.VISIBLE, mIcon.getVisibility()); + assertEquals(VISIBLE, mIcon.getVisibility()); mItemViewModel.set(MessageCardViewProperties.IS_ICON_VISIBLE, false); - assertEquals(View.GONE, mIcon.getVisibility()); + assertEquals(GONE, mIcon.getVisibility()); + } + + @Test + @UiThreadTest + @SmallTest + public void testSetCloseIconVisibility() { + mItemViewModel.set(MessageCardViewProperties.IS_CLOSE_BUTTON_VISIBLE, false); + assertEquals("Close button should not be visible.", GONE, mCloseButton.getVisibility()); + } + + @Test + @UiThreadTest + @SmallTest + public void testSecondaryActionText() { + mItemViewModel.set(MessageCardViewProperties.SECONDARY_ACTION_TEXT, SECONDARY_ACTION_TEXT); + assertEquals("Fail to set secondary action text.", SECONDARY_ACTION_TEXT, + mSecondaryActionButton.getText()); + assertEquals("Secondary action text should be visible.", View.VISIBLE, + mSecondaryActionButton.getVisibility()); + } + + @Test + @UiThreadTest + @SmallTest + public void testSecondaryActionOnClickListenerTest() { + mSecondaryActionButtonClicked.set(false); + mItemViewModel.set(MessageCardViewProperties.SECONDARY_ACTION_TEXT, SECONDARY_ACTION_TEXT); + mItemViewModel.set(MessageCardViewProperties.SECONDARY_ACTION_BUTTON_CLICK_HANDLER, + mSecondaryActionButtonClickListener); + mSecondaryActionButton.performClick(); + assertTrue("Secondary button didn't fire properly.", mSecondaryActionButtonClicked.get()); } @Test @UiThreadTest @SmallTest public void testSetupPriceInfoBox() { - assertEquals(View.GONE, mPriceInfoBox.getVisibility()); + assertEquals(GONE, mPriceInfoBox.getVisibility()); mItemViewModel.set(MessageCardViewProperties.PRICE_DROP, new ShoppingPersistedTabData.PriceDrop(PRICE, PREVIOUS_PRICE)); - assertEquals(View.VISIBLE, mPriceInfoBox.getVisibility()); + assertEquals(VISIBLE, mPriceInfoBox.getVisibility()); assertEquals(PRICE, ((TextView) mItemView.findViewById(R.id.current_price)).getText().toString()); assertEquals(PREVIOUS_PRICE, ((TextView) mItemView.findViewById(R.id.previous_price)).getText().toString()); mItemViewModel.set(MessageCardViewProperties.PRICE_DROP, null); - assertEquals(View.GONE, mPriceInfoBox.getVisibility()); + assertEquals(GONE, mPriceInfoBox.getVisibility()); } @Test
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderUnitTest.java index 04f6be4..d0d4280 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderUnitTest.java
@@ -8,14 +8,17 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_ALPHA; import android.graphics.drawable.Drawable; +import android.view.View.OnClickListener; import androidx.test.filters.SmallTest; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +35,10 @@ */ @RunWith(BaseRobolectricTestRunner.class) public class LargeMessageCardViewBinderUnitTest { + private static final String FAKE_DISPLAY_TEXT = "Fake Text"; + private static final int FAKE_ICON_WIDTH = 666; + private static final int FAKE_ICON_HEIGHT = 999; + @Mock LargeMessageCardView mMockLargeCardView; @@ -56,7 +63,9 @@ @Mock Drawable mMockDrawable; - private static final String FAKE_DISPLAY_TEXT = "Fake Text"; + @Mock + private OnClickListener mMockOnClickListenerMock; + private PropertyModel mModel; @Before @@ -68,6 +77,13 @@ mModel, mMockLargeCardView, LargeMessageCardViewBinder::bind); } + @After + public void tearDown() { + verifyNoMoreInteractions(mMockLargeCardView, mMockDismissActionProvider1, + mMockDismissActionProvider2, mMockReviewActionProvider1, mMockReviewActionProvider2, + mMockPriceDrop, mMockIconProvider, mMockDrawable, mMockOnClickListenerMock); + } + @Test @SmallTest public void updateContntDescriptionText() { @@ -94,6 +110,22 @@ @Test @SmallTest + public void updateSecondaryActionButtonText() { + mModel.set(MessageCardViewProperties.SECONDARY_ACTION_TEXT, FAKE_DISPLAY_TEXT); + verify(mMockLargeCardView, times(1)).setSecondaryActionText(FAKE_DISPLAY_TEXT); + } + + @Test + @SmallTest + public void updateSecondaryActionButtonOnClickListener() { + mModel.set(MessageCardViewProperties.SECONDARY_ACTION_BUTTON_CLICK_HANDLER, + mMockOnClickListenerMock); + verify(mMockLargeCardView, times(1)) + .setSecondaryActionButtonOnClickListener(mMockOnClickListenerMock); + } + + @Test + @SmallTest public void updateTitleText() { mModel.set(MessageCardViewProperties.TITLE_TEXT, FAKE_DISPLAY_TEXT); verify(mMockLargeCardView, times(1)).setTitleText(FAKE_DISPLAY_TEXT); @@ -121,9 +153,35 @@ @Test @SmallTest + public void updateIconWidth() { + mModel.set(MessageCardViewProperties.ICON_WIDTH, FAKE_ICON_WIDTH); + verify(mMockLargeCardView, times(1)).updateIconWidth(FAKE_ICON_WIDTH); + } + + @Test + @SmallTest + public void updateIconHeight() { + mModel.set(MessageCardViewProperties.ICON_HEIGHT, FAKE_ICON_HEIGHT); + verify(mMockLargeCardView, times(1)).updateIconHeight(FAKE_ICON_HEIGHT); + } + + @Test + @SmallTest + public void updateCloseIconVisibility() { + mModel.set(MessageCardViewProperties.IS_CLOSE_BUTTON_VISIBLE, false); + verify(mMockLargeCardView, times(1)).setCloseButtonVisibility(false); + + mModel.set(MessageCardViewProperties.IS_CLOSE_BUTTON_VISIBLE, true); + verify(mMockLargeCardView, times(1)).setCloseButtonVisibility(true); + } + + @Test + @SmallTest public void updateIconDrawable() { when(mMockIconProvider.getIconDrawable()).thenReturn(mMockDrawable); mModel.set(MessageCardViewProperties.ICON_PROVIDER, mMockIconProvider); + + verify(mMockIconProvider, times(1)).getIconDrawable(); verify(mMockLargeCardView, times(1)).setIconDrawable(mMockDrawable); }
diff --git a/chrome/android/java/src/PRESUBMIT.py b/chrome/android/java/src/PRESUBMIT.py index 6ce7516a..e1fab0d 100644 --- a/chrome/android/java/src/PRESUBMIT.py +++ b/chrome/android/java/src/PRESUBMIT.py
@@ -36,8 +36,6 @@ COMMENT_RE = re.compile(r'^\s*(//|/\*|\*)') BROWSER_ROOT = 'chrome/android/java/src/org/chromium/chrome/browser/' -SIGNIN_UI_BROWSER_ROOT = 'chrome/browser/ui/android/signin' -'/java/src/org/chromium/chrome/browser/ui/signin' def CheckChangeOnUpload(input_api, output_api): @@ -94,8 +92,6 @@ BROWSER_ROOT + 'password_manager/AccountChooserDialog.java', BROWSER_ROOT + 'password_manager/AutoSigninFirstRunDialog.java', BROWSER_ROOT + r'settings[\\\/].*', - SIGNIN_UI_BROWSER_ROOT + 'ConfirmManagedSyncDataDialog.java', - SIGNIN_UI_BROWSER_ROOT + 'ConfirmSyncDataStateMachineDelegate.java', BROWSER_ROOT + 'site_settings/AddExceptionPreference.java', BROWSER_ROOT + 'site_settings/ChosenObjectSettings.java', BROWSER_ROOT + 'site_settings/ManageSpaceActivity.java',
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java index 8e07fa7..7456014e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java
@@ -9,6 +9,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.text.SpannableString; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -20,21 +21,36 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.collection.ArraySet; +import androidx.fragment.app.DialogFragment; import androidx.fragment.app.FragmentActivity; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; +import org.chromium.base.Callback; import org.chromium.base.CollectionUtil; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.browsing_data.BrowsingDataCounterBridge.BrowsingDataCounterCallback; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.historyreport.AppIndexingReporter; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.preferences.Pref; 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.sync.settings.ClearDataProgressDialog; +import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator; +import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator.ActionType; +import org.chromium.components.browser_ui.settings.ClickableSpansTextMessagePreference; import org.chromium.components.browser_ui.settings.SettingsUtils; import org.chromium.components.browser_ui.settings.SpinnerPreference; +import org.chromium.components.signin.GAIAServiceType; +import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.user_prefs.UserPrefs; +import org.chromium.ui.modaldialog.ModalDialogManagerHolder; +import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.SpanApplier; +import org.chromium.ui.text.SpanApplier.SpanInfo; import org.chromium.ui.widget.ButtonCompat; import java.lang.annotation.Retention; @@ -50,7 +66,10 @@ */ public abstract class ClearBrowsingDataFragment extends PreferenceFragmentCompat implements BrowsingDataBridge.OnClearBrowsingDataListener, - Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener { + Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener, + SignOutDialogCoordinator.Listener { + private static final String CLEAR_DATA_PROGRESS_DIALOG_TAG = "clear_data_progress"; + /** * Represents a single item in the dialog. */ @@ -566,6 +585,21 @@ assert spinnerOptionIndex != -1; spinner.setOptions(spinnerOptions, spinnerOptionIndex); spinner.setOnPreferenceChangeListener(this); + + // Text for sign-out option. + if (ChromeFeatureList.isEnabled(ChromeFeatureList.ENABLE_CBD_SIGN_OUT) + && IdentityServicesProvider.get() + .getIdentityManager(Profile.getLastUsedRegularProfile()) + .hasPrimaryAccount(ConsentLevel.SIGNIN) + && IdentityServicesProvider.get() + .getSigninManager(Profile.getLastUsedRegularProfile()) + .isSignOutAllowed()) { + ClickableSpansTextMessagePreference signOutOfChromeTextPref = + findPreference(ClearBrowsingDataFragment.PREF_SIGN_OUT_OF_CHROME_TEXT); + signOutOfChromeTextPref.setSummary(buildSignOutOfChromeText()); + } else { + deleteSignOutOfChromeTextIfExists(); + } } @Override @@ -633,6 +667,29 @@ return mConfirmImportantSitesDialog; } + @VisibleForTesting + SpannableString buildSignOutOfChromeText() { + return SpanApplier.applySpans(getContext().getString(R.string.sign_out_of_chrome_link), + new SpanInfo("<link1>", "</link1>", + new NoUnderlineClickableSpan( + requireContext(), createSignOutOfChromeCallback()))); + } + + private Callback<View> createSignOutOfChromeCallback() { + return view + -> SignOutDialogCoordinator.show(requireContext(), + ((ModalDialogManagerHolder) getActivity()).getModalDialogManager(), this, + ActionType.CLEAR_PRIMARY_ACCOUNT, GAIAServiceType.GAIA_SERVICE_TYPE_NONE); + } + + private void deleteSignOutOfChromeTextIfExists() { + Preference signOutOfChromeTextPref = + findPreference(ClearBrowsingDataFragment.PREF_SIGN_OUT_OF_CHROME_TEXT); + if (signOutOfChromeTextPref != null) { + getPreferenceScreen().removePreference(signOutOfChromeTextPref); + } + } + /** * This method shows the important sites dialog. After the dialog is shown, we correctly clear. */ @@ -695,4 +752,44 @@ ignoredDomains, ignoredDomainReasons); } } + + /** {@link SignOutDialogCoordinator.Listener} implementation */ + @Override + public void onSignOutClicked(boolean forceWipeUserData) { + // In case the user is not signed in, we guard the sign out so we do not hit a native crash. + if (!IdentityServicesProvider.get() + .getIdentityManager(Profile.getLastUsedRegularProfile()) + .hasPrimaryAccount(ConsentLevel.SIGNIN)) { + return; + } + final SigninManager signinManager = IdentityServicesProvider.get().getSigninManager( + Profile.getLastUsedRegularProfile()); + signinManager.runAfterOperationInProgress(() -> { + // In case supervised users reach this flow, remove the preference and guard against + // signing out. + if (!signinManager.isSignOutAllowed()) { + deleteSignOutOfChromeTextIfExists(); + return; + } + final DialogFragment clearDataProgressDialog = new ClearDataProgressDialog(); + signinManager.signOut(org.chromium.components.signin.metrics.SignoutReason + .USER_CLICKED_SIGNOUT_FROM_CLEAR_BROWSING_DATA_PAGE, + new SigninManager.SignOutCallback() { + @Override + public void preWipeData() { + clearDataProgressDialog.show( + getChildFragmentManager(), CLEAR_DATA_PROGRESS_DIALOG_TAG); + } + + @Override + public void signOutComplete() { + clearDataProgressDialog.dismissAllowingStateLoss(); + } + }, + forceWipeUserData); + // TODO(https://crbug.com/1334918): Observe SignInStateObserver and move this inside + // onSignOutAllowedChanged(). + deleteSignOutOfChromeTextIfExists(); + }); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced.java b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced.java index 225b975..f0ee8aa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced.java
@@ -37,9 +37,6 @@ // TODO(https://crbug.com/1334920): Change after follow up discussion with privacy team. Preference signOutOfChromeTextPref = findPreference(ClearBrowsingDataFragment.PREF_SIGN_OUT_OF_CHROME_TEXT); - if (signOutOfChromeTextPref != null) { - getPreferenceScreen().removePreference(signOutOfChromeTextPref); - } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasic.java b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasic.java index c42369d2..ab0fcc0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasic.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasic.java
@@ -13,9 +13,7 @@ import android.view.View; import androidx.annotation.IntDef; -import androidx.annotation.VisibleForTesting; import androidx.browser.customtabs.CustomTabsIntent; -import androidx.fragment.app.DialogFragment; import androidx.preference.Preference; import org.chromium.base.Callback; @@ -23,27 +21,19 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; -import org.chromium.chrome.browser.signin.services.SigninManager; import org.chromium.chrome.browser.sync.SyncService; -import org.chromium.chrome.browser.sync.settings.ClearDataProgressDialog; import org.chromium.chrome.browser.tab.TabLaunchType; import org.chromium.chrome.browser.tabmodel.document.TabDelegate; -import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator; -import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator.ActionType; import org.chromium.components.browser_ui.settings.ClickableSpansTextMessagePreference; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.components.search_engines.TemplateUrlService; -import org.chromium.components.signin.GAIAServiceType; import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.signin.identitymanager.IdentityManager; -import org.chromium.components.signin.metrics.SignoutReason; import org.chromium.components.sync.ModelType; -import org.chromium.ui.modaldialog.ModalDialogManagerHolder; import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier.SpanInfo; @@ -57,10 +47,7 @@ * A simpler version of {@link ClearBrowsingDataFragment} with fewer dialog options and more * explanatory text. */ -public class ClearBrowsingDataFragmentBasic - extends ClearBrowsingDataFragment implements SignOutDialogCoordinator.Listener { - private static final String CLEAR_DATA_PROGRESS_DIALOG_TAG = "clear_data_progress"; - +public class ClearBrowsingDataFragmentBasic extends ClearBrowsingDataFragment { /** * Functional interface to start a Chrome Custom Tab for the given intent, e.g. by using * {@link org.chromium.chrome.browser.LaunchIntentDispatcher#createCustomTabActivityIntent}. @@ -165,17 +152,6 @@ nonGoogleSearchHistoryTextPref.setSummary( R.string.clear_search_history_non_google_dse_unknown); } - - // Text for sign-out option. - if (ChromeFeatureList.isEnabled(ChromeFeatureList.ENABLE_CBD_SIGN_OUT) - && identityManager.hasPrimaryAccount(ConsentLevel.SIGNIN) - && !Profile.getLastUsedRegularProfile().isChild()) { - ClickableSpansTextMessagePreference signOutOfChromeTextPref = - findPreference(ClearBrowsingDataFragment.PREF_SIGN_OUT_OF_CHROME_TEXT); - signOutOfChromeTextPref.setSummary(buildSignOutOfChromeText()); - } else { - deleteSignOutOfChromeTextIfExists(); - } } public void setCustomTabIntentHelper(CustomTabIntentHelper tabHelper) { @@ -198,14 +174,6 @@ } } - private void deleteSignOutOfChromeTextIfExists() { - Preference signOutOfChromeTextPref = - findPreference(ClearBrowsingDataFragment.PREF_SIGN_OUT_OF_CHROME_TEXT); - if (signOutOfChromeTextPref != null) { - getPreferenceScreen().removePreference(signOutOfChromeTextPref); - } - } - private SpannableString buildGoogleSearchHistoryText() { return SpanApplier.applySpans(getContext().getString(R.string.clear_search_history_link), new SpanInfo("<link1>", "</link1>", @@ -224,14 +192,6 @@ createOpenMyActivityCallback(/* openSearchHistory = */ false)))); } - @VisibleForTesting - SpannableString buildSignOutOfChromeText() { - return SpanApplier.applySpans(getContext().getString(R.string.sign_out_of_chrome_link), - new SpanInfo("<link1>", "</link1>", - new NoUnderlineClickableSpan( - requireContext(), createSignOutOfChromeCallback()))); - } - /** If openSearchHistory is true, opens the search history page; otherwise: top level. */ private Callback<View> createOpenMyActivityCallback(boolean openSearchHistory) { return (widget) -> { @@ -263,13 +223,6 @@ }; } - private Callback<View> createSignOutOfChromeCallback() { - return view - -> SignOutDialogCoordinator.show(requireContext(), - ((ModalDialogManagerHolder) getActivity()).getModalDialogManager(), this, - ActionType.CLEAR_PRIMARY_ACCOUNT, GAIAServiceType.GAIA_SERVICE_TYPE_NONE); - } - private boolean isHistorySyncEnabled() { SyncService syncService = SyncService.get(); return syncService != null && syncService.isSyncRequested() @@ -294,43 +247,4 @@ ClearBrowsingDataTab.BASIC, ClearBrowsingDataTab.NUM_TYPES); RecordUserAction.record("ClearBrowsingData_BasicTab"); } - - /** {@link SignOutDialogCoordinator.Listener} implementation */ - @Override - public void onSignOutClicked(boolean forceWipeUserData) { - // In case the user is not signed in, we guard the sign out so we do not hit a native crash. - if (!IdentityServicesProvider.get() - .getIdentityManager(Profile.getLastUsedRegularProfile()) - .hasPrimaryAccount(ConsentLevel.SIGNIN)) { - return; - } - final SigninManager signinManager = IdentityServicesProvider.get().getSigninManager( - Profile.getLastUsedRegularProfile()); - signinManager.runAfterOperationInProgress(() -> { - // In case supervised users reach this flow, remove the preference and guard against - // signing out. - if (!signinManager.isSignOutAllowed()) { - deleteSignOutOfChromeTextIfExists(); - return; - } - final DialogFragment clearDataProgressDialog = new ClearDataProgressDialog(); - signinManager.signOut(SignoutReason.USER_CLICKED_SIGNOUT_FROM_CLEAR_BROWSING_DATA_PAGE, - new SigninManager.SignOutCallback() { - @Override - public void preWipeData() { - clearDataProgressDialog.show( - getChildFragmentManager(), CLEAR_DATA_PROGRESS_DIALOG_TAG); - } - - @Override - public void signOutComplete() { - clearDataProgressDialog.dismissAllowingStateLoss(); - } - }, - forceWipeUserData); - // TODO(https://crbug.com/1334918): Observe SignInStateObserver and move this inside - // onSignOutAllowedChanged(). - deleteSignOutOfChromeTextIfExists(); - }); - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java index 3793df6..31e74e6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java
@@ -5,26 +5,17 @@ package org.chromium.chrome.browser.browsing_data; import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.matcher.RootMatchers.isDialog; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import android.text.Spanned; -import android.text.style.ClickableSpan; import android.view.View; -import android.widget.TextView; import androidx.annotation.Nullable; -import androidx.test.espresso.NoMatchingViewException; -import androidx.test.espresso.UiController; -import androidx.test.espresso.ViewAction; import androidx.test.filters.LargeTest; -import org.hamcrest.Matcher; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -38,14 +29,11 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.Feature; -import org.chromium.base.test.util.Matchers; import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; -import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; -import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; import org.chromium.chrome.browser.sync.SyncService; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; @@ -54,7 +42,6 @@ import org.chromium.chrome.test.util.browser.signin.SigninTestRule; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.components.search_engines.TemplateUrlService; -import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.sync.ModelType; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -160,31 +147,6 @@ @Test @LargeTest - public void testSigningOut() { - mSigninTestRule.addTestAccountThenSigninAndEnableSync(); - setSyncable(true); - mSettingsActivityTestRule.startSettingsActivity(); - waitForOptionsMenu(); - - final ClearBrowsingDataFragmentBasic clearBrowsingDataFragmentBasic = - mSettingsActivityTestRule.getFragment(); - onView(withText(clearBrowsingDataFragmentBasic.buildSignOutOfChromeText().toString())) - .perform(clickOnSignOutLink()); - onView(withText(R.string.continue_button)).inRoot(isDialog()).perform(click()); - CriteriaHelper.pollUiThread( - () - -> !IdentityServicesProvider.get() - .getIdentityManager(Profile.getLastUsedRegularProfile()) - .hasPrimaryAccount(ConsentLevel.SIGNIN), - "Account should be signed out!"); - - // Footer should be hidden after sign-out. - onView(withText(clearBrowsingDataFragmentBasic.buildSignOutOfChromeText().toString())) - .check(doesNotExist()); - } - - @Test - @LargeTest @Feature({"RenderTest"}) public void testRenderSignedInAndSyncing() throws IOException { mSigninTestRule.addTestAccountThenSigninAndEnableSync(); @@ -290,34 +252,4 @@ .getRootView(); mRenderTestRule.render(view, "clear_browsing_data_basic_shl_unknown_signed_out"); } - - // TODO(https://crbug.com/1334586): Move this to a test util class. - private ViewAction clickOnSignOutLink() { - return new ViewAction() { - @Override - public Matcher<View> getConstraints() { - return Matchers.instanceOf(TextView.class); - } - - @Override - public String getDescription() { - return "Clicks on the sign out link in the clear browsing data footer"; - } - - @Override - public void perform(UiController uiController, View view) { - TextView textView = (TextView) view; - Spanned spannedString = (Spanned) textView.getText(); - ClickableSpan[] spans = - spannedString.getSpans(0, spannedString.length(), ClickableSpan.class); - if (spans.length != 1) { - throw new NoMatchingViewException.Builder() - .includeViewHierarchy(true) - .withRootView(textView) - .build(); - } - spans[0].onClick(view); - } - }; - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java index 59df6ab..d2c3bc0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java
@@ -4,6 +4,12 @@ package org.chromium.chrome.browser.browsing_data; +import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; +import static androidx.test.espresso.matcher.RootMatchers.isDialog; +import static androidx.test.espresso.matcher.ViewMatchers.withText; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; @@ -15,9 +21,13 @@ import android.os.Build; import android.support.test.InstrumentationRegistry; +import android.text.Spanned; +import android.text.style.ClickableSpan; +import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.Spinner; +import android.widget.TextView; import androidx.appcompat.app.AlertDialog; import androidx.collection.ArraySet; @@ -26,12 +36,16 @@ import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import androidx.recyclerview.widget.RecyclerView; +import androidx.test.espresso.NoMatchingViewException; +import androidx.test.espresso.UiController; +import androidx.test.espresso.ViewAction; import androidx.test.filters.LargeTest; import androidx.test.filters.MediumTest; import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.tabs.TabLayout; +import org.hamcrest.Matcher; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Before; @@ -50,14 +64,19 @@ import org.chromium.base.test.util.JniMocker; import org.chromium.chrome.R; import org.chromium.chrome.browser.browsing_data.ClearBrowsingDataFragment.DialogOption; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.notifications.channels.SiteChannelsManager; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; +import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.browser.Features.EnableFeatures; import org.chromium.chrome.test.util.browser.signin.SigninTestRule; import org.chromium.components.browser_ui.settings.SpinnerPreference; +import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.content_public.browser.test.util.TestThreadUtils; import java.util.Arrays; @@ -68,6 +87,7 @@ */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +@EnableFeatures({ChromeFeatureList.ENABLE_CBD_SIGN_OUT}) @Batch(Batch.PER_CLASS) public class ClearBrowsingDataFragmentTest { @Rule @@ -151,6 +171,38 @@ return settingsActivity; } + @Test + @LargeTest + public void testSigningOut() { + mSigninTestRule.addTestAccountThenSigninAndEnableSync(); + mSettingsActivityTestRule.startSettingsActivity(); + CriteriaHelper.pollUiThread(() -> { + return mSettingsActivityTestRule.getActivity().findViewById(R.id.menu_id_general_help) + != null; + }); + + final ClearBrowsingDataFragment clearBrowsingDataFragment = + mSettingsActivityTestRule.getFragment(); + TestThreadUtils.runOnUiThreadBlocking(() -> { + RecyclerView recyclerView = + clearBrowsingDataFragment.getView().findViewById(R.id.recycler_view); + recyclerView.scrollToPosition(recyclerView.getAdapter().getItemCount() - 1); + }); + onView(withText(clearBrowsingDataFragment.buildSignOutOfChromeText().toString())) + .perform(clickOnSignOutLink()); + onView(withText(R.string.continue_button)).inRoot(isDialog()).perform(click()); + CriteriaHelper.pollUiThread( + () + -> !IdentityServicesProvider.get() + .getIdentityManager(Profile.getLastUsedRegularProfile()) + .hasPrimaryAccount(ConsentLevel.SIGNIN), + "Account should be signed out!"); + + // Footer should be hidden after sign-out. + onView(withText(clearBrowsingDataFragment.buildSignOutOfChromeText().toString())) + .check(doesNotExist()); + } + /** * Test that Clear Browsing Data offers two tabs and records a preference when switched. */ @@ -597,4 +649,34 @@ } }); } + + // TODO(https://crbug.com/1334586): Move this to a test util class. + private ViewAction clickOnSignOutLink() { + return new ViewAction() { + @Override + public Matcher<View> getConstraints() { + return Matchers.instanceOf(TextView.class); + } + + @Override + public String getDescription() { + return "Clicks on the sign out link in the clear browsing data footer"; + } + + @Override + public void perform(UiController uiController, View view) { + TextView textView = (TextView) view; + Spanned spannedString = (Spanned) textView.getText(); + ClickableSpan[] spans = + spannedString.getSpans(0, spannedString.length(), ClickableSpan.class); + if (spans.length != 1) { + throw new NoMatchingViewException.Builder() + .includeViewHierarchy(true) + .withRootView(textView) + .build(); + } + spans[0].onClick(view); + } + }; + } }
diff --git a/chrome/app/resources/generated_resources_af.xtb b/chrome/app/resources/generated_resources_af.xtb index 5a109c0..c7dd626 100644 --- a/chrome/app/resources/generated_resources_af.xtb +++ b/chrome/app/resources/generated_resources_af.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Raak met jou vinger aan die vingerafdruksensor</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> word tans geskandeer.</translation> <translation id="3615596877979647433">Sleutel word vermis. Druk ’n sleutelbordsleutel om te pasmaak</translation> +<translation id="3616113530831147358">Oudio</translation> <translation id="3616741288025931835">Vee blaaidata uit …</translation> <translation id="3617891479562106823">Agtergronde is nie beskikbaar nie. Probeer later weer.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_am.xtb b/chrome/app/resources/generated_resources_am.xtb index 0f08d069..1e51ebc3 100644 --- a/chrome/app/resources/generated_resources_am.xtb +++ b/chrome/app/resources/generated_resources_am.xtb
@@ -2766,6 +2766,7 @@ <translation id="3615073365085224194">የጣት አሻራ ዳሳሹን በእርስዎ ጣት ይንኩት</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> እየተቃኘ ነው።</translation> <translation id="3615596877979647433">ቁልፍ ይጎድሏል። ለማበጀት የቁልፍ ሰሌዳን ይጫኑ</translation> +<translation id="3616113530831147358">ድምጽ</translation> <translation id="3616741288025931835">&የአሰሳ ውሂብ አጽዳ…</translation> <translation id="3617891479562106823">ዳራዎች አይገኙም። ቆይተው እንደገና ይሞክሩ።</translation> <translation id="3619115746895587757">ካፑቺኖ</translation>
diff --git a/chrome/app/resources/generated_resources_ar.xtb b/chrome/app/resources/generated_resources_ar.xtb index 1102f0d..a59fe35 100644 --- a/chrome/app/resources/generated_resources_ar.xtb +++ b/chrome/app/resources/generated_resources_ar.xtb
@@ -2762,6 +2762,7 @@ <translation id="3615073365085224194">يُرجى لمس مستشعر بصمات الإصبع بإصبعك.</translation> <translation id="3615579745882581859">يتم الآن فحص <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">لم يتم تخصيص مفتاح. اضغط على مفتاح في لوحة المفاتيح لتخصيصه.</translation> +<translation id="3616113530831147358">المقاطع الصوتية</translation> <translation id="3616741288025931835">&محو بيانات التصفح...</translation> <translation id="3617891479562106823">الخلفيات غير متاحة. يُرجى إعادة المحاولة لاحقًا.</translation> <translation id="3619115746895587757">كابتشينو</translation>
diff --git a/chrome/app/resources/generated_resources_as.xtb b/chrome/app/resources/generated_resources_as.xtb index a005ba1..5a8c0dd5 100644 --- a/chrome/app/resources/generated_resources_as.xtb +++ b/chrome/app/resources/generated_resources_as.xtb
@@ -2769,6 +2769,7 @@ <translation id="3615073365085224194">আপোনাৰ আঙুলিৰে ফিংগাৰপ্ৰিণ্ট ছেন্সৰটো স্পৰ্শ কৰক</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> স্কেন কৰি থকা হৈছে।</translation> <translation id="3615596877979647433">কী নাই। কাষ্টমাইজ কৰিবলৈ কীব’ৰ্ডৰ এটা কী টিপক</translation> +<translation id="3616113530831147358">অডিঅ’</translation> <translation id="3616741288025931835">&ব্ৰাউজিং ডেটা মচক...</translation> <translation id="3617891479562106823">নেপথ্য উপলব্ধ নহয়। পিছত পুনৰ চেষ্টা কৰক।</translation> <translation id="3619115746895587757">কেপ’চিনো</translation>
diff --git a/chrome/app/resources/generated_resources_az.xtb b/chrome/app/resources/generated_resources_az.xtb index 1773186..a764b4a 100644 --- a/chrome/app/resources/generated_resources_az.xtb +++ b/chrome/app/resources/generated_resources_az.xtb
@@ -2755,6 +2755,7 @@ <translation id="3615073365085224194">Barmağınızla barmaq izi sensoruna toxunun</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> skan edildi.</translation> <translation id="3615596877979647433">Düymə yoxdur. Fərdiləşdirmək üçün klaviatura düyməsini basın</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Brauzinq tarixçəsini təmizləyin...</translation> <translation id="3617891479562106823">Arxa fonlar əlçatan deyil. Sonra yenidən cəhd edin.</translation> <translation id="3619115746895587757">Kappuçino</translation>
diff --git a/chrome/app/resources/generated_resources_be.xtb b/chrome/app/resources/generated_resources_be.xtb index e0fc664..e5f47b8d 100644 --- a/chrome/app/resources/generated_resources_be.xtb +++ b/chrome/app/resources/generated_resources_be.xtb
@@ -2759,6 +2759,7 @@ <translation id="3615073365085224194">Дакраніцеся пальцам да сканера адбіткаў пальцаў</translation> <translation id="3615579745882581859">Выконваецца праверка файла "<ph name="FILE_NAME" />".</translation> <translation id="3615596877979647433">Клавіша не ўказана. Націсніце клавішу на клавіятуры, каб выканаць наладжванне.</translation> +<translation id="3616113530831147358">Аўдыя</translation> <translation id="3616741288025931835">&Выдаліць гісторыю праглядаў...</translation> <translation id="3617891479562106823">Змяненне фону недаступнае. Паўтарыце спробу пазней.</translation> <translation id="3619115746895587757">Капучына</translation>
diff --git a/chrome/app/resources/generated_resources_bg.xtb b/chrome/app/resources/generated_resources_bg.xtb index 97f1007a..fe88009 100644 --- a/chrome/app/resources/generated_resources_bg.xtb +++ b/chrome/app/resources/generated_resources_bg.xtb
@@ -2768,6 +2768,7 @@ <translation id="3615073365085224194">Докоснете сензора за отпечатъци с пръста си</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> се сканира.</translation> <translation id="3615596877979647433">Липсва клавиш. Натиснете клавиш от клавиатурата, за да персонализирате</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">&Изчистване на данните за сърфирането...</translation> <translation id="3617891479562106823">Фоновете не са налице. Опитайте отново по-късно.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_bn.xtb b/chrome/app/resources/generated_resources_bn.xtb index 496622c..c182a8a 100644 --- a/chrome/app/resources/generated_resources_bn.xtb +++ b/chrome/app/resources/generated_resources_bn.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">আঙ্গুলের ছাপের সেন্সরটিকে আপনার আঙ্গুল দিয়ে টাচ করুন</translation> <translation id="3615579745882581859">এই <ph name="FILE_NAME" /> স্ক্যান করা হচ্ছে।</translation> <translation id="3615596877979647433">কোনও 'কী' নেই কাস্টমাইজ করতে, কীবোর্ডের কোনও 'কী' প্রেস করুন</translation> +<translation id="3616113530831147358">অডিও</translation> <translation id="3616741288025931835">ব্রাউজ করা ডেটা সাফ করুন...</translation> <translation id="3617891479562106823">ব্যাকগ্রাউন্ডগুলি উপলভ্য নয়। পরে আবার চেষ্টা করুন।</translation> <translation id="3619115746895587757">ক্যাপুচিনো</translation>
diff --git a/chrome/app/resources/generated_resources_bs.xtb b/chrome/app/resources/generated_resources_bs.xtb index d018910..eb346ed 100644 --- a/chrome/app/resources/generated_resources_bs.xtb +++ b/chrome/app/resources/generated_resources_bs.xtb
@@ -2770,6 +2770,7 @@ <translation id="3615073365085224194">Prstom dodirnite senzor za otisak prsta</translation> <translation id="3615579745882581859">Fajl <ph name="FILE_NAME" /> se skenira.</translation> <translation id="3615596877979647433">Nedostaje tipka. Pritisnite tipku tastature da je prilagodite</translation> +<translation id="3616113530831147358">Zvuk</translation> <translation id="3616741288025931835">&Obriši podatke pregledanja...</translation> <translation id="3617891479562106823">Pozadine nisu dostupne. Pokušajte ponovo kasnije.</translation> <translation id="3619115746895587757">Kapućino</translation>
diff --git a/chrome/app/resources/generated_resources_ca.xtb b/chrome/app/resources/generated_resources_ca.xtb index a95a753..587df28 100644 --- a/chrome/app/resources/generated_resources_ca.xtb +++ b/chrome/app/resources/generated_resources_ca.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">Toca el sensor d'empremtes digitals amb el dit</translation> <translation id="3615579745882581859">S'està analitzant <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Falta la tecla. Prem una tecla del teclat per personalitzar-la.</translation> +<translation id="3616113530831147358">Àudio</translation> <translation id="3616741288025931835">&Elimina les dades de navegació...</translation> <translation id="3617891479562106823">Els fons de pantalla no estan disponibles. Torna-ho a provar més tard.</translation> <translation id="3619115746895587757">Caputxino</translation>
diff --git a/chrome/app/resources/generated_resources_cs.xtb b/chrome/app/resources/generated_resources_cs.xtb index 1e87ee9..f501d07 100644 --- a/chrome/app/resources/generated_resources_cs.xtb +++ b/chrome/app/resources/generated_resources_cs.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">Dotkněte se prstem snímače otisků prstů</translation> <translation id="3615579745882581859">Probíhá kontrola souboru <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Klávesa chybí. Stisknutím klávesy přizpůsobíte</translation> +<translation id="3616113530831147358">Zvuk</translation> <translation id="3616741288025931835">&Smazat údaje o prohlížení...</translation> <translation id="3617891479562106823">Pozadí nejsou k dispozici. Zkuste to znovu později.</translation> <translation id="3619115746895587757">Kapučíno</translation>
diff --git a/chrome/app/resources/generated_resources_cy.xtb b/chrome/app/resources/generated_resources_cy.xtb index d1bfc1c..242a9ac0 100644 --- a/chrome/app/resources/generated_resources_cy.xtb +++ b/chrome/app/resources/generated_resources_cy.xtb
@@ -2775,6 +2775,7 @@ <translation id="3615073365085224194">Cyffyrddwch y synhwyrydd olion bysell gyda'ch bys</translation> <translation id="3615579745882581859">Mae <ph name="FILE_NAME" /> wrthi'n cael ei sganio.</translation> <translation id="3615596877979647433">Mae'r fysell ar goll. Pwyswch fysell bysellfwrdd i bersonoleiddio</translation> +<translation id="3616113530831147358">Sain</translation> <translation id="3616741288025931835">&Clirio Data Pori…</translation> <translation id="3617891479562106823">Nid yw cefndiroedd ar gael. Rhowch gynnig arall arni'n nes ymlaen.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_da.xtb b/chrome/app/resources/generated_resources_da.xtb index 5b7f06d2..aaf0c9a 100644 --- a/chrome/app/resources/generated_resources_da.xtb +++ b/chrome/app/resources/generated_resources_da.xtb
@@ -2773,6 +2773,7 @@ <translation id="3615073365085224194">Tryk på fingeraftrykslæseren med din finger</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> scannes.</translation> <translation id="3615596877979647433">Du mangler at angive en tast. Tryk på en tastaturtast for at tilpasse den</translation> +<translation id="3616113530831147358">Lyd</translation> <translation id="3616741288025931835">&Slet browserdata...</translation> <translation id="3617891479562106823">Baggrunde er utilgængelige. Prøv igen senere.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_de.xtb b/chrome/app/resources/generated_resources_de.xtb index 95b8cbd8..8b305178 100644 --- a/chrome/app/resources/generated_resources_de.xtb +++ b/chrome/app/resources/generated_resources_de.xtb
@@ -2754,6 +2754,7 @@ <translation id="3615073365085224194">Berühre den Fingerabdrucksensor mit dem Finger</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> wird gegenwärtig gescannt</translation> <translation id="3615596877979647433">Keine Taste zugewiesen. Drücke zum Anpassen eine Taste auf der Tastatur.</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Browserdaten löschen...</translation> <translation id="3617891479562106823">Hintergründe sind nicht verfügbar. Bitte versuche es später noch einmal.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_el.xtb b/chrome/app/resources/generated_resources_el.xtb index 1591e7b..4f0c2ea 100644 --- a/chrome/app/resources/generated_resources_el.xtb +++ b/chrome/app/resources/generated_resources_el.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Αγγίξτε τον αισθητήρα δακτυλικών αποτυπωμάτων με το δάχτυλό σας</translation> <translation id="3615579745882581859">Πραγματοποιείται σάρωση του αρχείου <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Το πλήκτρο λείπει. Πατήστε ένα πλήκτρο του πληκτρολογίου για προσαρμογή.</translation> +<translation id="3616113530831147358">Ήχος</translation> <translation id="3616741288025931835">&Διαγραφή δεδομένων περιήγησης...</translation> <translation id="3617891479562106823">Τα φόντα δεν είναι διαθέσιμα. Δοκιμάστε ξανά αργότερα.</translation> <translation id="3619115746895587757">Καπουτσίνο</translation>
diff --git a/chrome/app/resources/generated_resources_en-GB.xtb b/chrome/app/resources/generated_resources_en-GB.xtb index 0d92eb5..dbef1cb 100644 --- a/chrome/app/resources/generated_resources_en-GB.xtb +++ b/chrome/app/resources/generated_resources_en-GB.xtb
@@ -2777,6 +2777,7 @@ <translation id="3615073365085224194">Touch the fingerprint sensor with your finger</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> is being scanned.</translation> <translation id="3615596877979647433">Key is missing. Press a keyboard key to customise</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Clear Browsing Data...</translation> <translation id="3617891479562106823">Backgrounds are unavailable. Try again later.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_es-419.xtb b/chrome/app/resources/generated_resources_es-419.xtb index c38eb81a..e5feba4 100644 --- a/chrome/app/resources/generated_resources_es-419.xtb +++ b/chrome/app/resources/generated_resources_es-419.xtb
@@ -2754,6 +2754,7 @@ <translation id="3615073365085224194">Toca el sensor de huellas dactilares con el dedo</translation> <translation id="3615579745882581859">Se está analizando <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">La tecla no está configurada. Presiona una tecla del teclado para personalizarla</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">Eliminar datos de navega&ción...</translation> <translation id="3617891479562106823">Los fondos no están disponibles. Vuelve a intentarlo más tarde.</translation> <translation id="3619115746895587757">Capuchino</translation>
diff --git a/chrome/app/resources/generated_resources_es.xtb b/chrome/app/resources/generated_resources_es.xtb index 09a7dd8..9b19e2c 100644 --- a/chrome/app/resources/generated_resources_es.xtb +++ b/chrome/app/resources/generated_resources_es.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">Toca el sensor de huellas digitales con el dedo</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> se está analizando.</translation> <translation id="3615596877979647433">Falta la tecla. Pulsa una tecla del teclado para personalizarla.</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Borrar datos de navegación...</translation> <translation id="3617891479562106823">Los fondos no están disponibles. Inténtalo de nuevo más tarde.</translation> <translation id="3619115746895587757">Capuchino</translation>
diff --git a/chrome/app/resources/generated_resources_et.xtb b/chrome/app/resources/generated_resources_et.xtb index 759dac29..5580764 100644 --- a/chrome/app/resources/generated_resources_et.xtb +++ b/chrome/app/resources/generated_resources_et.xtb
@@ -2763,6 +2763,7 @@ <translation id="3615073365085224194">Puudutage oma sõrmega sõrmejäljeandurit</translation> <translation id="3615579745882581859">Faili <ph name="FILE_NAME" /> skannitakse.</translation> <translation id="3615596877979647433">Klahv on puudu. Kohandamiseks vajutage klaviatuuri klahvi.</translation> +<translation id="3616113530831147358">Heli</translation> <translation id="3616741288025931835">Kustuta sirvi&mise andmed...</translation> <translation id="3617891479562106823">Taustad pole saadaval. Proovige hiljem uuesti</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_eu.xtb b/chrome/app/resources/generated_resources_eu.xtb index addd108..2b3e684 100644 --- a/chrome/app/resources/generated_resources_eu.xtb +++ b/chrome/app/resources/generated_resources_eu.xtb
@@ -2756,6 +2756,7 @@ <translation id="3615073365085224194">Ukitu hatz-marken sentsorea hatzarekin</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> aztertzen ari gara.</translation> <translation id="3615596877979647433">Tekla falta da. Sakatu teklatuko tekla bat fokuratuta dagoena pertsonalizatzeko</translation> +<translation id="3616113530831147358">Audioa</translation> <translation id="3616741288025931835">&Garbitu arakatze-datuak...</translation> <translation id="3617891479562106823">Atzeko planoak ez daude erabilgarri. Saiatu berriro geroago.</translation> <translation id="3619115746895587757">Kaputxinoa</translation>
diff --git a/chrome/app/resources/generated_resources_fa.xtb b/chrome/app/resources/generated_resources_fa.xtb index bcc1808..0ae9bb5 100644 --- a/chrome/app/resources/generated_resources_fa.xtb +++ b/chrome/app/resources/generated_resources_fa.xtb
@@ -2769,6 +2769,7 @@ <translation id="3615073365085224194">حسگر اثر انگشت را با انگشتانتان لمس کنید</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> درحال اسکن است.</translation> <translation id="3615596877979647433">کلید وجود ندارد. برای سفارشی کردن، یکی از کلیدهای صفحهکلید را فشار دهید</translation> +<translation id="3616113530831147358">صوتی</translation> <translation id="3616741288025931835">&پاک کردن دادههای مرور...</translation> <translation id="3617891479562106823">پسزمینهها دردسترس نیست. بعداً دوباره امتحان کنید.</translation> <translation id="3619115746895587757">کاپوچینو</translation>
diff --git a/chrome/app/resources/generated_resources_fi.xtb b/chrome/app/resources/generated_resources_fi.xtb index 679a3be5..71d73d0 100644 --- a/chrome/app/resources/generated_resources_fi.xtb +++ b/chrome/app/resources/generated_resources_fi.xtb
@@ -2771,6 +2771,7 @@ <translation id="3615073365085224194">Kosketa sormenjälkitunnistinta sormellasi.</translation> <translation id="3615579745882581859">Skannataan: <ph name="FILE_NAME" /></translation> <translation id="3615596877979647433">Näppäin puuttuu. Yksilöi painamalla näppäimistön näppäintä</translation> +<translation id="3616113530831147358">Ääni</translation> <translation id="3616741288025931835">&Poista selaustiedot...</translation> <translation id="3617891479562106823">Taustat eivät ole käytettävissä. Yritä myöhemmin uudelleen.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_fil.xtb b/chrome/app/resources/generated_resources_fil.xtb index 821c630..324afacb 100644 --- a/chrome/app/resources/generated_resources_fil.xtb +++ b/chrome/app/resources/generated_resources_fil.xtb
@@ -2773,6 +2773,7 @@ <translation id="3615073365085224194">Pindutin ang sensor para sa fingerprint gamit ang iyong daliri</translation> <translation id="3615579745882581859">Sina-scan ang <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Nawawala ang key. Pumindot ng key sa keyboard para mag-customize</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&I-clear ang Data sa Pag-browse...</translation> <translation id="3617891479562106823">Hindi available ang mga background. Subukang muli sa ibang pagkakataon.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_fr-CA.xtb b/chrome/app/resources/generated_resources_fr-CA.xtb index 53d0d8d..ceb62df 100644 --- a/chrome/app/resources/generated_resources_fr-CA.xtb +++ b/chrome/app/resources/generated_resources_fr-CA.xtb
@@ -2759,6 +2759,7 @@ <translation id="3615073365085224194">Touchez le capteur d'empreintes digitales avec votre doigt</translation> <translation id="3615579745882581859">Le fichier <ph name="FILE_NAME" /> est en train d'être analysé.</translation> <translation id="3615596877979647433">La clé est manquante. Appuyez sur une touche du clavier pour la personnaliser</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">Effa&cer les données de navigation…</translation> <translation id="3617891479562106823">Les arrière-plans ne sont pas disponibles. Réessayez plus tard.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_fr.xtb b/chrome/app/resources/generated_resources_fr.xtb index ea83c39a..fe7c012 100644 --- a/chrome/app/resources/generated_resources_fr.xtb +++ b/chrome/app/resources/generated_resources_fr.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">Appuyez avec un doigt sur le lecteur d'empreinte digitale</translation> <translation id="3615579745882581859">Analyse de <ph name="FILE_NAME" />…</translation> <translation id="3615596877979647433">Touche manquante. Appuyez sur une touche du clavier pour la personnaliser</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Effacer les données de navigation...</translation> <translation id="3617891479562106823">Les arrière-plans sont indisponibles. Réessayez plus tard.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_gl.xtb b/chrome/app/resources/generated_resources_gl.xtb index c8efda7..13e45376 100644 --- a/chrome/app/resources/generated_resources_gl.xtb +++ b/chrome/app/resources/generated_resources_gl.xtb
@@ -2755,6 +2755,7 @@ <translation id="3615073365085224194">Toca o sensor de impresión dixital co dedo</translation> <translation id="3615579745882581859">Estase analizando <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Falta a tecla. Preme unha tecla para personalizala</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Borrar datos de navegación...</translation> <translation id="3617891479562106823">Os fondos non están dispoñibles. Téntao de novo máis tarde.</translation> <translation id="3619115746895587757">Capuchino</translation>
diff --git a/chrome/app/resources/generated_resources_gu.xtb b/chrome/app/resources/generated_resources_gu.xtb index 6b61a01..d68cd67 100644 --- a/chrome/app/resources/generated_resources_gu.xtb +++ b/chrome/app/resources/generated_resources_gu.xtb
@@ -2755,6 +2755,7 @@ <translation id="3615073365085224194">તમારી આંગળી વડે ફિંગરપ્રિન્ટ સેન્સરને સ્પર્શ કરો</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" />ને સ્કૅન કરવામાં આવી રહી છે.</translation> <translation id="3615596877979647433">કી ખૂટે છે. કસ્ટમાઇઝ કરવા માટે કીબોર્ડની કી દબાવો</translation> +<translation id="3616113530831147358">ઑડિઓ</translation> <translation id="3616741288025931835">બ્રાઉઝિંગ ડેટા &સાફ કરો...</translation> <translation id="3617891479562106823">બૅકગ્રાઉન્ડ અનુપલબ્ધ છે. થોડા સમય પછી ફરી પ્રયાસ કરો.</translation> <translation id="3619115746895587757">કૅપુચિનો</translation>
diff --git a/chrome/app/resources/generated_resources_hi.xtb b/chrome/app/resources/generated_resources_hi.xtb index 5e62b52..48442e3 100644 --- a/chrome/app/resources/generated_resources_hi.xtb +++ b/chrome/app/resources/generated_resources_hi.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">उंगली से फ़िंगरप्रिंट सेंसर को छुएं</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> स्कैन हो रही है.</translation> <translation id="3615596877979647433">किसी कुंजी को नहीं दबाया गया. पसंद के मुताबिक बनाने के लिए, कीबोर्ड की कुंजी को दबाएं</translation> +<translation id="3616113530831147358">ऑडियो</translation> <translation id="3616741288025931835">ब्राउज़िंग डेटा &साफ़ करें...</translation> <translation id="3617891479562106823">बैकग्राउंड उपलब्ध नहीं हैं. बाद में फिर से कोशिश करें.</translation> <translation id="3619115746895587757">कैपुचिनो</translation>
diff --git a/chrome/app/resources/generated_resources_hr.xtb b/chrome/app/resources/generated_resources_hr.xtb index 9402658..a04321e8 100644 --- a/chrome/app/resources/generated_resources_hr.xtb +++ b/chrome/app/resources/generated_resources_hr.xtb
@@ -2760,6 +2760,7 @@ <translation id="3615073365085224194">Prislonite prst na senzor otiska prsta</translation> <translation id="3615579745882581859">U tijeku je pregled datoteke <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Nedostaje tipka. Pritisnite tipku na tipkovnici da biste je prilagodili</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Obriši podatke o pregledavanju...</translation> <translation id="3617891479562106823">Pozadine nisu dostupne. Pokušajte ponovo kasnije.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_hu.xtb b/chrome/app/resources/generated_resources_hu.xtb index e2842eb..6553b2b 100644 --- a/chrome/app/resources/generated_resources_hu.xtb +++ b/chrome/app/resources/generated_resources_hu.xtb
@@ -2770,6 +2770,7 @@ <translation id="3615073365085224194">Érintse ujját az ujjlenyomat-érzékelőhöz</translation> <translation id="3615579745882581859">Folyamatban van a(z) <ph name="FILE_NAME" /> ellenőrzése.</translation> <translation id="3615596877979647433">Hiányzó gomb. Nyomja le a személyre szabni kívánt billentyűt.</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Böngészés adatainak törlése...</translation> <translation id="3617891479562106823">A hátterek nem állnak rendelkezésre. Próbálja újra később.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_hy.xtb b/chrome/app/resources/generated_resources_hy.xtb index aec920f1..d255126 100644 --- a/chrome/app/resources/generated_resources_hy.xtb +++ b/chrome/app/resources/generated_resources_hy.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">Մատով հպեք մատնահետքերի սկաներին</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ֆայլը սկանավորվում է։</translation> <translation id="3615596877979647433">Ստեղնը նշված չէ։ Սեղմեք այն՝ կարգավորելու համար։</translation> +<translation id="3616113530831147358">Աուդիո</translation> <translation id="3616741288025931835">&Մաքրել դիտարկումների տվյալները…</translation> <translation id="3617891479562106823">Ֆոնային պատկերները հասանելի չեն: Փորձեք ավելի ուշ:</translation> <translation id="3619115746895587757">Կապուչինո</translation>
diff --git a/chrome/app/resources/generated_resources_id.xtb b/chrome/app/resources/generated_resources_id.xtb index 1e93aca27..3d78fc3 100644 --- a/chrome/app/resources/generated_resources_id.xtb +++ b/chrome/app/resources/generated_resources_id.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Sentuh sensor sidik jari dengan jari Anda</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> sedang dipindai.</translation> <translation id="3615596877979647433">Tombol tidak ada. Tekan tombol keyboard untuk menyesuaikan</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Hapus Data browsing...</translation> <translation id="3617891479562106823">Background tidak tersedia. Coba lagi nanti.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_is.xtb b/chrome/app/resources/generated_resources_is.xtb index 49564ce1..55101db 100644 --- a/chrome/app/resources/generated_resources_is.xtb +++ b/chrome/app/resources/generated_resources_is.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Snertu fingrafaralesarann með fingrinum</translation> <translation id="3615579745882581859">Verið er að skanna <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Lykil vantar. Ýttu á lyklaborðslykil til að sérsníða</translation> +<translation id="3616113530831147358">Hljóð</translation> <translation id="3616741288025931835">Hreinsa vafragögn...</translation> <translation id="3617891479562106823">Bakgrunnar eru ekki tiltækir. Reyndu aftur síðar.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_it.xtb b/chrome/app/resources/generated_resources_it.xtb index f1a31482..f475a63 100644 --- a/chrome/app/resources/generated_resources_it.xtb +++ b/chrome/app/resources/generated_resources_it.xtb
@@ -784,7 +784,7 @@ <translation id="173628468822554835">Ok. Per impostazione predefinita, i nuovi siti che visiti non ti invieranno notifiche.</translation> <translation id="1736419249208073774">Esplora</translation> <translation id="1737968601308870607">Segnala bug</translation> -<translation id="1739684185846730053">Le prove di Privacy Sandbox sono ancora in fase di sviluppo attivo e sono disponibili soltanto in alcune aree geografiche. Per il momento i siti possono provare Privacy Sandbox continuando a usare le attuali tecnologie web quali i cookie di terze parti.</translation> +<translation id="1739684185846730053">Le prove di Privacy Sandbox sono ancora in fase di sviluppo attivo e sono disponibili soltanto in alcune regioni. Per il momento i siti possono provare Privacy Sandbox continuando a usare le attuali tecnologie web quali i cookie di terze parti.</translation> <translation id="1741190788710022490">Ricarica adattiva</translation> <translation id="174123615272205933">Personalizzati</translation> <translation id="1741314857973421784">Continua</translation> @@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">Tocca il sensore di impronte digitali con il dito</translation> <translation id="3615579745882581859">È in corso la scansione di <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Tasto mancante. Premi un tasto della tastiera per personalizzarlo</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Cancella dati di navigazione...</translation> <translation id="3617891479562106823">Gli sfondi non sono disponibili. Riprova più tardi.</translation> <translation id="3619115746895587757">Cappuccino</translation> @@ -5194,7 +5195,7 @@ <translation id="6027945736510816438">Intendevi <ph name="WEBSITE" />?</translation> <translation id="6028117231645531007">Aggiungi impronta</translation> <translation id="6031600495088157824">Opzioni di immissione nella barra degli strumenti</translation> -<translation id="6032091552407840792">Questa prova è attiva soltanto in <ph name="BEGIN_LINK" />alcune aree geografiche<ph name="END_LINK" />.</translation> +<translation id="6032091552407840792">Questa prova è attiva soltanto in <ph name="BEGIN_LINK" />alcune regioni<ph name="END_LINK" />.</translation> <translation id="6032715498678347852">Per consentire a un'estensione di accedere a questo sito, fai clic sull'estensione.</translation> <translation id="6032912588568283682">File system</translation> <translation id="603539183851330738">Pulsante per annullare la correzione automatica. Ripristina <ph name="TYPED_WORD" />. Premi Invio per attivare o Esc per ignorare.</translation> @@ -7080,7 +7081,7 @@ <translation id="7877451762676714207">Errore del server sconosciuto. Riprova o contatta l'amministratore del server.</translation> <translation id="7879631849810108578">Scorciatoia impostata: <ph name="IDS_SHORT_SET_COMMAND" /></translation> <translation id="7880685873361171388">Quando la funzionalità è attivata e lo stato è attivo, Chrome usa la tua cronologia di navigazione di 7 giorni per definire un gruppo, o "coorte", di cui fai parte. Gli inserzionisti possono selezionare annunci per il gruppo. La cronologia di navigazione rimane privata sul tuo dispositivo. Questa prova è attiva soltanto in - <ph name="BEGIN_LINK" />alcune aree geografiche<ph name="END_LINK" />.</translation> + <ph name="BEGIN_LINK" />alcune regioni<ph name="END_LINK" />.</translation> <translation id="7880823633812189969">I dati locali verranno eliminati al riavvio</translation> <translation id="7881066108824108340">DNS</translation> <translation id="7881483672146086348">Visualizza account</translation>
diff --git a/chrome/app/resources/generated_resources_iw.xtb b/chrome/app/resources/generated_resources_iw.xtb index 15f1204..478a4252 100644 --- a/chrome/app/resources/generated_resources_iw.xtb +++ b/chrome/app/resources/generated_resources_iw.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">יש לגעת עם האצבע בחיישן טביעת האצבע</translation> <translation id="3615579745882581859">מתבצעת סריקה בקובץ <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">המפתח חסר. יש להקיש על מקש מקלדת כלשהו כדי להתאים אישית</translation> +<translation id="3616113530831147358">אודיו</translation> <translation id="3616741288025931835">&ניקוי נתוני גלישה...</translation> <translation id="3617891479562106823">רקעים אינם זמינים. צריך לנסות שוב מאוחר יותר.</translation> <translation id="3619115746895587757">קפוצ'ינו</translation>
diff --git a/chrome/app/resources/generated_resources_ja.xtb b/chrome/app/resources/generated_resources_ja.xtb index 95ae85b6..855d1f04 100644 --- a/chrome/app/resources/generated_resources_ja.xtb +++ b/chrome/app/resources/generated_resources_ja.xtb
@@ -2750,6 +2750,7 @@ <translation id="3615073365085224194">指紋認証センサーを指でタッチしてください</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> をスキャンしています。</translation> <translation id="3615596877979647433">キーが設定されていません。カスタマイズするには、キーボードのキーを押してください</translation> +<translation id="3616113530831147358">音声</translation> <translation id="3616741288025931835">閲覧履歴を消去(&C)...</translation> <translation id="3617891479562106823">背景を利用できません。しばらくしてからもう一度お試しください。</translation> <translation id="3619115746895587757">カプチーノ</translation>
diff --git a/chrome/app/resources/generated_resources_ka.xtb b/chrome/app/resources/generated_resources_ka.xtb index d2f176ff..d6b140e 100644 --- a/chrome/app/resources/generated_resources_ka.xtb +++ b/chrome/app/resources/generated_resources_ka.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">შეეხეთ თითის ანაბეჭდის სენსორს თითით</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> სკანირდება.</translation> <translation id="3615596877979647433">აკლია კლავიში. მოსარგებად დააჭირეთ კლავიატურის კლავიშს.</translation> +<translation id="3616113530831147358">აუდიო</translation> <translation id="3616741288025931835">დათვალიერების მონაცემების &გასუფთავება…</translation> <translation id="3617891479562106823">ფონები მიუწვდომელია. ცადეთ მოგვიანებით.</translation> <translation id="3619115746895587757">კაპუჩინო</translation>
diff --git a/chrome/app/resources/generated_resources_kk.xtb b/chrome/app/resources/generated_resources_kk.xtb index 823e2830..fe22186 100644 --- a/chrome/app/resources/generated_resources_kk.xtb +++ b/chrome/app/resources/generated_resources_kk.xtb
@@ -2753,6 +2753,7 @@ <translation id="3615073365085224194">Саусақ ізін оқу сканерін саусағыңызбен түртіңіз.</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> сканерленуде.</translation> <translation id="3615596877979647433">Перне тағайындалмаған. Реттеу үшін пернетақта пернесін басыңыз.</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">&Шолу деректерін жою…</translation> <translation id="3617891479562106823">Фондар жоқ. Кейінірек қайталап көріңіз.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_km.xtb b/chrome/app/resources/generated_resources_km.xtb index 70338405..2a2cfd1 100644 --- a/chrome/app/resources/generated_resources_km.xtb +++ b/chrome/app/resources/generated_resources_km.xtb
@@ -382,6 +382,7 @@ <translation id="1374844444528092021">វិញ្ញាបនប័ត្រដែលបានតម្រូវដោយបណ្តាញ "<ph name="NETWORK_NAME" />" មិនត្រូវបានតំឡើង ឬមិនមានសុពលភាពទៀតទេ។ សូមទទួលយកវិញ្ញាបនប័ត្រថ្មី ហើយព្យាយាមភ្ជាប់ម្តងទៀត។</translation> <translation id="1375321115329958930">ពាក្យសម្ងាត់ដែលបានរក្សាទុក</translation> <translation id="1375557162880614858">តើអ្នកចង់បើកដំណើរការ ChromeVox ដែលជាកម្មវិធីអានអេក្រង់ភ្ជាប់មកជាមួយស្រាប់សម្រាប់ ChromeOS Flex ដែរទេ?</translation> +<translation id="1375938286942050085">បានបញ្ចប់ការរៀបចំហើយ! បន្ទាប់មក រៀបចំឧបករណ៍របស់អ្នកឱ្យរួចរាល់សម្រាប់ការលេងហ្គេម</translation> <translation id="137651782282853227">អាសយដ្ឋានដែលបានរក្សាទុកនឹងបង្ហាញនៅទីនេះ</translation> <translation id="1376771218494401509">ឈ្មោះ និងវិនដូ...</translation> <translation id="1377600615067678409">រំលងឥឡូវនេះ</translation> @@ -396,6 +397,7 @@ <translation id="138784436342154190">ស្តារទំព័រចាប់ផ្តើមលំនាំដើម?</translation> <translation id="1388253969141979417">អនុញ្ញាតឱ្យប្រើមីក្រូហ្វូនរបស់អ្នក</translation> <translation id="1388728792929436380"><ph name="DEVICE_TYPE" /> នឹងចាប់ផ្ដើមឡើងវិញ នៅពេលបញ្ចប់ការដំឡើងកំណែ។</translation> +<translation id="1389601498324964367">ទំហំផ្ទុកដែលគ្រប់គ្រងដោយកម្រិតកំណត់</translation> <translation id="139013308650923562">អនុញ្ញាតឱ្យប្រើពុម្ពអក្សរ ដែលបានដំឡើងនៅលើឧបករណ៍របស់អ្នក</translation> <translation id="1390548061267426325">បើកជាផ្ទាំងធម្មតា</translation> <translation id="1390907927270446471"><ph name="PROFILE_USERNAME" /> មិនទទួលបានសិទ្ធិក្នុងការបោះពុម្ពតាម <ph name="PRINTER_NAME" /> ទេ។ សូមទាក់ទងអ្នកគ្រប់គ្រងរបស់អ្នក។</translation> @@ -1075,6 +1077,7 @@ <translation id="1992924914582925289">លុបចេញពីឧបករណ៍</translation> <translation id="1994173015038366702">URL គេហទំព័រ</translation> <translation id="1995916364271252349">គ្រប់គ្រងថាតើព័ត៌មានអ្វីខ្លះដែលគេហទំព័រអាចប្រើ និងបង្ហាញ (ទីតាំង កាមេរ៉ា ផ្ទាំងលោតឡើង និងច្រើនទៀត)</translation> +<translation id="1997433994358798851">Chrome ត្រូវការការអនុញ្ញាតឱ្យប្រើប្រាស់ប៊្លូធូស ដើម្បីភ្ជាប់ទៅឧបករណ៍របស់អ្នក</translation> <translation id="1997616988432401742">វិញ្ញាបនបត្ររបស់អ្នក</translation> <translation id="1999115740519098545">នៅពេលចាប់ផ្តើមដំណើរការ</translation> <translation id="2000419248597011803">បញ្ជូនការស្វែងរក និងខូគីមួយចំនួនពីរបារអាសយដ្ឋាន និងប្រអប់ស្វែងរកទៅម៉ាស៊ីនស្វែងរកលំនាំដើមរបស់អ្នក</translation> @@ -1739,6 +1742,7 @@ <translation id="25899519884572181">ចាកចេញពីមុខងារអាន</translation> <translation id="2593499352046705383">មុនពេលចាប់ផ្ដើម សូមប្រាកដថា អ្នកមានការបម្រុងទុកទិន្នន័យរបស់អ្នក។ ការដំឡើង <ph name="DEVICE_OS" /> នឹងលុបពីលើថាសរឹងរបស់អ្នក។ ស្វែងយល់បន្ថែមតាមរយៈ g.co/flex/InstallGuide។</translation> <translation id="2594999711683503743">ស្វែងរកតាម Google ឬវាយបញ្ចូល URL</translation> +<translation id="2599048253926156421">បានចម្លងឈ្មោះអ្នកប្រើប្រាស់ទៅក្នុងឃ្លីបបត</translation> <translation id="2602501489742255173">អូសឡើងលើ ដើម្បីចាប់ផ្ដើម</translation> <translation id="2603115962224169880">សម្អាតកុំព្យូទ័រ</translation> <translation id="2603355571917519942">អាចប្រើមុខងារ Voice Match បានហើយ</translation> @@ -1962,6 +1966,7 @@ <translation id="2804043232879091219">មិនអាចបើកកម្មវិធីរុករកតាមអ៊ីនធឺណិតផ្សេងបានទេ</translation> <translation id="2804667941345577550">អ្នកនឹងត្រូវនាំចេញពីគេហទំព័រនេះ រួមទាំងនៅក្នុងផ្ទាំងបើកផងដែរ</translation> <translation id="2804680522274557040">បានបិទកាមេរ៉ា</translation> +<translation id="280518252911523675">ប្រសិនបើអ្នកបន្តដោយមិនបញ្ចូលពាក្យសម្ងាត់ចាស់របស់អ្នកទេ ទិន្នន័យមូលដ្ឋានរបស់អ្នកនឹងត្រូវបានលុប។ អ្នកនឹងចូលដោយប្រើគណនី Google របស់អ្នក ដើម្បីរៀបចំអ្នកប្រើប្រាស់ម្នាក់នេះម្ដងទៀត។</translation> <translation id="2805539617243680210">រួចរាល់អស់ហើយ!</translation> <translation id="2805646850212350655">ប្រព័ន្ធឯកសារអ៊ីនគ្រីប Microsoft</translation> <translation id="2805756323405976993">កម្មវិធី</translation> @@ -2772,6 +2777,7 @@ <translation id="3615073365085224194">ប៉ះឧបករណ៍ចាប់ស្នាមម្រាមដៃដោយប្រើម្រាមដៃរបស់អ្នក</translation> <translation id="3615579745882581859">កំពុងស្កេន <ph name="FILE_NAME" /> ។</translation> <translation id="3615596877979647433">បាត់គ្រាប់ចុចដែលចងភ្ជាប់។ ចុចគ្រាប់ចុចក្ដារចុច ដើម្បីប្ដូរតាមបំណង</translation> +<translation id="3616113530831147358">សម្លេង</translation> <translation id="3616741288025931835">ជម្រះទិន្នន័យរុករក...</translation> <translation id="3617891479562106823">មិនមានផ្ទៃខាងក្រោយទេ។ សូមព្យាយាមម្ដងទៀតនៅពេលក្រោយ។</translation> <translation id="3619115746895587757">កាពូឈីណូ</translation> @@ -3076,6 +3082,7 @@ <translation id="3895090224522145010">ឈ្មោះអ្នកប្រើប្រាស់ Kerberos</translation> <translation id="389521680295183045">គេហទំព័រអាចសួរដើម្បីដឹងថា នៅពេលណាដែលអ្នកកំពុងប្រើឧបករណ៍របស់អ្នកយ៉ាងសកម្ម</translation> <translation id="3897298432557662720">{COUNT,plural, =1{រូបភាពមួយ}other{រូបភាព #}}</translation> +<translation id="3897746662269329507"><ph name="DEVICE_TYPE" /> របស់អ្នកត្រូវបានបង្កើតឡើងសម្រាប់ការលេងហ្គេម។ បន្ទាប់មក កម្មវិធីរុករកនឹងបើក ហើយនៅលើនោះ អ្នកអាចចូលលេងហ្គេមថ្មីៗបំផុតរាប់រយ មើលការផ្ដល់ជូនសម្រាប់ការលេងហ្គេម និងស្វែងយល់អំពីមុខងារលេងហ្គេមដែលភ្ជាប់មកជាមួយឧបករណ៍របស់អ្នក។</translation> <translation id="3898233949376129212">ភាសារបស់ឧបករណ៍</translation> <translation id="3898327728850887246"><ph name="SITE_NAME" /> ចង់៖ <ph name="FIRST_PERMISSION" /> និង <ph name="SECOND_PERMISSION" /></translation> <translation id="389901847090970821">ជ្រើសរើសក្តារចុច</translation> @@ -3226,6 +3233,7 @@ <translation id="4033471457476425443">បន្ថែមថតថ្មី</translation> <translation id="4033711848170683365">ការលុបនេះនឹងលុបទិន្នន័យរុករកចេញពីឧបករណ៍នេះជាអចិន្ត្រៃយ៍។ គណនី Google នៅក្នុងកម្រងព័ត៌មាននេះអាចនឹងត្រូវបានប្រើដោយកម្មវិធីផ្សេងទៀតនៅលើ <ph name="DEVICE_TYPE" /> របស់អ្នក។ អ្នកអាចដកគណនីទាំងនេះចេញនៅក្នុង <ph name="BEGIN_LINK" /><ph name="SETTING_SECTION" /> > <ph name="ACCOUNTS_SECTION" /><ph name="END_LINK" />។</translation> <translation id="4033963223187371752">គេហទំព័រដែលមានសុវត្ថិភាពអាចបង្កប់ខ្លឹមសារដែលគ្មានសុវត្ថិភាពដូចជា រូបភាព ឬស៊ុមបណ្ដាញជាដើម</translation> +<translation id="4034741552964543387">បន្តដោយគ្មានទិន្នន័យមូលដ្ឋាន</translation> <translation id="4034824040120875894">ម៉ាស៊ីនបោះពុម្ព</translation> <translation id="4035758313003622889">កម្មវិធីគ្រប់គ្រងភារកិច្ច</translation> <translation id="4035877632587724847">មិនអនុញ្ញាត</translation> @@ -3417,6 +3425,7 @@ <translation id="4242533952199664413">បើកការកំណត់</translation> <translation id="4242577469625748426">បានបរាជ័យក្នុងការតំឡើងការកំណត់គោលការណ៍នៅឧបករណ៍នេះ៖ <ph name="VALIDATION_ERROR" />។</translation> <translation id="4243504193894350135">ម៉ាស៊ីនបោះពុម្ពត្រូវបានផ្អាក</translation> +<translation id="424423026762293842">ស្ដារទិន្នន័យមូលដ្ឋានរបស់អ្នក</translation> <translation id="4244238649050961491">ស្វែងរកកម្មវិធីប៊ិចជាច្រើនទៀត</translation> <translation id="4246980464509998944">មតិបន្ថែម៖</translation> <translation id="424726838611654458">បើកនៅក្នុង Adobe Reader ជានិច្ច</translation> @@ -4976,6 +4985,7 @@ <translation id="5792728279623964091">សូមចុចប៊ូតុងថាមពលរបស់អ្នក</translation> <translation id="5793339252089865437">ប្រសិនបើអ្នកទាញយកកំណែថ្មីតាមរយៈបណ្ដាញទូរសព្ទចល័ត ការទាញយកនេះអាចនឹងមានការគិតប្រាក់លើការប្រើប្រាស់ទិន្នន័យលើសកំណត់។</translation> <translation id="5793420564274426163">ការបញ្ជាក់ការផ្គូផ្គង</translation> +<translation id="5793430094159150686">ពាក្យសម្ងាត់របស់អ្នកបានផ្លាស់ប្ដូរហើយ។ ដើម្បីស្ដារទិន្នន័យមូលដ្ឋានរបស់អ្នក អ្នកត្រូវបញ្ចូលពាក្យសម្ងាត់ចាស់របស់អ្នក។</translation> <translation id="5794034487966529952">តុ <ph name="DESK_TITLE" /> បានបើកវិនដូកម្មវិធីរុករកតាមអ៊ីនធឺណិត <ph name="NUM_BROWSERS" /></translation> <translation id="5794414402486823030">បើកជាមួយកម្មវិធីមើលប្រព័ន្ធជានិច្ច</translation> <translation id="5794700615121138172">ថតដែល Linux បានចែករំលែក</translation> @@ -5900,6 +5910,7 @@ <translation id="6700093763382332031">ការចាក់សោស៊ីមបណ្ដាញចល័ត</translation> <translation id="6700480081846086223">ខាស <ph name="HOST_NAME" /></translation> <translation id="6701535245008341853">មិនអាចទទួលយកទម្រង់ទេ។</translation> +<translation id="6701824422332982935">ផ្ទុកទំព័រឡើងវិញ ដើម្បីប្រើប្រាស់កម្មវិធីបន្ថែមទាំងនេះ</translation> <translation id="6702639462873609204">កែប្រែ...</translation> <translation id="6703212423117969852">អ្នកអាចព្យាយាមម្ដងទៀតនៅពេលក្រោយនៅក្នុង Chrome។</translation> <translation id="6703254819490889819">ស្ដារការបម្រុងទុក</translation> @@ -7127,6 +7138,7 @@ <translation id="7903742244674067440">អ្នកមានវិញ្ញាបនបត្រនៅលើឯកសារដែលកំណត់អត្តសញ្ញាណអាជ្ញាធរវិញ្ញាបនបត្រទាំងនេះ</translation> <translation id="7903925330883316394">ឧបករណ៍ប្រើប្រាស់៖ <ph name="UTILITY_TYPE" /></translation> <translation id="7904526211178107182">កំណត់ឱ្យឧបករណ៍ផ្សេងទៀតនៅលើបណ្ដាញរបស់អ្នកអាចប្រើច្រក Linux។</translation> +<translation id="7906440585529721295">ទិន្នន័យមូលដ្ឋាននឹងត្រូវបានលុប</translation> <translation id="7907837847548254634">បង្ហាញការរំលេចរហ័សលើវត្ថុដែលបានផ្ដោត</translation> <translation id="7908378463497120834">សូមទោស យ៉ាងហោចណាស់ផ្នែកមួយនៃឧបករណ៍ផ្ទុកទិន្នន័យខាងក្រៅរបស់អ្នកមិនអាចម៉ោនបានទេ។</translation> <translation id="7909324225945368569">ប្ដូរឈ្មោះកម្រងព័ត៌មានរបស់អ្នក</translation> @@ -7464,6 +7476,7 @@ <translation id="822050276545350872">ចាប់ពីពេលនេះទៅ មិនចាំបាច់រង់ចាំទេ</translation> <translation id="8221491193165283816">ជាធម្មតា អ្នកទប់ស្កាត់ការជូនដំណឹង។ ដើម្បីអនុញ្ញាតឱ្យគេហទំព័រនេះជូនដំណឹងដល់អ្នក សូមចុចត្រង់នេះ។</translation> <translation id="822347941086490485">កំពុងស្វែងរកឧបករណ៍ HID...</translation> +<translation id="8223573963214454788">បន្ត រួចលុបទិន្នន័យ</translation> <translation id="8225046344534779393">ពិនិត្យការតភ្ជាប់អ៊ីនធឺណិត</translation> <translation id="8225265270453771718">ចែករំលែកវិនដូកម្មវិធី</translation> <translation id="8226222018808695353">ហាមឃាត់</translation> @@ -7564,6 +7577,7 @@ <translation id="8314381333424235892">កម្មវិធីបន្ថែមដែលបាត់ ឬមិនបានដំឡើង</translation> <translation id="831440797644402910">មិនអាចបើកថតនេះបានទេ</translation> <translation id="8314835274931377415">ចាប់ផ្ដើមរៀបចំមុខងារប្រើឧបករណ៍ចុចឬ?</translation> +<translation id="8317582043908962055">ស្គាល់អត្ថបទ P&DF</translation> <translation id="8317671367883557781">បន្ថែមការតភ្ជាប់បណ្តាញ</translation> <translation id="8319414634934645341">ការប្រើប្រាស់សោបន្ថែម</translation> <translation id="8321837372750396788"><ph name="DEVICE_TYPE" /> នេះនឹងស្ថិតក្រោមការគ្រប់គ្រងរបស់ <ph name="MANAGER" />។</translation> @@ -8450,6 +8464,7 @@ <translation id="9203398526606335860">បើកដំណើរការទម្រង់</translation> <translation id="9203904171912129171">ជ្រើសរើសឧបករណ៍</translation> <translation id="9206889157914079472">ការកត់ត្រាដោយប្រើប៊ិកពីអេក្រង់ចាក់សោ</translation> +<translation id="9208192193641542858">ទិន្នន័យមូលដ្ឋានត្រូវបានការពារដោយពាក្យសម្ងាត់ចាស់របស់អ្នក។ ប្រសិនបើអ្នកបានផ្លាស់ប្ដូរពាក្យសម្ងាត់របស់អ្នកថ្មីៗនេះ សូមសាកល្បងបញ្ចូលពាក្យសម្ងាត់ចាស់របស់អ្នកម្ដងទៀត។</translation> <translation id="9209563766569767417">កំពុងពិនិត្យមើលការរៀបចំទម្រង់ផ្ទុក Linux</translation> <translation id="9209689095351280025">គេហទំព័រមិនអាចប្រើខូគី ដែលតាមដានអ្នកនៅលើអ៊ីនធឺណិតបានទេ</translation> <translation id="9211177926627870898">តម្រូវឱ្យដំឡើងកំណែ</translation>
diff --git a/chrome/app/resources/generated_resources_kn.xtb b/chrome/app/resources/generated_resources_kn.xtb index d651c5e..5fe3ee3 100644 --- a/chrome/app/resources/generated_resources_kn.xtb +++ b/chrome/app/resources/generated_resources_kn.xtb
@@ -2764,6 +2764,7 @@ <translation id="3615073365085224194">ನಿಮ್ಮ ಬೆರಳಿನ ಮೂಲಕ ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಸೆನ್ಸರ್ ಅನ್ನು ಸ್ಪರ್ಶಿಸಿ</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ಅನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಲಾಗುತ್ತಿದೆ.</translation> <translation id="3615596877979647433">ಕೀ ಬೈಂಡಿಂಗ್ ಕಾಣೆಯಾಗಿದೆ. ಕಸ್ಟಮೈಸ್ ಮಾಡಲು ಕೀಬೋರ್ಡ್ ಕೀ ಅನ್ನು ಒತ್ತಿ</translation> +<translation id="3616113530831147358">ಆಡಿಯೋ</translation> <translation id="3616741288025931835">ಬ್ರೌಸಿಂಗ್ ಡೇಟಾವನ್ನು &ತೆರವುಗೊಳಿಸಿ...</translation> <translation id="3617891479562106823">ಹಿನ್ನೆಲೆಗಳ ಕಸ್ಟಮೈಸೇಶನ್ ಲಭ್ಯವಿಲ್ಲ. ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.</translation> <translation id="3619115746895587757">ಕ್ಯಾಪಚಿನೊ</translation>
diff --git a/chrome/app/resources/generated_resources_ko.xtb b/chrome/app/resources/generated_resources_ko.xtb index 08aea631..1775005 100644 --- a/chrome/app/resources/generated_resources_ko.xtb +++ b/chrome/app/resources/generated_resources_ko.xtb
@@ -2773,6 +2773,7 @@ <translation id="3615073365085224194">손가락으로 지문 센서를 터치하세요.</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" />을(를) 스캔하는 중입니다.</translation> <translation id="3615596877979647433">키가 누락되었습니다. 키보드 키를 눌러 맞춤설정하세요.</translation> +<translation id="3616113530831147358">오디오</translation> <translation id="3616741288025931835">인터넷 사용 기록 삭제(&C)...</translation> <translation id="3617891479562106823">배경을 사용할 수 없습니다. 나중에 다시 시도하세요.</translation> <translation id="3619115746895587757">카푸치노</translation>
diff --git a/chrome/app/resources/generated_resources_ky.xtb b/chrome/app/resources/generated_resources_ky.xtb index da5bd5e..e361c61a 100644 --- a/chrome/app/resources/generated_resources_ky.xtb +++ b/chrome/app/resources/generated_resources_ky.xtb
@@ -843,7 +843,7 @@ <translation id="177989070088644880">Колдонмо (<ph name="ANDROID_PACKAGE_NAME" />)</translation> <translation id="1780152987505130652">Топту жабуу</translation> <translation id="1780273119488802839">Кыстармалар өткөрүлүп алынууда...</translation> -<translation id="178092663238929451">Жакын жердеги кишилерден файлдарды алуу жана жөнөтүү үчүн Nearby Share функциясын жөндөңүз</translation> +<translation id="178092663238929451">Жакын жердеги кишилерден файлдарды алуу жана жөнөтүү үчүн Nearby Share функциясын тууралаңыз</translation> <translation id="1781291988450150470">Учурдагы PIN код</translation> <translation id="1781502536226964113">Жаңы өтмөк бетин ачуу</translation> <translation id="1781553166608855614">Колдонулуучу тилдер</translation> @@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Манжа изинин сенсоруна манжаңыз менен тийиңиз</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> жокко чыгарылууда.</translation> <translation id="3615596877979647433">Баскыч тандалган жок. Ыңгайлаштыруу үчүн баскычтоптогу бир баскычты басыңыз</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">&Серептөө дайындарын тазалап салуу…</translation> <translation id="3617891479562106823">Фондук сүрөттөр жеткиликсиз. Бир аздан кийин дагы аракет кылыңыз.</translation> <translation id="3619115746895587757">Капучино</translation> @@ -4331,7 +4332,7 @@ <translation id="514575469079499857">Жайгашкан жерди аныктоо үчүн IP дарегиңизди колдонуңуз (демейки)</translation> <translation id="5147103632304200977">Сайт HID түзмөктөрүн колдонгону жатканда уруксат суралсын (сунушталат)</translation> <translation id="5148277445782867161">Google'дун жайгашкан жерди аныктоо кызматы түзмөктүн жайгашкан жерин болжолдоп билүү үчүн Wi‑Fi, мобилдик тармактар жана сенсорлор сыяктуу булактарды колдонот.</translation> -<translation id="5150070631291639005">Купуялык жөндөөлөрү</translation> +<translation id="5150070631291639005">Купуялык параметрлери</translation> <translation id="5150254825601720210">Netscape Тастыктама SSL сервер аталышы</translation> <translation id="5151354047782775295">Дисктен орун бошотуңуз же автоматтык түрдө жок кылына турган дайындарды тандаңыз</translation> <translation id="5153234146675181447">Телефон унутулсун</translation>
diff --git a/chrome/app/resources/generated_resources_lo.xtb b/chrome/app/resources/generated_resources_lo.xtb index 0560dac0..62241af 100644 --- a/chrome/app/resources/generated_resources_lo.xtb +++ b/chrome/app/resources/generated_resources_lo.xtb
@@ -2771,6 +2771,7 @@ <translation id="3615073365085224194">ໃຊ້ນິ້ວມືຂອງທ່ານແຕະເຊັນເຊີລາຍນິ້ວມື</translation> <translation id="3615579745882581859">ລະບົບກຳລັງສະແກນ <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">ບໍ່ມີປຸ່ມ. ກົດປຸ່ມແປ້ນພິມເພື່ອປັບແຕ່ງ</translation> +<translation id="3616113530831147358">ສຽງ</translation> <translation id="3616741288025931835">ລຶບຂໍ້ມູນການທ່ອງເນັດ...</translation> <translation id="3617891479562106823">ພື້ນຫຼັງບໍ່ສາມາດໃຊ້ໄດ້. ກະລຸນາລອງໃໝ່ໃນພາຍຫຼັງ.</translation> <translation id="3619115746895587757">ຄາປູຊິໂນ</translation>
diff --git a/chrome/app/resources/generated_resources_lt.xtb b/chrome/app/resources/generated_resources_lt.xtb index 1a3af6e..daa3a30 100644 --- a/chrome/app/resources/generated_resources_lt.xtb +++ b/chrome/app/resources/generated_resources_lt.xtb
@@ -2775,6 +2775,7 @@ <translation id="3615073365085224194">Palieskite kontrolinio kodo jutiklį pirštu</translation> <translation id="3615579745882581859">Nuskaitomas „<ph name="FILE_NAME" />“.</translation> <translation id="3615596877979647433">Trūksta klavišo. Jei norite tinkinti, paspauskite klaviatūros klavišą</translation> +<translation id="3616113530831147358">Garsas</translation> <translation id="3616741288025931835">&Išvalyti naršymo duomenis...</translation> <translation id="3617891479562106823">Fonai nepasiekiami. Vėliau bandykite dar kartą.</translation> <translation id="3619115746895587757">Kapučino kava</translation>
diff --git a/chrome/app/resources/generated_resources_lv.xtb b/chrome/app/resources/generated_resources_lv.xtb index 4145b2f..1b0f95e 100644 --- a/chrome/app/resources/generated_resources_lv.xtb +++ b/chrome/app/resources/generated_resources_lv.xtb
@@ -2759,6 +2759,7 @@ <translation id="3615073365085224194">Ar pirkstu pieskarieties pirkstu nospiedumu sensoram</translation> <translation id="3615579745882581859">Notiek faila “<ph name="FILE_NAME" />” pārbaude.</translation> <translation id="3615596877979647433">Nav norādīts taustiņš. Lai pielāgotu, nospiediet tastatūras taustiņu.</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Dzēst pārlūkošanas datus...</translation> <translation id="3617891479562106823">Fona attēli nav pieejami. Vēlāk mēģiniet vēlreiz.</translation> <translation id="3619115746895587757">Kapučīno</translation>
diff --git a/chrome/app/resources/generated_resources_mk.xtb b/chrome/app/resources/generated_resources_mk.xtb index b07a025..2cb2ca7 100644 --- a/chrome/app/resources/generated_resources_mk.xtb +++ b/chrome/app/resources/generated_resources_mk.xtb
@@ -2773,6 +2773,7 @@ <translation id="3615073365085224194">Допрете го сензорот за отпечатоци со прстот</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> се скенира.</translation> <translation id="3615596877979647433">Недостасува копче. Притиснете копче на тастатура за да го приспособите</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">&Исчисти податоци од прелистување...</translation> <translation id="3617891479562106823">Заднините се недостапни. Обидете се повторно подоцна.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_ml.xtb b/chrome/app/resources/generated_resources_ml.xtb index 649ca69..b32b3e96c 100644 --- a/chrome/app/resources/generated_resources_ml.xtb +++ b/chrome/app/resources/generated_resources_ml.xtb
@@ -2756,6 +2756,7 @@ <translation id="3615073365085224194">ഫിംഗർപ്രിന്റ് സെൻസറിൽ സ്പർശിക്കുക</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> സ്കാൻ ചെയ്യുകയാണ്.</translation> <translation id="3615596877979647433">കീ തിരഞ്ഞെടുത്തിട്ടില്ല. ഇഷ്ടാനുസൃതമാക്കാൻ കീബോർഡ് കീ അമർത്തുക</translation> +<translation id="3616113530831147358">ഓഡിയോ</translation> <translation id="3616741288025931835">&ബ്രൌസിംഗ് ഡാറ്റ ഇല്ലാതാക്കുക...</translation> <translation id="3617891479562106823">പശ്ചാത്തലങ്ങൾ ലഭ്യമല്ല. പിന്നീട് വീണ്ടും ശ്രമിക്കുക.</translation> <translation id="3619115746895587757">കാപ്പുചീനോ</translation>
diff --git a/chrome/app/resources/generated_resources_mn.xtb b/chrome/app/resources/generated_resources_mn.xtb index 3800085..9fb25a5 100644 --- a/chrome/app/resources/generated_resources_mn.xtb +++ b/chrome/app/resources/generated_resources_mn.xtb
@@ -2768,6 +2768,7 @@ <translation id="3615073365085224194">Хурууны хээ мэдрэгчид хуруугаараа хүрнэ үү</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" />-г скан хийж байна.</translation> <translation id="3615596877979647433">Товч дутуу байна. Өөрчлөхийн тулд гарын товч дээр дарна уу</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">& Хайлтын өгөгдлийг цэвэрлэ...</translation> <translation id="3617891479562106823">Арын дэвсгэр боломжгүй байна. Дараа дахин оролдоно уу.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_mr.xtb b/chrome/app/resources/generated_resources_mr.xtb index 66e748d..74dd180 100644 --- a/chrome/app/resources/generated_resources_mr.xtb +++ b/chrome/app/resources/generated_resources_mr.xtb
@@ -2771,6 +2771,7 @@ <translation id="3615073365085224194">तुमच्या बोटाने फिंगरप्रिंट सेन्सरला स्पर्श करा</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> स्कॅन केली जात आहे.</translation> <translation id="3615596877979647433">की उपलब्ध नाही. कस्टमाइझ करण्यासाठी किबोर्ड की प्रेस करा</translation> +<translation id="3616113530831147358">ऑडिओ</translation> <translation id="3616741288025931835">ब्राउझिंग डेटा &साफ करा...</translation> <translation id="3617891479562106823">बॅकग्राउंड अनुपलब्ध आहेत. नंतर पुन्हा प्रयत्न करा.</translation> <translation id="3619115746895587757">कॅपिचिनो</translation>
diff --git a/chrome/app/resources/generated_resources_ms.xtb b/chrome/app/resources/generated_resources_ms.xtb index 31c44d4..927d1c3 100644 --- a/chrome/app/resources/generated_resources_ms.xtb +++ b/chrome/app/resources/generated_resources_ms.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Sentuh penderia cap jari menggunakan jari anda</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> sedang diimbas.</translation> <translation id="3615596877979647433">Tiada kekunci. Tekan kekunci papan kekunci untuk menyesuaikan</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Kosongkan Data Menyemak Imbas...</translation> <translation id="3617891479562106823">Latar belakang tidak tersedia. Cuba lagi nanti.</translation> <translation id="3619115746895587757">Kapucino</translation>
diff --git a/chrome/app/resources/generated_resources_my.xtb b/chrome/app/resources/generated_resources_my.xtb index 6f96eb9..bc0a19c7 100644 --- a/chrome/app/resources/generated_resources_my.xtb +++ b/chrome/app/resources/generated_resources_my.xtb
@@ -2770,6 +2770,7 @@ <translation id="3615073365085224194">လက်ဗွေ အာရုံခံကိရိယာကို သင့်လက်ချောင်းဖြင့် ထိပါ</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ကို စစ်ဆေးနေပါသည်။</translation> <translation id="3615596877979647433">ကီး မရှိပါ။ စိတ်ကြိုက်လုပ်ရန် ကီးဘုတ်ကီးတစ်ခုကို နှိပ်ပါ</translation> +<translation id="3616113530831147358">အသံ</translation> <translation id="3616741288025931835">ဘရောက်လုပ်ထားသည့် အချက်လက်များ ရှင်းလင်းရန်...</translation> <translation id="3617891479562106823">နောက်ခံပုံများ မရရှိနိုင်ပါ။ နောက်မှ ထပ်စမ်းကြည့်ပါ။</translation> <translation id="3619115746895587757">ကာပူချီနို</translation>
diff --git a/chrome/app/resources/generated_resources_ne.xtb b/chrome/app/resources/generated_resources_ne.xtb index e2c243b..b0987c7 100644 --- a/chrome/app/resources/generated_resources_ne.xtb +++ b/chrome/app/resources/generated_resources_ne.xtb
@@ -2755,6 +2755,7 @@ <translation id="3615073365085224194">आफ्नो औँलाले फिंगरप्रिन्ट सेन्सरमा छुनुहोस्</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> स्क्यान गरिँदै छ।</translation> <translation id="3615596877979647433">की थिचिएको छैन। कस्टमाइज गरिनु पर्ने किबोर्ड कीमा थिच्नुहोस्</translation> +<translation id="3616113530831147358">अडियो</translation> <translation id="3616741288025931835">&ब्राउजिङ लगत खालि गर्नुहोस्...</translation> <translation id="3617891479562106823">पृष्ठभूमिहरू उपलब्ध छैनन्। पछि फेरि प्रयास गर्नुहोस्।</translation> <translation id="3619115746895587757">कापाचिनो</translation>
diff --git a/chrome/app/resources/generated_resources_nl.xtb b/chrome/app/resources/generated_resources_nl.xtb index 5114295..4e73c07 100644 --- a/chrome/app/resources/generated_resources_nl.xtb +++ b/chrome/app/resources/generated_resources_nl.xtb
@@ -2756,6 +2756,7 @@ <translation id="3615073365085224194">Raak de vingerafdruksensor aan met je vinger</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> wordt gescand.</translation> <translation id="3615596877979647433">De toets ontbreekt. Druk op een toets op het toetsenbord om deze aan te passen.</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Browsegegevens wissen</translation> <translation id="3617891479562106823">Achtergronden zijn niet beschikbaar. Probeer het later opnieuw.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_no.xtb b/chrome/app/resources/generated_resources_no.xtb index 74e37d4..809cd78b 100644 --- a/chrome/app/resources/generated_resources_no.xtb +++ b/chrome/app/resources/generated_resources_no.xtb
@@ -2759,6 +2759,7 @@ <translation id="3615073365085224194">Trykk på fingeravtrykkssensoren med fingeren</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> skannes.</translation> <translation id="3615596877979647433">Tast mangler Trykk på en tastaturtast for å tilpasse</translation> +<translation id="3616113530831147358">Lyd</translation> <translation id="3616741288025931835">&Fjern nettlesingsdata</translation> <translation id="3617891479562106823">Bakgrunner er utilgjengelig. Prøv på nytt senere.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_or.xtb b/chrome/app/resources/generated_resources_or.xtb index f171b22a..c7b9b56 100644 --- a/chrome/app/resources/generated_resources_or.xtb +++ b/chrome/app/resources/generated_resources_or.xtb
@@ -2755,6 +2755,7 @@ <translation id="3615073365085224194">ଆପଣଙ୍କର ଆଙ୍ଗୁଠିରେ ଟିପଚିହ୍ନ ସେନ୍ସର୍କୁ ସ୍ପର୍ଶ କରନ୍ତୁ</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" />ର ସ୍କାନ୍ କରାଯାଉଛି।</translation> <translation id="3615596877979647433">କୀ ଉପଲବ୍ଧ ନାହିଁ। କଷ୍ଟମାଇଜ କରିବା ପାଇଁ ଏକ କୀବୋର୍ଡ କୀକୁ ଦବାନ୍ତୁ</translation> +<translation id="3616113530831147358">ଅଡିଓ</translation> <translation id="3616741288025931835">&ବ୍ରାଉଜିଂ ଡାଟା ଖାଲି କରନ୍ତୁ...</translation> <translation id="3617891479562106823">ପୃଷ୍ଠଭୂମି ଉପଲବ୍ଧ ନାହିଁ। ପରେ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ।</translation> <translation id="3619115746895587757">କ୍ୟାପାଚିନୋ</translation>
diff --git a/chrome/app/resources/generated_resources_pa.xtb b/chrome/app/resources/generated_resources_pa.xtb index 68db999..8237ab0 100644 --- a/chrome/app/resources/generated_resources_pa.xtb +++ b/chrome/app/resources/generated_resources_pa.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">ਆਪਣੀ ਉਂਗਲ ਨਾਲ ਫਿੰਗਰਪ੍ਰਿੰਟ ਸੈਂਸਰ ਨੂੰ ਸਪਰਸ਼ ਕਰੋ</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ਨੂੰ ਸਕੈਨ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ।</translation> <translation id="3615596877979647433">ਕੁੰਜੀ ਮੌਜੂਦ ਨਹੀਂ ਹੈ। ਵਿਉਂਤਬੱਧ ਕਰਨ ਲਈ ਕੀ-ਬੋਰਡ ਕੁੰਜੀ ਦਬਾਓ</translation> +<translation id="3616113530831147358">ਆਡੀਓ</translation> <translation id="3616741288025931835">&ਬ੍ਰਾਊਜ਼ਿੰਗ ਡਾਟਾ ਹਟਾਓ...</translation> <translation id="3617891479562106823">ਬੈਕਗ੍ਰਾਊਂਡਾਂ ਉਪਲਬਧ ਨਹੀਂ ਹਨ। ਬਾਅਦ ਵਿੱਚ ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ।</translation> <translation id="3619115746895587757">ਕੈਪੁਚੀਨੋ</translation>
diff --git a/chrome/app/resources/generated_resources_pl.xtb b/chrome/app/resources/generated_resources_pl.xtb index 2abb7f5..f9fb1ad 100644 --- a/chrome/app/resources/generated_resources_pl.xtb +++ b/chrome/app/resources/generated_resources_pl.xtb
@@ -2743,6 +2743,7 @@ <translation id="3615073365085224194">Przyłóż palec do czytnika linii papilarnych</translation> <translation id="3615579745882581859">Skanuję plik <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Brak klawisza. Aby dostosować, naciśnij klawisz na klawiaturze</translation> +<translation id="3616113530831147358">Dźwięk</translation> <translation id="3616741288025931835">&Wyczyść dane przeglądania...</translation> <translation id="3617891479562106823">Tła są niedostępne. Spróbuj ponownie później.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_pt-BR.xtb b/chrome/app/resources/generated_resources_pt-BR.xtb index 480ab67..50fdf3a 100644 --- a/chrome/app/resources/generated_resources_pt-BR.xtb +++ b/chrome/app/resources/generated_resources_pt-BR.xtb
@@ -2774,6 +2774,7 @@ <translation id="3615073365085224194">Toque no sensor de impressão digital com seu dedo</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> está sendo verificado.</translation> <translation id="3615596877979647433">A tecla está em branco. Pressione uma tecla para personalizar</translation> +<translation id="3616113530831147358">Áudio</translation> <translation id="3616741288025931835">&Limpar dados de navegação...</translation> <translation id="3617891479562106823">Os planos de fundo estão indisponíveis. Tente novamente mais tarde.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_pt-PT.xtb b/chrome/app/resources/generated_resources_pt-PT.xtb index 8a610ff..28c4f440 100644 --- a/chrome/app/resources/generated_resources_pt-PT.xtb +++ b/chrome/app/resources/generated_resources_pt-PT.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">Toque no sensor de impressões digitais com o dedo.</translation> <translation id="3615579745882581859">O ficheiro <ph name="FILE_NAME" /> está a ser analisado.</translation> <translation id="3615596877979647433">A tecla está em falta. Prima uma tecla do teclado para personalizar</translation> +<translation id="3616113530831147358">Áudio</translation> <translation id="3616741288025931835">&Limpar Dados de Navegação...</translation> <translation id="3617891479562106823">Os fundos não estão disponíveis. Tente novamente mais tarde.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_ro.xtb b/chrome/app/resources/generated_resources_ro.xtb index febe1a45..ca91e98 100644 --- a/chrome/app/resources/generated_resources_ro.xtb +++ b/chrome/app/resources/generated_resources_ro.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">Atinge senzorul de amprentă cu degetul</translation> <translation id="3615579745882581859">Se scanează fișierul <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Lipsește tasta. Apasă o tastă de pe tastatură pentru personalizare</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Șterge datele de navigare...</translation> <translation id="3617891479562106823">Fundalurile nu sunt disponibile. Încearcă din nou mai târziu.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_ru.xtb b/chrome/app/resources/generated_resources_ru.xtb index 2c32cf5..c95acd3 100644 --- a/chrome/app/resources/generated_resources_ru.xtb +++ b/chrome/app/resources/generated_resources_ru.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">Приложите палец к сканеру отпечатков пальцев.</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" />: проверка…</translation> <translation id="3615596877979647433">Клавиша не задана. Нажмите на нее, чтобы настроить.</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">Очистить данные просмотров...</translation> <translation id="3617891479562106823">Фоновые изображения недоступны. Повторите попытку позже.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_si.xtb b/chrome/app/resources/generated_resources_si.xtb index f0938a48..b67d416 100644 --- a/chrome/app/resources/generated_resources_si.xtb +++ b/chrome/app/resources/generated_resources_si.xtb
@@ -2760,6 +2760,7 @@ <translation id="3615073365085224194">ඔබේ ඇඟිල්ලෙන් ඇඟිලි සලකුණු සංවේදකය ස්පර්ශ කරන්න</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ස්කෑන් කරමින් පවතී.</translation> <translation id="3615596877979647433">යතුර අස්ථානගතයි. අභිරුචිකරණය කිරීමට යතුරු පුවරු යතුරක් ඔබන්න</translation> +<translation id="3616113530831147358">ශබ්ද</translation> <translation id="3616741288025931835">ශවේෂණ දත්ත හිස් කරන්න</translation> <translation id="3617891479562106823">පසුබිම් නොතිබේ. පසුව නැවත උත්සාහ කරන්න.</translation> <translation id="3619115746895587757">කපුචිනෝ</translation>
diff --git a/chrome/app/resources/generated_resources_sk.xtb b/chrome/app/resources/generated_resources_sk.xtb index 91d73f9..7d6fe08d 100644 --- a/chrome/app/resources/generated_resources_sk.xtb +++ b/chrome/app/resources/generated_resources_sk.xtb
@@ -2759,6 +2759,7 @@ <translation id="3615073365085224194">Dotknite sa senzora odtlačkov prstov</translation> <translation id="3615579745882581859">Súbor <ph name="FILE_NAME" /> sa kontroluje.</translation> <translation id="3615596877979647433">Chýba kláves. Prispôsobte si ho stlačením klávesa na klávesnici</translation> +<translation id="3616113530831147358">Zvuk</translation> <translation id="3616741288025931835">&Vymazať dáta prehliadania…</translation> <translation id="3617891479562106823">Pozadia nie sú k dispozícii. Skúste to neskôr.</translation> <translation id="3619115746895587757">Kapučíno</translation>
diff --git a/chrome/app/resources/generated_resources_sl.xtb b/chrome/app/resources/generated_resources_sl.xtb index d8ecba48..3475954 100644 --- a/chrome/app/resources/generated_resources_sl.xtb +++ b/chrome/app/resources/generated_resources_sl.xtb
@@ -2775,6 +2775,7 @@ <translation id="3615073365085224194">S prstom se dotaknite tipala prstnih odtisov</translation> <translation id="3615579745882581859">Poteka pregled datoteke <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Manjka tipka. Pritisnite tipko na tipkovnici za prilagajanje.</translation> +<translation id="3616113530831147358">Zvok</translation> <translation id="3616741288025931835">&Izbriši podatke brskanja ...</translation> <translation id="3617891479562106823">Ozadja niso na voljo. Poskusite znova pozneje.</translation> <translation id="3619115746895587757">Kapučino</translation>
diff --git a/chrome/app/resources/generated_resources_sq.xtb b/chrome/app/resources/generated_resources_sq.xtb index de6623a8..78dc07f 100644 --- a/chrome/app/resources/generated_resources_sq.xtb +++ b/chrome/app/resources/generated_resources_sq.xtb
@@ -2754,6 +2754,7 @@ <translation id="3615073365085224194">Prek me gisht sensorin e gjurmës së gishtit</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> po skanohet.</translation> <translation id="3615596877979647433">Tasti mungon. Shtyp një tast të tastierës për ta personalizuar</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Pastro të dhënat e shfletimit...</translation> <translation id="3617891479562106823">Sfondet nuk disponohen. Provo sërish më vonë.</translation> <translation id="3619115746895587757">Kapuçino</translation>
diff --git a/chrome/app/resources/generated_resources_sr-Latn.xtb b/chrome/app/resources/generated_resources_sr-Latn.xtb index c24d5cb90..177467e6 100644 --- a/chrome/app/resources/generated_resources_sr-Latn.xtb +++ b/chrome/app/resources/generated_resources_sr-Latn.xtb
@@ -2756,6 +2756,7 @@ <translation id="3615073365085224194">Dodirnite prstom senzor za otisak prsta</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> se skenira.</translation> <translation id="3615596877979647433">Taster nedostaje. Pritisnite taster na tastaturi da biste prilagodili</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">&Obriši podatke pregledanja...</translation> <translation id="3617891479562106823">Pozadine nisu dostupne. Probajte ponovo kasnije.</translation> <translation id="3619115746895587757">Kapučino</translation>
diff --git a/chrome/app/resources/generated_resources_sr.xtb b/chrome/app/resources/generated_resources_sr.xtb index 622ba0b..34cfc46 100644 --- a/chrome/app/resources/generated_resources_sr.xtb +++ b/chrome/app/resources/generated_resources_sr.xtb
@@ -2756,6 +2756,7 @@ <translation id="3615073365085224194">Додирните прстом сензор за отисак прста</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> се скенира.</translation> <translation id="3615596877979647433">Тастер недостаје. Притисните тастер на тастатури да бисте прилагодили</translation> +<translation id="3616113530831147358">Аудио</translation> <translation id="3616741288025931835">&Обриши податке прегледања...</translation> <translation id="3617891479562106823">Позадине нису доступне. Пробајте поново касније.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_sv.xtb b/chrome/app/resources/generated_resources_sv.xtb index d3d97da9..3cfe421 100644 --- a/chrome/app/resources/generated_resources_sv.xtb +++ b/chrome/app/resources/generated_resources_sv.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Tryck på fingeravtryckssensorn med fingret.</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> genomsöks.</translation> <translation id="3615596877979647433">Tangent saknas. Tryck på en tangent för att anpassa den</translation> +<translation id="3616113530831147358">Ljud</translation> <translation id="3616741288025931835">&Rensa webbinformation...</translation> <translation id="3617891479562106823">Inga bakgrunder är tillgängliga. Försök igen senare.</translation> <translation id="3619115746895587757">Cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_sw.xtb b/chrome/app/resources/generated_resources_sw.xtb index 24a74f6..c2d9e1a 100644 --- a/chrome/app/resources/generated_resources_sw.xtb +++ b/chrome/app/resources/generated_resources_sw.xtb
@@ -2769,6 +2769,7 @@ <translation id="3615073365085224194">Gusa kitambua alama ya kidole ukitumia kidole chako</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> inachanganuliwa.</translation> <translation id="3615596877979647433">Kitufe kinakosekana. Bonyeza kitufe cha kibodi ili uweke mapendeleo</translation> +<translation id="3616113530831147358">Sauti</translation> <translation id="3616741288025931835">&Futa Data ya Kuvinjari</translation> <translation id="3617891479562106823">Mandhari hayapatikani. Jaribu tena baadaye.</translation> <translation id="3619115746895587757">Kapuchino</translation>
diff --git a/chrome/app/resources/generated_resources_ta.xtb b/chrome/app/resources/generated_resources_ta.xtb index 39768e1..2af04f5 100644 --- a/chrome/app/resources/generated_resources_ta.xtb +++ b/chrome/app/resources/generated_resources_ta.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">விரலால் கைரேகை சென்சாரைத் தொடவும்</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> ஸ்கேன் செய்யப்படுகிறது.</translation> <translation id="3615596877979647433">பட்டன் ஒதுக்கப்படவில்லை. பிரத்தியேகமாக்க கீபோர்டு பட்டனை அழுத்தவும்</translation> +<translation id="3616113530831147358">ஆடியோ</translation> <translation id="3616741288025931835">உலாவிய தரவை &சுத்தமாக்கு...</translation> <translation id="3617891479562106823">பின்னணிகள் கிடைக்கவில்லை. பின்னர் மீண்டும் முயலவும்.</translation> <translation id="3619115746895587757">காப்பச்சினோ</translation>
diff --git a/chrome/app/resources/generated_resources_te.xtb b/chrome/app/resources/generated_resources_te.xtb index 45ca411..479a7c89 100644 --- a/chrome/app/resources/generated_resources_te.xtb +++ b/chrome/app/resources/generated_resources_te.xtb
@@ -2771,6 +2771,7 @@ <translation id="3615073365085224194">వేలిముద్ర సెన్సార్ను మీ వేలితో తాకండి</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> స్కాన్ అవుతోంది.</translation> <translation id="3615596877979647433">కీ ఏదీ నొక్కబడలేదు. అనుకూలంగా మార్చడానికి కీబోర్డ్ కీని నొక్కండి</translation> +<translation id="3616113530831147358">ఆడియో</translation> <translation id="3616741288025931835">బ్రౌజింగ్ డేటాను &క్లియర్ చేయి...</translation> <translation id="3617891479562106823">నేపథ్యాలు అందుబాటులో లేవు. తర్వాత మళ్లీ ప్రయత్నించండి.</translation> <translation id="3619115746895587757">కాపుచినో</translation>
diff --git a/chrome/app/resources/generated_resources_th.xtb b/chrome/app/resources/generated_resources_th.xtb index bda2903..11ab25ad3 100644 --- a/chrome/app/resources/generated_resources_th.xtb +++ b/chrome/app/resources/generated_resources_th.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">ใช้นิ้วแตะเซ็นเซอร์ลายนิ้วมือ</translation> <translation id="3615579745882581859">กำลังสแกน <ph name="FILE_NAME" /></translation> <translation id="3615596877979647433">ไม่มีแป้น กดแป้นพิมพ์เพื่อปรับแต่ง</translation> +<translation id="3616113530831147358">เสียง</translation> <translation id="3616741288025931835">&ล้างข้อมูลการท่องเว็บ...</translation> <translation id="3617891479562106823">พื้นหลังไม่พร้อมใช้งาน โปรดลองอีกครั้งภายหลัง</translation> <translation id="3619115746895587757">คาปูชิโน</translation>
diff --git a/chrome/app/resources/generated_resources_tr.xtb b/chrome/app/resources/generated_resources_tr.xtb index fb7f6c1..07e21520 100644 --- a/chrome/app/resources/generated_resources_tr.xtb +++ b/chrome/app/resources/generated_resources_tr.xtb
@@ -2754,6 +2754,7 @@ <translation id="3615073365085224194">Parmağınızla parmak izi sensörüne dokunun</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> taranıyor.</translation> <translation id="3615596877979647433">Tuş eksik. Özelleştirmek istediğiniz klavye tuşuna basın</translation> +<translation id="3616113530831147358">Ses</translation> <translation id="3616741288025931835">Tarama Verilerini &Temizle...</translation> <translation id="3617891479562106823">Arka planlar kullanılamıyor. Daha sonra tekrar deneyin.</translation> <translation id="3619115746895587757">Kapuçino</translation>
diff --git a/chrome/app/resources/generated_resources_uk.xtb b/chrome/app/resources/generated_resources_uk.xtb index 5cb69f2..ea18308 100644 --- a/chrome/app/resources/generated_resources_uk.xtb +++ b/chrome/app/resources/generated_resources_uk.xtb
@@ -2775,6 +2775,7 @@ <translation id="3615073365085224194">Торкніться пальцем сканера відбитків</translation> <translation id="3615579745882581859">Сканується файл "<ph name="FILE_NAME" />".</translation> <translation id="3615596877979647433">Клавішу на зв’язано. Щоб налаштувати прив’язку, натисніть клавішу клавіатури.</translation> +<translation id="3616113530831147358">Аудіо</translation> <translation id="3616741288025931835">&Очистити дані веб-перегляду...</translation> <translation id="3617891479562106823">Фони недоступні. Повторіть спробу пізніше.</translation> <translation id="3619115746895587757">Капучино</translation>
diff --git a/chrome/app/resources/generated_resources_ur.xtb b/chrome/app/resources/generated_resources_ur.xtb index 3360bb3..c2359ea2 100644 --- a/chrome/app/resources/generated_resources_ur.xtb +++ b/chrome/app/resources/generated_resources_ur.xtb
@@ -2758,6 +2758,7 @@ <translation id="3615073365085224194">اپنی انگلی سے فنگر پرنٹ سینسر کو ٹچ کریں</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> اسکین کیا جا رہا ہے۔</translation> <translation id="3615596877979647433">کلید غائب ہے۔ حسب ضرورت بنانے کے ليے کی بورڈ کی کلید دبائیں</translation> +<translation id="3616113530831147358">آڈیو</translation> <translation id="3616741288025931835">براؤزنگ ڈیٹا &صاف کریں…</translation> <translation id="3617891479562106823">پس منظر غیر دستیاب ہیں۔ بعد میں دوبارہ کوشش کریں۔</translation> <translation id="3619115746895587757">کیپو چینو</translation>
diff --git a/chrome/app/resources/generated_resources_uz.xtb b/chrome/app/resources/generated_resources_uz.xtb index 20834c44..6fec60f 100644 --- a/chrome/app/resources/generated_resources_uz.xtb +++ b/chrome/app/resources/generated_resources_uz.xtb
@@ -380,6 +380,7 @@ <translation id="1374844444528092021"><ph name="NETWORK_NAME" /> tarmog‘i talab qilayotgan sertifikat o‘rnatilmagan yoki eskirgan. Yangisini olish uchun qaytadan ulanib ko‘ring.</translation> <translation id="1375321115329958930">Saqlab olingan parollar</translation> <translation id="1375557162880614858">ChromeOS Flex tizimidagi ichiga oʻrnatilgan skrin rider – ChromeVox faollashtirilsinmi?</translation> +<translation id="1375938286942050085">Sozlandi! Qurilma oʻyinlar uchun tayyorlanmoqda</translation> <translation id="137651782282853227">Saqlangan manzillar shu yerda turadi</translation> <translation id="1376771218494401509">Oynani &nomlash...</translation> <translation id="1377600615067678409">Tashlab ketish</translation> @@ -394,6 +395,7 @@ <translation id="138784436342154190">Standart boshlang‘ich sahifa tiklansinmi?</translation> <translation id="1388253969141979417">Mikrofondan foydalanishga ruxsat berilgan</translation> <translation id="1388728792929436380">Yangilanishlar tugasa, <ph name="DEVICE_TYPE" /> qurilmasi qayta ishga tushiriladi.</translation> +<translation id="1389601498324964367">Taqsimlanadigan xotira</translation> <translation id="139013308650923562">Qurilmangizga oʻrnatilgan shriftlardan foydalanishga ruxsat beradi</translation> <translation id="1390548061267426325">Oddiy ichki oynada ochish</translation> <translation id="1390907927270446471"><ph name="PROFILE_USERNAME" /> foydalanuvchisiga <ph name="PRINTER_NAME" /> printerida chop etishga ruxsat berilmagan. Administratorga murojaat qiling.</translation> @@ -1062,6 +1064,7 @@ <translation id="1992924914582925289">Qurilmadan olib tashlash</translation> <translation id="1994173015038366702">Sayt URL manzili</translation> <translation id="1995916364271252349">Saytlar qaysi axborotlarni (joylashuv, kamera, qalqib chiquvchi va boshqalar) ishlatishi va chiqarishini boshqarish</translation> +<translation id="1997433994358798851">Qurilmangizga ulanishi uchun Chrome Bluetooth ishlatishiga ruxsat bering</translation> <translation id="1997616988432401742">Sertifikatlaringiz</translation> <translation id="1999115740519098545">Boshlanishda</translation> <translation id="2000419248597011803">Manzillar qatori va qidiruv oynasida kiritilgan so‘rovlar va ba’zi cookie ma’lumotlarni standart qidiruv tizimiga yuboradi</translation> @@ -1726,6 +1729,7 @@ <translation id="25899519884572181">Mutolaa rejimidan chiqish</translation> <translation id="2593499352046705383">Boshlashdan oldin maʼlumotlaringizni zaxiralang. <ph name="DEVICE_OS" /> oʻrnatilsa, qattiq diskdagi barcha maʼlumotlar tozalanadi. Batafsil: g.co/flex/InstallGuide.</translation> <translation id="2594999711683503743">Qidiring yoki veb-sahifa manzilini kiriting</translation> +<translation id="2599048253926156421">Foydalanuvchi nomi vaqtincha xotiraga nusxalandi</translation> <translation id="2602501489742255173">Boshlash uchun tepaga suring</translation> <translation id="2603115962224169880">Kompyuterni tozalash vositasi</translation> <translation id="2603355571917519942">Voice Match tayyor</translation> @@ -1949,6 +1953,7 @@ <translation id="2804043232879091219">Muqobil brauzer ochilmadi</translation> <translation id="2804667941345577550">Bu saytdagi hisobingizdan avtomatik chiqarilasiz (shuningdek, ochiq varaqlardan ham)</translation> <translation id="2804680522274557040">Kamera faolsizlantirilgan</translation> +<translation id="280518252911523675">Eski parol kiritilmasa, qurilmadagi axborotlar oʻchirib tashlanadi. Bu foydalanuvchini qayta sozlash uchun Google hisobingizga kirasiz.</translation> <translation id="2805539617243680210">Tayyor!</translation> <translation id="2805646850212350655">Microsoft (EFS) shifrlangan fayl tizimi</translation> <translation id="2805756323405976993">Ilovalar</translation> @@ -2759,6 +2764,7 @@ <translation id="3615073365085224194">Barmoq izi skaneriga barmogʻingizni tekizing</translation> <translation id="3615579745882581859"><ph name="FILE_NAME" /> tekshirilmoqda.</translation> <translation id="3615596877979647433">Tugma topilmadi. Moslashtirish uchun klaviatura tugmasini bosing</translation> +<translation id="3616113530831147358">Audio</translation> <translation id="3616741288025931835">Brauzer tarixini &tozalash...</translation> <translation id="3617891479562106823">Fon rasmlari mavjud emas. Keyinroq qaytadan urining.</translation> <translation id="3619115746895587757">Kappuchino</translation> @@ -3063,6 +3069,7 @@ <translation id="3895090224522145010">Kerberos uchun foydalanuvchi nomi</translation> <translation id="389521680295183045">Saytlarga qurilmadan foydalanishga oid axborotlarni soʻrashga ruxsat berish</translation> <translation id="3897298432557662720">{COUNT,plural, =1{rasm}other{# ta rasm}}</translation> +<translation id="3897746662269329507"><ph name="DEVICE_TYPE" /> qurilmangiz oʻyinlar uchun mos ishlab chiqilgan. Tanishuv ilovasi orqali yuzlab yangi oʻyinlar, oʻyin takliflari va qurilmada mavjud oʻyin funksiyalari bilan tanishing.</translation> <translation id="3898233949376129212">Qurilmagi til</translation> <translation id="3898327728850887246"><ph name="SITE_NAME" /> quyidagi ruxsatlarni olmoqchi: <ph name="FIRST_PERMISSION" /> va <ph name="SECOND_PERMISSION" /></translation> <translation id="389901847090970821">Klaviaturani tanlang</translation> @@ -3213,6 +3220,7 @@ <translation id="4033471457476425443">Yangi jild qo‘shish</translation> <translation id="4033711848170683365">Brauzerning ishlashi haqida axborot ushbu qurilmadan butunlay tozalanadi. Bu profildagi Google hisoblari <ph name="DEVICE_TYPE" /> qurilmangizda boshqa ilovalar tomonidan foydalanilishi mumkin. <ph name="BEGIN_LINK" /><ph name="SETTING_SECTION" /> > <ph name="ACCOUNTS_SECTION" /><ph name="END_LINK" /> orqali bu hisoblarni olib tashlashingiz mumkin.</translation> <translation id="4033963223187371752">Xavfsiz saytlarda rasmlar yoki freymlar kabi xavfli kontent boʻlishi mumkin.</translation> +<translation id="4034741552964543387">Qurilmadagi axborotsiz davom etish</translation> <translation id="4034824040120875894">Printer</translation> <translation id="4035758313003622889">&Vazifalar menejeri</translation> <translation id="4035877632587724847">Rad etish</translation> @@ -3404,6 +3412,7 @@ <translation id="4242533952199664413">Sozlamalarni ochish</translation> <translation id="4242577469625748426">Qurilmaga tartib-qoida sozlamalarini o‘rnatib bo‘lmadi: <ph name="VALIDATION_ERROR" />.</translation> <translation id="4243504193894350135">Printer pauza qilindi</translation> +<translation id="424423026762293842">Qurilmadagi axborot tiklanmoqda</translation> <translation id="4244238649050961491">Stilus bilan ishlovchi boshqa ilovalar</translation> <translation id="4246980464509998944">Qoʻshimcha fikrlar:</translation> <translation id="424726838611654458">Har doim Adobe Reader dasturida ochish</translation> @@ -4962,6 +4971,7 @@ <translation id="5792728279623964091">Quvvat tugmasini bosing</translation> <translation id="5793339252089865437">Yangilanishlarni mobil tarmoq orqali amalga oshirsangiz, ancha pulingiz ketib qoladi.</translation> <translation id="5793420564274426163">Ulanishni tasdiqlash</translation> +<translation id="5793430094159150686">Parolingiz oʻzgardi. Qurilmadagi axborotlarni tiklash uchun eski parol kiritilishi kerak.</translation> <translation id="5794034487966529952"><ph name="DESK_TITLE" /> ish stolida <ph name="NUM_BROWSERS" /> ta brauzer oynasi ochilgan</translation> <translation id="5794414402486823030">Doim tizimdagi birlamchi ko‘rish dasturida ochish</translation> <translation id="5794700615121138172">Linux umumiy jildlari</translation> @@ -5886,6 +5896,7 @@ <translation id="6700093763382332031">SIM karta bloklangan</translation> <translation id="6700480081846086223"><ph name="HOST_NAME" /> translatsiyasi</translation> <translation id="6701535245008341853">Profil yuklanmadi.</translation> +<translation id="6701824422332982935">Bu kengaytmalardan foydalanish uchun sahifani yangilang</translation> <translation id="6702639462873609204">&O‘zgartirish...</translation> <translation id="6703212423117969852">Keyinroq Chrome orqali qayta urinish mumkin.</translation> <translation id="6703254819490889819">Zaxiradan maʼlumotlarni tiklash</translation> @@ -7112,6 +7123,7 @@ <translation id="7903742244674067440">Sizda quyidagi sertifikatlash markazlari haqiqiyligini tasdiqlovchi sertifikatlar bor</translation> <translation id="7903925330883316394">Vosita: <ph name="UTILITY_TYPE" /></translation> <translation id="7904526211178107182">Tarmoqdagi boshqa qurilmalarga Linux portlariga ulanish imkoniyatini bering</translation> +<translation id="7906440585529721295">Qurilmadagi axborotlar oʻchib ketadi</translation> <translation id="7907837847548254634">Fokusdagi obyektni tez belgilab chiqarish</translation> <translation id="7908378463497120834">Tashqi xotira qurilmasining bir yoki bir nechta bo‘limini ulab bo‘lmadi.</translation> <translation id="7909324225945368569">Profilni qayta nomlang</translation> @@ -7449,6 +7461,7 @@ <translation id="822050276545350872">Bundan buyon kutish shart emas</translation> <translation id="8221491193165283816">Odatda bildirishnomalarni bloklaysiz. Bu saytga ruxsat berish uchun bu yerga bosing.</translation> <translation id="822347941086490485">HID qurilmalar qidirilmoqda...</translation> +<translation id="8223573963214454788">Davom etish va axborotlarni tozalash</translation> <translation id="8225046344534779393">Internet aloqasini tekshiring</translation> <translation id="8225265270453771718">Ilova oynasini namoyish qilish</translation> <translation id="8226222018808695353">Taqiqlangan</translation> @@ -7549,6 +7562,7 @@ <translation id="8314381333424235892">Kengaytma oʻrnatilmagan yoki mavjud emas</translation> <translation id="831440797644402910">Jild ochilmadi</translation> <translation id="8314835274931377415">Switch Accessni sozlash boshlansinmi?</translation> +<translation id="8317582043908962055">P&DF matnni tanitish</translation> <translation id="8317671367883557781">Yangi tarmoqqa ulanish</translation> <translation id="8319414634934645341">Kalitdan keng miqyosda foydalanish</translation> <translation id="8321837372750396788">Bu <ph name="DEVICE_TYPE" /> <ph name="MANAGER" /> tomonidan boshqariladi.</translation> @@ -8434,6 +8448,7 @@ <translation id="9203398526606335860">&Ma’lumotlarni yig‘ish yoniq</translation> <translation id="9203904171912129171">Qurilmani tanlang</translation> <translation id="9206889157914079472">Ekran qulfida stilus yordamida qaydlar yaratish</translation> +<translation id="9208192193641542858">Qurilmadagi axborot eski parolingiz bilan himoyalangan. Parolingiz oʻzgargan boʻlsa, eskisini kiriting.</translation> <translation id="9209563766569767417">Linux konteyneri sozlamalari tekshirilmoqda</translation> <translation id="9209689095351280025">Saytlar sizni internet boʻylab kuzatadigan cookie fayllardan foydalana olmaydi.</translation> <translation id="9211177926627870898">Yangilash zarur</translation>
diff --git a/chrome/app/resources/generated_resources_vi.xtb b/chrome/app/resources/generated_resources_vi.xtb index 52d3c7bc..6a66de3 100644 --- a/chrome/app/resources/generated_resources_vi.xtb +++ b/chrome/app/resources/generated_resources_vi.xtb
@@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">Chạm ngón tay của bạn vào cảm biến vân tay</translation> <translation id="3615579745882581859">Đang quét <ph name="FILE_NAME" />.</translation> <translation id="3615596877979647433">Thiếu khóa. Nhấn một phím trên bàn phím để tùy chỉnh</translation> +<translation id="3616113530831147358">Âm thanh</translation> <translation id="3616741288025931835">&Xoá Dữ liệu Duyệt web...</translation> <translation id="3617891479562106823">Không có nền. Hãy thử lại sau.</translation> <translation id="3619115746895587757">Cà phê cappuccino</translation>
diff --git a/chrome/app/resources/generated_resources_zh-CN.xtb b/chrome/app/resources/generated_resources_zh-CN.xtb index c0e0045..d03cb70 100644 --- a/chrome/app/resources/generated_resources_zh-CN.xtb +++ b/chrome/app/resources/generated_resources_zh-CN.xtb
@@ -2748,6 +2748,7 @@ <translation id="3615073365085224194">用手指轻触指纹传感器</translation> <translation id="3615579745882581859">正在扫描“<ph name="FILE_NAME" />”。</translation> <translation id="3615596877979647433">缺少按键。按一个键盘按键即可自定义</translation> +<translation id="3616113530831147358">音频</translation> <translation id="3616741288025931835">清除浏览数据(&C)...</translation> <translation id="3617891479562106823">背景不可用。请稍后重试。</translation> <translation id="3619115746895587757">卡布奇诺</translation>
diff --git a/chrome/app/resources/generated_resources_zh-HK.xtb b/chrome/app/resources/generated_resources_zh-HK.xtb index c6d2b894..41c30e5e 100644 --- a/chrome/app/resources/generated_resources_zh-HK.xtb +++ b/chrome/app/resources/generated_resources_zh-HK.xtb
@@ -218,7 +218,7 @@ <translation id="1197199342062592414">開始使用</translation> <translation id="11978075283960463">儲存在應用程式中的資料大小:<ph name="APP_SIZE" /></translation> <translation id="1197935538609051549">停用</translation> -<translation id="1198066799963193307">低視能語音工具</translation> +<translation id="1198066799963193307">低視力語音工具</translation> <translation id="119944043368869598">全部清除</translation> <translation id="1199814941632954229">正在為這些憑證設定檔佈建憑證</translation> <translation id="120069043972472860">無法觀看</translation> @@ -1512,7 +1512,7 @@ <translation id="2371076942591664043">完成後開啟(&D)</translation> <translation id="2373666622366160481">依紙張大小自動調整</translation> <translation id="2375406435414127095">連線至您的手機</translation> -<translation id="2376056713414548745">朗讀內容</translation> +<translation id="2376056713414548745">朗讀</translation> <translation id="2377588536920405462">關閉裝置的主要位置資訊設定,即可關閉定位服務。您也可以在位置資訊設定中關閉使用 Wi‑Fi、流動網絡和感應器確定位置的功能。</translation> <translation id="2377667304966270281">嚴重錯誤</translation> <translation id="237828693408258535">要翻譯此網頁嗎?</translation> @@ -2341,7 +2341,7 @@ <translation id="3163511056918491211">隨時輕鬆還原您的資料或轉用裝置。您的備份會上載至 Google,並透過您的 Google 帳戶密碼加密。</translation> <translation id="3164329792803560526">正在將此分頁與 <ph name="APP_NAME" /> 共用</translation> <translation id="3165390001037658081">部分流動網絡供應商可能會封鎖此功能。</translation> -<translation id="3169930038976362151">選擇符合自身需求的主題。如要變更主題、桌布、螢幕保護程式和其他設定,只要按住桌面即可。</translation> +<translation id="3169930038976362151">選擇切合您需要的主題。如要變更主題、桌布、螢幕保護程式和其他設定,只要輕觸並按住桌面即可。</translation> <translation id="3170072451822350649">您也可以略過登入程序,<ph name="LINK_START" />以訪客身分瀏覽<ph name="LINK_END" />。</translation> <translation id="31774765611822736">新分頁位於左側</translation> <translation id="3177909033752230686">網頁語言:</translation> @@ -2772,6 +2772,7 @@ <translation id="3615073365085224194">請以手指輕觸指紋感應器</translation> <translation id="3615579745882581859">正在掃瞄「<ph name="FILE_NAME" />」。</translation> <translation id="3615596877979647433">缺少按鍵。按下鍵盤按鍵即可自訂</translation> +<translation id="3616113530831147358">音效檔案</translation> <translation id="3616741288025931835">清除瀏覽數據(&C)…</translation> <translation id="3617891479562106823">無法自訂背景,請稍候再試。</translation> <translation id="3619115746895587757">泡沫咖啡</translation> @@ -3215,7 +3216,7 @@ <translation id="402184264550408568">(TCP)</translation> <translation id="4021909830315618592">複製版本詳情</translation> <translation id="4021941025609472374">關閉左側分頁</translation> -<translation id="402211067068791756">這會清除目前顯示的網站所儲存的資料,共 <ph name="TOTAL_USAGE" /></translation> +<translation id="402211067068791756">此操作會清除已顯示網站儲存的資料,共 <ph name="TOTAL_USAGE" /></translation> <translation id="4022426551683927403">新增到字典(&A)</translation> <translation id="4025039777635956441">將已選取的網站設定為靜音</translation> <translation id="4028467762035011525">新增輸入方法</translation> @@ -3465,7 +3466,7 @@ <translation id="4281844954008187215">服務條款</translation> <translation id="4282196459431406533">Smart Lock 已啟用</translation> <translation id="4284755288573763878">要關閉「強化安全瀏覽」功能嗎?</translation> -<translation id="4284903252249997120">ChromeVox 螢幕閱讀器和隨選朗讀</translation> +<translation id="4284903252249997120">ChromeVox 螢幕閱讀器和選取以朗讀</translation> <translation id="4285418559658561636">更新密碼</translation> <translation id="4285498937028063278">取消固定</translation> <translation id="428565720843367874">掃描這個檔案時,防毒軟件發生意外錯誤。</translation> @@ -5382,7 +5383,7 @@ <translation id="6200151268994853226">管理擴充程式</translation> <translation id="6201608810045805374">要移除此帳戶嗎?</translation> <translation id="6202304368170870640">您可使用 PIN 登入或解鎖裝置。</translation> -<translation id="6206199626856438589">系統會將你登出這些目前顯示的網站,包含已開啟的分頁</translation> +<translation id="6206199626856438589">您將會從已顯示的網站 (包括已開啟的分頁) 中登出</translation> <translation id="6206311232642889873">複製圖片(&Y)</translation> <translation id="6207200176136643843">重設為預設縮放等級</translation> <translation id="6207937957461833379">國家/地區</translation> @@ -5929,7 +5930,7 @@ <translation id="6733620523445262364">建立咗 <ph name="BOOKMARK_TITLE" />。</translation> <translation id="6735304988756581115">顯示 Cookie 和其他網站數據…</translation> <translation id="6736243959894955139">位址</translation> -<translation id="6737393581255281855">要清除顯示的資料嗎?</translation> +<translation id="6737393581255281855">要清除已顯示的資料嗎?</translation> <translation id="6737663862851963468">移除 Kerberos 票證</translation> <translation id="6738430949033571771">正在驗證帳戶…</translation> <translation id="6739923123728562974">顯示桌面捷徑</translation> @@ -7609,7 +7610,7 @@ <translation id="8366396658833131068">您的網絡連線已恢復。請選取其他網絡,或按下方的 [繼續] 按鈕啟動 Kiosk 應用程式。</translation> <translation id="8366694425498033255">選字鍵</translation> <translation id="8368859634510605990">開啟所有書籤(&O)</translation> -<translation id="8369028061188107403">這會清除目前顯示的網站所儲存的資料 (共 <ph name="TOTAL_USAGE" />),以及所安裝的應用程式</translation> +<translation id="8369028061188107403">此操作會清除已顯示網站儲存的資料 (共 <ph name="TOTAL_USAGE" />),以及所安裝的應用程式</translation> <translation id="8370294614544004647">蓋上手提電腦時進入休眠狀態</translation> <translation id="8371695176452482769">請說話</translation> <translation id="8371925839118813971">{NUM_TABS,plural, =1{將單一網站靜音}other{將多個網站靜音}}</translation>
diff --git a/chrome/app/resources/generated_resources_zh-TW.xtb b/chrome/app/resources/generated_resources_zh-TW.xtb index e24c2b5..e40670c 100644 --- a/chrome/app/resources/generated_resources_zh-TW.xtb +++ b/chrome/app/resources/generated_resources_zh-TW.xtb
@@ -2757,6 +2757,7 @@ <translation id="3615073365085224194">請以手指輕觸指紋感應器</translation> <translation id="3615579745882581859">正在掃描「<ph name="FILE_NAME" />」。</translation> <translation id="3615596877979647433">缺少按鍵。按下鍵盤按鍵即可自訂</translation> +<translation id="3616113530831147358">音訊</translation> <translation id="3616741288025931835">清除瀏覽資料(&C)...</translation> <translation id="3617891479562106823">目前無法存取背景,請稍後再試。</translation> <translation id="3619115746895587757">卡布奇諾</translation>
diff --git a/chrome/app/resources/generated_resources_zu.xtb b/chrome/app/resources/generated_resources_zu.xtb index 8c01a68..2022a95 100644 --- a/chrome/app/resources/generated_resources_zu.xtb +++ b/chrome/app/resources/generated_resources_zu.xtb
@@ -2773,6 +2773,7 @@ <translation id="3615073365085224194">Thinta inzwa yezigxivizo zeminwe ngomunwe wakho</translation> <translation id="3615579745882581859">I-<ph name="FILE_NAME" /> iyaskenwa</translation> <translation id="3615596877979647433">Ukhiye uyashoda. Cindezela ukhiye wekhibhodi ukuze wenze ngendlela oyifisayo</translation> +<translation id="3616113530831147358">Umsindo</translation> <translation id="3616741288025931835">Sula idatha yokudlulisa amehlo...</translation> <translation id="3617891479562106823">Ingemuva alitholakali. Zama futhi kamuva.</translation> <translation id="3619115746895587757">I-Cappuccino</translation>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index fe3c333..1abb46239 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -5132,6 +5132,7 @@ "//chromeos/ash/components/assistant:buildflags", "//chromeos/ash/components/dbus/concierge", "//chromeos/ash/components/dbus/session_manager", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/userdataauth:userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/ash/components/memory", @@ -5157,7 +5158,6 @@ "//chromeos/dbus/power", "//chromeos/dbus/tpm_manager", "//chromeos/dbus/tpm_manager:tpm_manager_proto", - "//chromeos/dbus/update_engine", "//chromeos/dbus/util", "//chromeos/login/login_state", "//chromeos/network",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 2057fb7..8d09284 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -6501,6 +6501,11 @@ flag_descriptions::kEncryptedClientHelloDescription, kOsAll, FEATURE_VALUE_TYPE(net::features::kEncryptedClientHello)}, + {"use-dns-https-svcb-alpn", flag_descriptions::kUseDnsHttpsSvcbAlpnName, + flag_descriptions::kUseDnsHttpsSvcbAlpnDescription, + kOsLinux | kOsMac | kOsWin | kOsCrOS | kOsAndroid, + FEATURE_VALUE_TYPE(net::features::kUseDnsHttpsSvcbAlpn)}, + {"web-bundles", flag_descriptions::kWebBundlesName, flag_descriptions::kWebBundlesDescription, kOsAll, FEATURE_VALUE_TYPE(features::kWebBundles)},
diff --git a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc index 541bfec..bcbc7b3a 100644 --- a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc +++ b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc
@@ -236,11 +236,7 @@ class PublisherTest : public extensions::ExtensionServiceTestBase { public: - PublisherTest() { - scoped_feature_list_.InitAndEnableFeature( - kAppServiceOnAppTypeInitializedWithoutMojom); - } - + PublisherTest() = default; PublisherTest(const PublisherTest&) = delete; PublisherTest& operator=(const PublisherTest&) = delete; @@ -646,9 +642,7 @@ crosapi::browser_util::SetLacrosEnabledForTest(true); scoped_feature_list_.Reset(); scoped_feature_list_.InitWithFeatures( - {features::kWebAppsCrosapi, chromeos::features::kLacrosPrimary, - kAppServiceOnAppTypeInitializedWithoutMojom}, - {}); + {features::kWebAppsCrosapi, chromeos::features::kLacrosPrimary}, {}); } StandaloneBrowserPublisherTest(const StandaloneBrowserPublisherTest&) = @@ -1026,9 +1020,7 @@ BorealisPublisherTest() { scoped_feature_list_.Reset(); scoped_feature_list_.InitWithFeatures( - {features::kBorealis, chromeos::features::kBorealisPermitted, - kAppServiceOnAppTypeInitializedWithoutMojom}, - {}); + {features::kBorealis, chromeos::features::kBorealisPermitted}, {}); } };
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index b41b427..ec2a7c4 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -2010,6 +2010,7 @@ "//chromeos/ash/components/dbus/anomaly_detector:proto", "//chromeos/ash/components/dbus/authpolicy", "//chromeos/ash/components/dbus/authpolicy:authpolicy_proto", + "//chromeos/ash/components/dbus/chunneld", "//chromeos/ash/components/dbus/cicerone", "//chromeos/ash/components/dbus/cicerone:cicerone_proto", "//chromeos/ash/components/dbus/concierge", @@ -2023,6 +2024,7 @@ "//chromeos/ash/components/dbus/session_manager", "//chromeos/ash/components/dbus/system_clock", "//chromeos/ash/components/dbus/system_proxy:system_proxy_proto", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/ash/components/memory", @@ -2038,7 +2040,6 @@ "//chromeos/dbus:vm_launch_proto", "//chromeos/dbus/attestation", "//chromeos/dbus/attestation:attestation_proto", - "//chromeos/dbus/chunneld", "//chromeos/dbus/common", "//chromeos/dbus/constants", "//chromeos/dbus/cros_disks", @@ -2053,7 +2054,6 @@ "//chromeos/dbus/runtime_probe", "//chromeos/dbus/tpm_manager", "//chromeos/dbus/tpm_manager:tpm_manager_proto", - "//chromeos/dbus/update_engine", "//chromeos/login/login_state", "//chromeos/metrics", "//chromeos/network",
diff --git a/chrome/browser/ash/app_mode/kiosk_app_update_service_browsertest.cc b/chrome/browser/ash/app_mode/kiosk_app_update_service_browsertest.cc index 31fff42..bd6be64 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_update_service_browsertest.cc +++ b/chrome/browser/ash/app_mode/kiosk_app_update_service_browsertest.cc
@@ -33,7 +33,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc b/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc index 08c1054..de9ecba 100644 --- a/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc +++ b/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc
@@ -38,7 +38,7 @@ #include "chrome/services/keymaster/public/mojom/cert_store.mojom.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "components/policy/policy_constants.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h"
diff --git a/chrome/browser/ash/borealis/borealis_context_unittest.cc b/chrome/browser/ash/borealis/borealis_context_unittest.cc index df2bc27..e605247 100644 --- a/chrome/browser/ash/borealis/borealis_context_unittest.cc +++ b/chrome/browser/ash/borealis/borealis_context_unittest.cc
@@ -22,10 +22,10 @@ #include "chrome/browser/ash/guest_os/dbus_test_helper.h" #include "chrome/browser/ash/guest_os/guest_os_stability_monitor.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" -#include "chromeos/dbus/chunneld/fake_chunneld_client.h" #include "components/exo/shell_surface_util.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -138,8 +138,8 @@ } TEST_F(BorealisContextTest, ChunneldFailure) { - auto* chunneld_client = static_cast<chromeos::FakeChunneldClient*>( - chromeos::ChunneldClient::Get()); + auto* chunneld_client = + static_cast<ash::FakeChunneldClient*>(ash::ChunneldClient::Get()); chunneld_client->NotifyChunneldStopped(); histogram_tester_.ExpectUniqueSample(
diff --git a/chrome/browser/ash/chrome_browser_main_parts_ash.cc b/chrome/browser/ash/chrome_browser_main_parts_ash.cc index a0d621e5..b8fc3fc 100644 --- a/chrome/browser/ash/chrome_browser_main_parts_ash.cc +++ b/chrome/browser/ash/chrome_browser_main_parts_ash.cc
@@ -203,6 +203,7 @@ #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h" #include "chromeos/ash/components/network/fast_transition_observer.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector_stub.h" #include "chromeos/ash/services/cros_healthd/private/cpp/data_collector.h" #include "chromeos/ash/services/cros_healthd/public/cpp/service_connection.h" @@ -215,7 +216,6 @@ #include "chromeos/dbus/power/power_policy_controller.h" #include "chromeos/dbus/util/version_loader.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/system_token_cert_db_storage.h" #include "chromeos/services/machine_learning/public/cpp/service_connection.h"
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index ddf062a..2ba4de0 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -246,6 +246,7 @@ "//chrome/common:constants", "//chromeos/ash/components/dbus/lorgnette_manager:lorgnette_proto", "//chromeos/ash/components/dbus/session_manager", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_browser", @@ -259,7 +260,6 @@ "//chromeos/dbus/cros_disks", "//chromeos/dbus/power", "//chromeos/dbus/resourced", - "//chromeos/dbus/update_engine", "//chromeos/dbus/util", "//chromeos/login/login_state", "//chromeos/network",
diff --git a/chrome/browser/ash/crosapi/networking_private_ash.h b/chrome/browser/ash/crosapi/networking_private_ash.h index d6d745d..c0867701 100644 --- a/chrome/browser/ash/crosapi/networking_private_ash.h +++ b/chrome/browser/ash/crosapi/networking_private_ash.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_ASH_CROSAPI_NETWORKING_PRIVATE_ASH_H_ #include "base/scoped_observation.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" #include "chromeos/crosapi/mojom/networking_private.mojom.h" -#include "chromeos/network/network_certificate_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
diff --git a/chrome/browser/ash/crosapi/vpn_service_ash.cc b/chrome/browser/ash/crosapi/vpn_service_ash.cc index 8ceb728e..04d98ea 100644 --- a/chrome/browser/ash/crosapi/vpn_service_ash.cc +++ b/chrome/browser/ash/crosapi/vpn_service_ash.cc
@@ -17,10 +17,10 @@ #include "chrome/browser/ash/crosapi/crosapi_ash.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_third_party_vpn_driver_client.h" #include "chromeos/dbus/shill/shill_third_party_vpn_observer.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/ash/crosapi/vpn_service_ash.h b/chrome/browser/ash/crosapi/vpn_service_ash.h index 32bb6547..9f07731 100644 --- a/chrome/browser/ash/crosapi/vpn_service_ash.h +++ b/chrome/browser/ash/crosapi/vpn_service_ash.h
@@ -17,11 +17,11 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "chrome/common/extensions/api/vpn_provider.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" #include "chromeos/crosapi/mojom/vpn_service.mojom.h" #include "chromeos/dbus/shill/shill_third_party_vpn_driver_client.h" #include "chromeos/dbus/shill/shill_third_party_vpn_observer.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_configuration_observer.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h"
diff --git a/chrome/browser/ash/crostini/ansible/ansible_management_service_unittest.cc b/chrome/browser/ash/crostini/ansible/ansible_management_service_unittest.cc index 2147a47..9dda7021 100644 --- a/chrome/browser/ash/crostini/ansible/ansible_management_service_unittest.cc +++ b/chrome/browser/ash/crostini/ansible/ansible_management_service_unittest.cc
@@ -9,10 +9,10 @@ #include "chrome/browser/ash/crostini/crostini_pref_names.h" #include "chrome/browser/ash/crostini/crostini_test_util.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" @@ -35,7 +35,7 @@ public: AnsibleManagementServiceTest() { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -69,7 +69,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_disk_unittest.cc b/chrome/browser/ash/crostini/crostini_disk_unittest.cc index 227d4660..b2ec5e7 100644 --- a/chrome/browser/ash/crostini/crostini_disk_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_disk_unittest.cc
@@ -12,12 +12,12 @@ #include "chrome/browser/ash/crostini/crostini_test_helper.h" #include "chrome/browser/ash/crostini/crostini_types.mojom.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_service.pb.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock-matchers.h" @@ -55,7 +55,7 @@ public: CrostiniDiskTestDbus() { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -75,7 +75,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_export_import_unittest.cc b/chrome/browser/ash/crostini/crostini_export_import_unittest.cc index ecaf3ff7..7786a0f 100644 --- a/chrome/browser/ash/crostini/crostini_export_import_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_export_import_unittest.cc
@@ -15,13 +15,13 @@ #include "chrome/browser/notifications/notification_display_service_factory.h" #include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_service.pb.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" @@ -126,7 +126,7 @@ : default_container_id_(DefaultContainerId()), custom_container_id_(kCrostiniDefaultVmType, "MyVM", "MyContainer") { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -141,7 +141,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_installer_unittest.cc b/chrome/browser/ash/crostini/crostini_installer_unittest.cc index 006c7ca..b046461c 100644 --- a/chrome/browser/ash/crostini/crostini_installer_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_installer_unittest.cc
@@ -21,13 +21,13 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_service.pb.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h" #include "content/public/test/browser_task_environment.h" @@ -117,7 +117,7 @@ chromeos::DlcserviceClient::InitializeFake(); chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); SetOSRelease(); waiting_fake_concierge_client_ = @@ -155,7 +155,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); chromeos::DlcserviceClient::Shutdown();
diff --git a/chrome/browser/ash/crostini/crostini_manager_unittest.cc b/chrome/browser/ash/crostini/crostini_manager_unittest.cc index d4d764e..ab51664 100644 --- a/chrome/browser/ash/crostini/crostini_manager_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_manager_unittest.cc
@@ -38,6 +38,7 @@ #include "chrome/test/base/testing_profile.h" #include "chromeos/ash/components/dbus/anomaly_detector/anomaly_detector_client.h" #include "chromeos/ash/components/dbus/anomaly_detector/fake_anomaly_detector_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_service.pb.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" @@ -47,7 +48,6 @@ #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/ash/components/dbus/userdataauth/fake_cryptohome_misc_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h" #include "components/account_id/account_id.h" @@ -194,7 +194,7 @@ browser_part_(g_browser_process->platform_part()) { chromeos::DBusThreadManager::Initialize(); ash::AnomalyDetectorClient::InitializeFake(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -213,7 +213,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_package_notification_unittest.cc b/chrome/browser/ash/crostini/crostini_package_notification_unittest.cc index 13d116e..798b8f9 100644 --- a/chrome/browser/ash/crostini/crostini_package_notification_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_package_notification_unittest.cc
@@ -11,10 +11,10 @@ #include "chrome/browser/ash/crostini/crostini_test_helper.h" #include "chrome/browser/ash/crostini/crostini_util.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -36,7 +36,7 @@ void SetUp() override { DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -59,7 +59,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_package_service_unittest.cc b/chrome/browser/ash/crostini/crostini_package_service_unittest.cc index bd2650d..a1aff2a 100644 --- a/chrome/browser/ash/crostini/crostini_package_service_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_package_service_unittest.cc
@@ -19,13 +19,13 @@ #include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/vm_applications/apps.pb.h" #include "content/public/test/browser_task_environment.h" @@ -170,7 +170,7 @@ void SetUp() override { DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -232,7 +232,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_port_forwarder_unittest.cc b/chrome/browser/ash/crostini/crostini_port_forwarder_unittest.cc index b60bf5074..f765958f 100644 --- a/chrome/browser/ash/crostini/crostini_port_forwarder_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_port_forwarder_unittest.cc
@@ -8,10 +8,10 @@ #include "chrome/browser/ash/crostini/crostini_manager.h" #include "chrome/browser/ash/crostini/crostini_test_helper.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/permission_broker/fake_permission_broker_client.h" #include "content/public/test/browser_task_environment.h" @@ -47,7 +47,7 @@ void SetUp() override { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -74,7 +74,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_sshfs_unittest.cc b/chrome/browser/ash/crostini/crostini_sshfs_unittest.cc index 85644b42..4292c94 100644 --- a/chrome/browser/ash/crostini/crostini_sshfs_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_sshfs_unittest.cc
@@ -21,11 +21,11 @@ #include "chrome/browser/ash/file_manager/volume_manager.h" #include "chrome/browser/ash/file_manager/volume_manager_factory.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/cros_disks/cros_disks_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/vm_applications/apps.pb.h" @@ -67,7 +67,7 @@ public: CrostiniSshfsHelperTest() { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -107,7 +107,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_upgrade_available_notification_unittest.cc b/chrome/browser/ash/crostini/crostini_upgrade_available_notification_unittest.cc index f5473a2..3607369e 100644 --- a/chrome/browser/ash/crostini/crostini_upgrade_available_notification_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_upgrade_available_notification_unittest.cc
@@ -17,11 +17,11 @@ #include "chrome/common/webui_url_constants.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_service.pb.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -47,7 +47,7 @@ void SetUp() override { BrowserWithTestWindowTest::SetUp(); chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -65,7 +65,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/crostini/crostini_util_unittest.cc b/chrome/browser/ash/crostini/crostini_util_unittest.cc index bea1208b..47b5531 100644 --- a/chrome/browser/ash/crostini/crostini_util_unittest.cc +++ b/chrome/browser/ash/crostini/crostini_util_unittest.cc
@@ -15,11 +15,11 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h" #include "content/public/test/browser_task_environment.h" @@ -48,7 +48,7 @@ TestingBrowserProcess::GetGlobal())), browser_part_(g_browser_process->platform_part()) { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -60,7 +60,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/dbus/ash_dbus_helper.cc b/chrome/browser/ash/dbus/ash_dbus_helper.cc index e655166..d476a6b7 100644 --- a/chrome/browser/ash/dbus/ash_dbus_helper.cc +++ b/chrome/browser/ash/dbus/ash_dbus_helper.cc
@@ -20,6 +20,7 @@ #include "chromeos/ash/components/dbus/audio/cras_audio_client.h" #include "chromeos/ash/components/dbus/authpolicy/authpolicy_client.h" #include "chromeos/ash/components/dbus/biod/biod_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/cros_healthd/cros_healthd_client.h" @@ -41,6 +42,7 @@ #include "chromeos/ash/components/dbus/system_clock/system_clock_client.h" #include "chromeos/ash/components/dbus/system_proxy/system_proxy_client.h" #include "chromeos/ash/components/dbus/typecd/typecd_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/dbus/upstart/upstart_client.h" #include "chromeos/ash/components/dbus/userdataauth/arc_quota_client.h" #include "chromeos/ash/components/dbus/userdataauth/cryptohome_misc_client.h" @@ -55,7 +57,6 @@ #include "chromeos/dbus/arc/arc_sensor_service_client.h" #include "chromeos/dbus/attestation/attestation_client.h" #include "chromeos/dbus/cdm_factory_daemon/cdm_factory_daemon_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/constants/dbus_paths.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h" @@ -74,7 +75,6 @@ #include "chromeos/dbus/smbprovider/smb_provider_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" #include "chromeos/dbus/u2f/u2f_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h" #include "device/bluetooth/floss/floss_dbus_manager.h" #include "device/bluetooth/floss/floss_features.h" @@ -129,7 +129,7 @@ InitializeDBusClient<AuthPolicyClient>(bus); InitializeDBusClient<BiodClient>(bus); // For device::Fingerprint. InitializeDBusClient<chromeos::CdmFactoryDaemonClient>(bus); - InitializeDBusClient<chromeos::ChunneldClient>(bus); + InitializeDBusClient<ChunneldClient>(bus); InitializeDBusClient<CiceroneClient>(bus); // ConciergeClient depends on CiceroneClient. InitializeDBusClient<ConciergeClient>(bus); @@ -171,7 +171,7 @@ InitializeDBusClient<chromeos::TpmManagerClient>(bus); InitializeDBusClient<TypecdClient>(bus); InitializeDBusClient<chromeos::U2FClient>(bus); - InitializeDBusClient<chromeos::UpdateEngineClient>(bus); + InitializeDBusClient<UpdateEngineClient>(bus); InitializeDBusClient<UserDataAuthClient>(bus); InitializeDBusClient<UpstartClient>(bus); InitializeDBusClient<VirtualFileProviderClient>(bus); @@ -235,7 +235,7 @@ VirtualFileProviderClient::Shutdown(); UpstartClient::Shutdown(); UserDataAuthClient::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + UpdateEngineClient::Shutdown(); chromeos::U2FClient::Shutdown(); TypecdClient::Shutdown(); chromeos::TpmManagerClient::Shutdown(); @@ -282,7 +282,7 @@ CrasAudioClient::Shutdown(); ConciergeClient::Shutdown(); CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ChunneldClient::Shutdown(); chromeos::CdmFactoryDaemonClient::Shutdown(); BiodClient::Shutdown(); AuthPolicyClient::Shutdown();
diff --git a/chrome/browser/ash/eol_notification.cc b/chrome/browser/ash/eol_notification.cc index 69f5f70..85c285c 100644 --- a/chrome/browser/ash/eol_notification.cc +++ b/chrome/browser/ash/eol_notification.cc
@@ -20,7 +20,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_service.h" #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h"
diff --git a/chrome/browser/ash/eol_notification.h b/chrome/browser/ash/eol_notification.h index d39dce5..f09a757 100644 --- a/chrome/browser/ash/eol_notification.h +++ b/chrome/browser/ash/eol_notification.h
@@ -10,7 +10,7 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" #include "ui/message_center/public/cpp/notification.h"
diff --git a/chrome/browser/ash/eol_notification_unittest.cc b/chrome/browser/ash/eol_notification_unittest.cc index ffd4b43..5f9fcd8 100644 --- a/chrome/browser/ash/eol_notification_unittest.cc +++ b/chrome/browser/ash/eol_notification_unittest.cc
@@ -17,8 +17,8 @@ #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h"
diff --git a/chrome/browser/ash/exo/chrome_data_exchange_delegate_unittest.cc b/chrome/browser/ash/exo/chrome_data_exchange_delegate_unittest.cc index e466de92..d11ae09 100644 --- a/chrome/browser/ash/exo/chrome_data_exchange_delegate_unittest.cc +++ b/chrome/browser/ash/exo/chrome_data_exchange_delegate_unittest.cc
@@ -24,11 +24,11 @@ #include "chrome/browser/ash/guest_os/guest_os_share_path.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_util.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/exo/shell_surface_util.h" #include "content/public/common/drop_data.h" @@ -74,7 +74,7 @@ public: void SetUp() override { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ConciergeClient::InitializeFake(); SeneschalClient::InitializeFake(); @@ -122,7 +122,7 @@ SeneschalClient::Shutdown(); ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/file_manager/file_manager_jstest.cc b/chrome/browser/ash/file_manager/file_manager_jstest.cc index 71ee153..e5fa4ef 100644 --- a/chrome/browser/ash/file_manager/file_manager_jstest.cc +++ b/chrome/browser/ash/file_manager/file_manager_jstest.cc
@@ -298,3 +298,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, RecentDateBucketTest) { RunTestURL("common/js/recent_date_bucket_unittest.js"); } + +IN_PROC_BROWSER_TEST_F(FileManagerJsTest, XfBreadcrumbs) { + RunTestURL("widgets/xf_breadcrumbs_unittest.js"); +}
diff --git a/chrome/browser/ash/file_manager/path_util_unittest.cc b/chrome/browser/ash/file_manager/path_util_unittest.cc index 49e5453d..a2dff7e 100644 --- a/chrome/browser/ash/file_manager/path_util_unittest.cc +++ b/chrome/browser/ash/file_manager/path_util_unittest.cc
@@ -43,10 +43,10 @@ #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/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/cros_disks/cros_disks_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/account_id/account_id.h" @@ -331,7 +331,7 @@ // Initialize DBUS and running container. chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -508,7 +508,7 @@ profile_.reset(); ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/file_manager/trash_unittest_base.cc b/chrome/browser/ash/file_manager/trash_unittest_base.cc index 02e6ec9b..4044541 100644 --- a/chrome/browser/ash/file_manager/trash_unittest_base.cc +++ b/chrome/browser/ash/file_manager/trash_unittest_base.cc
@@ -13,8 +13,8 @@ #include "chrome/browser/ash/file_manager/volume_manager.h" #include "chrome/browser/ash/file_manager/volume_manager_factory.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "storage/browser/file_system/external_mount_points.h" #include "storage/browser/test/test_file_system_context.h" @@ -62,7 +62,7 @@ ASSERT_TRUE(base::CreateDirectory(downloads_dir_)); chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -100,7 +100,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/guest_os/dbus_test_helper.cc b/chrome/browser/ash/guest_os/dbus_test_helper.cc index 9878161..f9d294cc 100644 --- a/chrome/browser/ash/guest_os/dbus_test_helper.cc +++ b/chrome/browser/ash/guest_os/dbus_test_helper.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/ash/guest_os/dbus_test_helper.h" +#include "chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" -#include "chromeos/dbus/chunneld/fake_chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/fake_dlcservice_client.h" @@ -76,11 +76,11 @@ FakeChunneldHelper::FakeChunneldHelper(BasicDBusHelper* basic_helper) { DCHECK(basic_helper); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); } FakeChunneldHelper::~FakeChunneldHelper() { - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); } FakeVmServicesHelper::FakeVmServicesHelper()
diff --git a/chrome/browser/ash/guest_os/guest_os_share_path_unittest.cc b/chrome/browser/ash/guest_os/guest_os_share_path_unittest.cc index a24de1e..b55c751 100644 --- a/chrome/browser/ash/guest_os/guest_os_share_path_unittest.cc +++ b/chrome/browser/ash/guest_os/guest_os_share_path_unittest.cc
@@ -33,6 +33,7 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" @@ -40,7 +41,6 @@ #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_service.pb.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h" #include "components/account_id/account_id.h" @@ -226,7 +226,7 @@ TestingBrowserProcess::GetGlobal())), browser_part_(g_browser_process->platform_part()) { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -244,7 +244,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/guest_os/guest_os_stability_monitor.cc b/chrome/browser/ash/guest_os/guest_os_stability_monitor.cc index 6c39106..ddd168e 100644 --- a/chrome/browser/ash/guest_os/guest_os_stability_monitor.cc +++ b/chrome/browser/ash/guest_os/guest_os_stability_monitor.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ash/guest_os/guest_os_stability_monitor.h" #include "base/metrics/histogram_functions.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" namespace guest_os { @@ -33,7 +33,7 @@ base::BindOnce(&GuestOsStabilityMonitor::SeneschalStarted, weak_ptr_factory_.GetWeakPtr())); - auto* chunneld_client = chromeos::ChunneldClient::Get(); + auto* chunneld_client = ash::ChunneldClient::Get(); DCHECK(chunneld_client); chunneld_client->WaitForServiceToBeAvailable( base::BindOnce(&GuestOsStabilityMonitor::ChunneldStarted, @@ -69,7 +69,7 @@ void GuestOsStabilityMonitor::ChunneldStarted(bool is_available) { DCHECK(is_available); - auto* chunneld_client = chromeos::ChunneldClient::Get(); + auto* chunneld_client = ash::ChunneldClient::Get(); DCHECK(chunneld_client); chunneld_observer_.Observe(chunneld_client); }
diff --git a/chrome/browser/ash/guest_os/guest_os_stability_monitor.h b/chrome/browser/ash/guest_os/guest_os_stability_monitor.h index c53ec800..1168ef88 100644 --- a/chrome/browser/ash/guest_os/guest_os_stability_monitor.h +++ b/chrome/browser/ash/guest_os/guest_os_stability_monitor.h
@@ -7,10 +7,10 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" namespace guest_os { @@ -56,7 +56,7 @@ class GuestOsStabilityMonitor : ash::ConciergeClient::Observer, ash::CiceroneClient::Observer, ash::SeneschalClient::Observer, - chromeos::ChunneldClient::Observer { + ash::ChunneldClient::Observer { public: explicit GuestOsStabilityMonitor(const std::string& histogram); ~GuestOsStabilityMonitor() override; @@ -83,7 +83,7 @@ void SeneschalServiceStopped() override; void SeneschalServiceStarted() override; - // chromeos::ChunneldClient::Observer:: + // ash::ChunneldClient::Observer:: void ChunneldServiceStopped() override; void ChunneldServiceStarted() override; @@ -95,8 +95,7 @@ cicerone_observer_; base::ScopedObservation<ash::SeneschalClient, ash::SeneschalClient::Observer> seneschal_observer_; - base::ScopedObservation<chromeos::ChunneldClient, - chromeos::ChunneldClient::Observer> + base::ScopedObservation<ash::ChunneldClient, ash::ChunneldClient::Observer> chunneld_observer_; // Note: This should remain the last member so it'll be destroyed and
diff --git a/chrome/browser/ash/guest_os/guest_os_stability_monitor_unittest.cc b/chrome/browser/ash/guest_os/guest_os_stability_monitor_unittest.cc index 6b64246e..d7831fb 100644 --- a/chrome/browser/ash/guest_os/guest_os_stability_monitor_unittest.cc +++ b/chrome/browser/ash/guest_os/guest_os_stability_monitor_unittest.cc
@@ -14,14 +14,14 @@ #include "chrome/browser/ash/crostini/crostini_test_helper.h" #include "chrome/browser/ash/crostini/crostini_util.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/fake_seneschal_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" -#include "chromeos/dbus/chunneld/fake_chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -32,7 +32,7 @@ public: GuestOsStabilityMonitorTest() : task_env_() { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -60,7 +60,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); } @@ -129,8 +129,8 @@ } TEST_F(GuestOsStabilityMonitorTest, ChunneldFailure) { - auto* chunneld_client = static_cast<chromeos::FakeChunneldClient*>( - chromeos::ChunneldClient::Get()); + auto* chunneld_client = + static_cast<ash::FakeChunneldClient*>(ash::ChunneldClient::Get()); chunneld_client->NotifyChunneldStopped(); histogram_tester_.ExpectUniqueSample(crostini::kCrostiniStabilityHistogram,
diff --git a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc index e4d904a9..6d09c75 100644 --- a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc +++ b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc
@@ -26,10 +26,10 @@ #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/attestation/fake_attestation_client.h" #include "chromeos/dbus/constants/dbus_switches.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/test/chromeos_test_utils.h" #include "components/language/core/browser/pref_names.h"
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 41e39d3e..1727cc6 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc
@@ -50,8 +50,8 @@ #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/ash/login/enable_debugging_browsertest.cc b/chrome/browser/ash/login/enable_debugging_browsertest.cc index f2af2d4..52dd144d 100644 --- a/chrome/browser/ash/login/enable_debugging_browsertest.cc +++ b/chrome/browser/ash/login/enable_debugging_browsertest.cc
@@ -26,11 +26,11 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/constants/dbus_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/debug_daemon/fake_debug_daemon_client.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/helper.cc b/chrome/browser/ash/login/helper.cc index 5f3f1fe..bfc7f682 100644 --- a/chrome/browser/ash/login/helper.cc +++ b/chrome/browser/ash/login/helper.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_state.h"
diff --git a/chrome/browser/ash/login/oobe_interactive_ui_test.cc b/chrome/browser/ash/login/oobe_interactive_ui_test.cc index b0b614e..ab6c5657 100644 --- a/chrome/browser/ash/login/oobe_interactive_ui_test.cc +++ b/chrome/browser/ash/login/oobe_interactive_ui_test.cc
@@ -62,8 +62,8 @@ #include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/common/chrome_features.h" #include "chromeos/ash/components/assistant/buildflags.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/constants/chromeos_features.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/system/fake_statistics_provider.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/reset_browsertest.cc b/chrome/browser/ash/login/reset_browsertest.cc index ac889f0..28bf5d2b 100644 --- a/chrome/browser/ash/login/reset_browsertest.cc +++ b/chrome/browser/ash/login/reset_browsertest.cc
@@ -32,10 +32,10 @@ #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc b/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc index 1bcf04a..381bee26 100644 --- a/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc
@@ -18,11 +18,11 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/login/login_handler.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/proxy/proxy_config_handler.h" #include "chromeos/dbus/shill/fake_shill_manager_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h" #include "components/account_id/account_id.h"
diff --git a/chrome/browser/ash/login/screens/error_screen.cc b/chrome/browser/ash/login/screens/error_screen.cc index 8f58bd5..fc26a30 100644 --- a/chrome/browser/ash/login/screens/error_screen.cc +++ b/chrome/browser/ash/login/screens/error_screen.cc
@@ -34,10 +34,10 @@ #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/grit/browser_resources.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector_strategy.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "components/session_manager/core/session_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager.h"
diff --git a/chrome/browser/ash/login/screens/error_screen.h b/chrome/browser/ash/login/screens/error_screen.h index 45c0eb7..68c4807 100644 --- a/chrome/browser/ash/login/screens/error_screen.h +++ b/chrome/browser/ash/login/screens/error_screen.h
@@ -19,7 +19,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/reset_screen.cc b/chrome/browser/ash/login/screens/reset_screen.cc index 69e576d..345a21c0 100644 --- a/chrome/browser/ash/login/screens/reset_screen.cc +++ b/chrome/browser/ash/login/screens/reset_screen.cc
@@ -29,8 +29,8 @@ #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/ash/login/screens/reset_screen.h b/chrome/browser/ash/login/screens/reset_screen.h index f4f37da..ec8fdf1 100644 --- a/chrome/browser/ash/login/screens/reset_screen.h +++ b/chrome/browser/ash/login/screens/reset_screen.h
@@ -19,7 +19,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" class PrefRegistrySimple;
diff --git a/chrome/browser/ash/login/screens/update_required_screen.cc b/chrome/browser/ash/login/screens/update_required_screen.cc index d5d2df8..02f2767 100644 --- a/chrome/browser/ash/login/screens/update_required_screen.cc +++ b/chrome/browser/ash/login/screens/update_required_screen.cc
@@ -107,7 +107,7 @@ } void UpdateRequiredScreen::OnGetEolInfo( - const chromeos::UpdateEngineClient::EolInfo& info) { + const UpdateEngineClient::EolInfo& info) { // TODO(crbug.com/1020616) : Handle if the device is left on this screen // for long enough to reach Eol. if (switches::IsAueReachedForUpdateRequiredForTest() ||
diff --git a/chrome/browser/ash/login/screens/update_required_screen.h b/chrome/browser/ash/login/screens/update_required_screen.h index efc60cbb..a3b1463 100644 --- a/chrome/browser/ash/login/screens/update_required_screen.h +++ b/chrome/browser/ash/login/screens/update_required_screen.h
@@ -109,7 +109,7 @@ // The user requested an attempt to connect to the network should be made. void OnConnectRequested(); - void OnGetEolInfo(const chromeos::UpdateEngineClient::EolInfo& info); + void OnGetEolInfo(const UpdateEngineClient::EolInfo& info); void OnErrorScreenHidden();
diff --git a/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc b/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc index 8e8ef6f9..6eaf72b 100644 --- a/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc
@@ -32,10 +32,10 @@ #include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/constants/dbus_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/user_manager/user_manager.h" #include "content/public/test/browser_test.h" #include "dbus/object_path.h"
diff --git a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc index 34ca3766..638fe65 100644 --- a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc
@@ -20,12 +20,12 @@ #include "chrome/browser/ui/webui/chromeos/login/fake_update_required_screen_handler.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/screens/update_screen_browsertest.cc b/chrome/browser/ash/login/screens/update_screen_browsertest.cc index 96b47b0..8897b665 100644 --- a/chrome/browser/ash/login/screens/update_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/update_screen_browsertest.cc
@@ -33,10 +33,10 @@ #include "chrome/common/pref_names.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "content/public/test/browser_test.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -482,7 +482,7 @@ IN_PROC_BROWSER_TEST_P(UpdateScreenTest, TestErrorIssuingUpdateCheck) { update_engine_client()->set_update_check_result( - chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); + UpdateEngineClient::UPDATE_RESULT_FAILED); ShowUpdateScreen(); if (GetParam().is_eu && features::IsConsumerAutoUpdateToggleAllowed()) {
diff --git a/chrome/browser/ash/login/screens/update_screen_unittest.cc b/chrome/browser/ash/login/screens/update_screen_unittest.cc index ca216a3..0c87792 100644 --- a/chrome/browser/ash/login/screens/update_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/update_screen_unittest.cc
@@ -15,13 +15,13 @@ #include "chrome/browser/ash/login/wizard_context.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/session/user_session_initializer.cc b/chrome/browser/ash/login/session/user_session_initializer.cc index 0186ffee..b0ee90806 100644 --- a/chrome/browser/ash/login/session/user_session_initializer.cc +++ b/chrome/browser/ash/login/session/user_session_initializer.cc
@@ -46,7 +46,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/peripheral_data_access_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/pciguard/pciguard_client.h" -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index 46355fe1..d7693b0 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -563,6 +563,12 @@ content::GetNetworkConnectionTrackerFromUIThread( base::BindOnce(&UserSessionManager::SetNetworkConnectionTracker, weak_factory_.GetWeakPtr())); + // TODO(crbug/1341307): Remove the log after the feature settles in Stable. + LOG(WARNING) << "UseAuthsessionAuthentication experiment is " + << (base::FeatureList::IsEnabled( + ash::features::kUseAuthsessionAuthentication) + ? "enabled" + : "disabled"); } UserSessionManager::~UserSessionManager() {
diff --git a/chrome/browser/ash/login/test/oobe_base_test.cc b/chrome/browser/ash/login/test/oobe_base_test.cc index bd4a639..646cdaa1 100644 --- a/chrome/browser/ash/login/test/oobe_base_test.cc +++ b/chrome/browser/ash/login/test/oobe_base_test.cc
@@ -34,9 +34,9 @@ #include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/chrome_switches.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/fake_shill_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/policy/core/common/policy_switches.h" #include "components/user_manager/fake_user_manager.h" #include "content/public/common/content_switches.h"
diff --git a/chrome/browser/ash/login/test/oobe_base_test.h b/chrome/browser/ash/login/test/oobe_base_test.h index 7f2b709b..bb4cfec 100644 --- a/chrome/browser/ash/login/test/oobe_base_test.h +++ b/chrome/browser/ash/login/test/oobe_base_test.h
@@ -12,14 +12,13 @@ #include "chrome/browser/ash/login/test/embedded_test_server_setup_mixin.h" #include "chrome/browser/ash/login/test/js_checker.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" namespace content { class WebUI; } // namespace content namespace ash { +class FakeUpdateEngineClient; class LoginOrLockScreenVisibleWaiter; // Base class for OOBE, login, SAML and Kiosk tests.
diff --git a/chrome/browser/ash/login/version_updater/update_time_estimator.h b/chrome/browser/ash/login/version_updater/update_time_estimator.h index 8816bf09..33c49941 100644 --- a/chrome/browser/ash/login/version_updater/update_time_estimator.h +++ b/chrome/browser/ash/login/version_updater/update_time_estimator.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_ASH_LOGIN_VERSION_UPDATER_UPDATE_TIME_ESTIMATOR_H_ #include "base/time/time.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" namespace base { class TickClock;
diff --git a/chrome/browser/ash/login/version_updater/version_updater.cc b/chrome/browser/ash/login/version_updater/version_updater.cc index c6b3916..cf5ef60 100644 --- a/chrome/browser/ash/login/version_updater/version_updater.cc +++ b/chrome/browser/ash/login/version_updater/version_updater.cc
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/login/version_updater/update_time_estimator.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_state.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ash/login/version_updater/version_updater.h b/chrome/browser/ash/login/version_updater/version_updater.h index cca3d9c..1a1ce66 100644 --- a/chrome/browser/ash/login/version_updater/version_updater.h +++ b/chrome/browser/ash/login/version_updater/version_updater.h
@@ -13,8 +13,8 @@ #include "base/timer/timer.h" #include "chrome/browser/ash/login/screens/network_error.h" #include "chrome/browser/ash/login/version_updater/update_time_estimator.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" // TODO(https://crbug.com/1164001): move to forward declaration when migrated. #include "chromeos/network/network_state.h"
diff --git a/chrome/browser/ash/login/version_updater/version_updater_unittest.cc b/chrome/browser/ash/login/version_updater/version_updater_unittest.cc index eff4493..240f9631 100644 --- a/chrome/browser/ash/login/version_updater/version_updater_unittest.cc +++ b/chrome/browser/ash/login/version_updater/version_updater_unittest.cc
@@ -16,12 +16,12 @@ #include "chrome/browser/ash/net/network_portal_detector_test_impl.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/webview_login_browsertest.cc b/chrome/browser/ash/login/webview_login_browsertest.cc index 666f0f90..3849b70d 100644 --- a/chrome/browser/ash/login/webview_login_browsertest.cc +++ b/chrome/browser/ash/login/webview_login_browsertest.cc
@@ -2035,8 +2035,7 @@ &mixin_host_, DeviceStateMixin::State::OOBE_COMPLETED_CLOUD_ENROLLED}; }; -// Disabled fails on msan and also non-msan bots: https://crbug.com/849128. -IN_PROC_BROWSER_TEST_F(WebviewProxyAuthLoginTest, DISABLED_ProxyAuthTransfer) { +IN_PROC_BROWSER_TEST_F(WebviewProxyAuthLoginTest, ProxyAuthTransfer) { WaitForSigninScreen(); LoginHandler* login_handler = WaitForAuthRequested(); @@ -2071,7 +2070,7 @@ // This will re-load gaia, rotating the StoragePartition. The new // StoragePartition must also have the proxy auth details. test::OobeJS().ClickOnPath(kBackButton); - WaitForGaiaPageBackButtonUpdate(); + WaitForGaiaPageLoadAndPropertyUpdate(); // Expect that we got back to the identifier page, as there are no known users // so the sign-in screen will not display user pods. ExpectIdentifierPage();
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index 4d09eb3..418d653b 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -188,8 +188,8 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_state.h"
diff --git a/chrome/browser/ash/mobile/mobile_activator.cc b/chrome/browser/ash/mobile/mobile_activator.cc index df449ad..cd167100 100644 --- a/chrome/browser/ash/mobile/mobile_activator.cc +++ b/chrome/browser/ash/mobile/mobile_activator.cc
@@ -23,10 +23,10 @@ #include "base/timer/timer.h" #include "base/values.h" #include "chromeos/ash/components/network/device_state.h" -#include "chromeos/network/network_activation_handler.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connect.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connect.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler_callbacks.h" #include "content/public/browser/browser_task_traits.h"
diff --git a/chrome/browser/ash/mobile/mobile_activator_unittest.cc b/chrome/browser/ash/mobile/mobile_activator_unittest.cc index d7808a3..bb417eb 100644 --- a/chrome/browser/ash/mobile/mobile_activator_unittest.cc +++ b/chrome/browser/ash/mobile/mobile_activator_unittest.cc
@@ -9,8 +9,8 @@ #include "base/test/task_environment.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ash/net/secure_dns_manager.cc b/chrome/browser/ash/net/secure_dns_manager.cc index f531e5f..419fd27 100644 --- a/chrome/browser/ash/net/secure_dns_manager.cc +++ b/chrome/browser/ash/net/secure_dns_manager.cc
@@ -17,7 +17,7 @@ #include "chrome/browser/net/secure_dns_config.h" #include "chrome/browser/net/secure_dns_util.h" #include "chrome/common/pref_names.h" -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/network/network_handler.h" #include "components/country_codes/country_codes.h" #include "net/dns/public/doh_provider_entry.h"
diff --git a/chrome/browser/ash/net/traffic_counters_handler_unittest.cc b/chrome/browser/ash/net/traffic_counters_handler_unittest.cc index e036f9a..15b7c1c 100644 --- a/chrome/browser/ash/net/traffic_counters_handler_unittest.cc +++ b/chrome/browser/ash/net/traffic_counters_handler_unittest.cc
@@ -10,9 +10,9 @@ #include "base/time/time.h" #include "chrome/browser/ash/net/traffic_counters_handler.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/services/network_config/cros_network_config.h" #include "chromeos/services/network_config/in_process_instance.h"
diff --git a/chrome/browser/ash/notifications/update_required_notification_unittest.cc b/chrome/browser/ash/notifications/update_required_notification_unittest.cc index 60ca00a3..b2cfa1c 100644 --- a/chrome/browser/ash/notifications/update_required_notification_unittest.cc +++ b/chrome/browser/ash/notifications/update_required_notification_unittest.cc
@@ -23,10 +23,10 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -91,9 +91,7 @@ return notification_service_.get(); } - chromeos::FakeUpdateEngineClient* update_engine() { - return fake_update_engine_client_; - } + FakeUpdateEngineClient* update_engine() { return fake_update_engine_client_; } chromeos::NetworkHandlerTestHelper* network_handler_test_helper() { return network_handler_test_helper_.get(); @@ -110,7 +108,7 @@ ScopedTestingCrosSettings scoped_testing_cros_settings_; std::unique_ptr<NotificationDisplayServiceTester> notification_service_; ScopedStubInstallAttributes scoped_stub_install_attributes_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; + FakeUpdateEngineClient* fake_update_engine_client_; std::unique_ptr<base::Version> current_version_; std::unique_ptr<policy::MinimumVersionPolicyHandler> minimum_version_policy_handler_;
diff --git a/chrome/browser/ash/plugin_vm/plugin_vm_files_unittest.cc b/chrome/browser/ash/plugin_vm/plugin_vm_files_unittest.cc index ac438f9..30e06cf9 100644 --- a/chrome/browser/ash/plugin_vm/plugin_vm_files_unittest.cc +++ b/chrome/browser/ash/plugin_vm/plugin_vm_files_unittest.cc
@@ -22,12 +22,12 @@ #include "chrome/browser/ui/ash/shelf/chrome_shelf_controller.h" #include "chrome/browser/ui/ash/shelf/shelf_controller_helper.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/vm_applications/apps.pb.h" #include "content/public/test/browser_task_environment.h" @@ -103,7 +103,7 @@ ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::VmPluginDispatcherClient::InitializeFake(); } ~ScopedDBusThreadManager() { @@ -111,7 +111,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); } } dbus_thread_manager_;
diff --git a/chrome/browser/ash/plugin_vm/plugin_vm_manager_impl_unittest.cc b/chrome/browser/ash/plugin_vm/plugin_vm_manager_impl_unittest.cc index 5b5841d2..87e52c7 100644 --- a/chrome/browser/ash/plugin_vm/plugin_vm_manager_impl_unittest.cc +++ b/chrome/browser/ash/plugin_vm/plugin_vm_manager_impl_unittest.cc
@@ -23,6 +23,7 @@ #include "chrome/browser/ui/ash/shelf/shelf_controller_helper.h" #include "chrome/browser/ui/ash/shelf/shelf_spinner_controller.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" @@ -30,7 +31,6 @@ #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlcservice/fake_dlcservice_client.h" #include "components/prefs/pref_service.h" @@ -51,7 +51,7 @@ public: PluginVmManagerImplTest() { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -97,7 +97,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc index ea16ab4..11507ee 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc
@@ -74,9 +74,9 @@ #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" #include "chromeos/ash/components/dbus/upstart/upstart_client.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer_impl.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_handler.h" #include "chromeos/system/statistics_provider.h" #include "components/policy/core/common/cloud/cloud_policy_client.h"
diff --git a/chrome/browser/ash/policy/core/device_policy_decoder.cc b/chrome/browser/ash/policy/core/device_policy_decoder.cc index 8b0d676..f533d41 100644 --- a/chrome/browser/ash/policy/core/device_policy_decoder.cc +++ b/chrome/browser/ash/policy/core/device_policy_decoder.cc
@@ -21,8 +21,8 @@ #include "chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h" #include "chrome/browser/ash/tpm_firmware_update.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/policy/core/common/chrome_schema.h" #include "components/policy/core/common/external_data_fetcher.h" #include "components/policy/core/common/external_data_manager.h"
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc b/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc index aeca94b..4a02afb 100644 --- a/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc
@@ -29,10 +29,10 @@ #include "chrome/browser/chromeos/policy/dlp/mock_dlp_rules_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dlp/dlp_client.h" #include "chromeos/dbus/dlp/dlp_service.pb.h" @@ -406,7 +406,7 @@ crostini_features.set_enabled(true); chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -442,7 +442,7 @@ DlpFilesControllerTest::TearDown(); chromeos::DBusThreadManager::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); ash::CiceroneClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::SeneschalClient::Shutdown();
diff --git a/chrome/browser/ash/policy/handlers/lock_to_single_user_manager_unittest.cc b/chrome/browser/ash/policy/handlers/lock_to_single_user_manager_unittest.cc index dbe4295..f444ff3 100644 --- a/chrome/browser/ash/policy/handlers/lock_to_single_user_manager_unittest.cc +++ b/chrome/browser/ash/policy/handlers/lock_to_single_user_manager_unittest.cc
@@ -23,13 +23,13 @@ #include "chrome/browser/ui/app_list/arc/arc_app_test.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chromeos/ash/components/dbus/anomaly_detector/anomaly_detector_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/account_id/account_id.h" #include "components/policy/proto/chrome_device_policy.pb.h" @@ -52,7 +52,7 @@ // This is required before Concierge tests start calling // DBusThreadManager::Get() for GuestOsStabilityMonitor. chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -110,7 +110,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.cc index 023b182..588a3023 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.cc
@@ -30,7 +30,7 @@ #include "chrome/browser/upgrade_detector/build_state.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_handler.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" @@ -40,7 +40,7 @@ namespace { -using chromeos::UpdateEngineClient; +using ::ash::UpdateEngineClient; using MinimumVersionRequirement = MinimumVersionPolicyHandler::MinimumVersionRequirement; @@ -333,7 +333,7 @@ } void MinimumVersionPolicyHandler::OnFetchEolInfo( - const chromeos::UpdateEngineClient::EolInfo info) { + const UpdateEngineClient::EolInfo info) { if (!ash::switches::IsAueReachedForUpdateRequiredForTest() && (info.eol_date.is_null() || info.eol_date > update_required_time_)) { // End of life is not reached. Start update with |warning_time_|. @@ -588,8 +588,7 @@ void MinimumVersionPolicyHandler::UpdateOverMeteredPermssionGranted() { VLOG(1) << "Permission for update over metered network granted."; - chromeos::UpdateEngineClient* const update_engine_client = - UpdateEngineClient::Get(); + UpdateEngineClient* const update_engine_client = UpdateEngineClient::Get(); if (!update_engine_client->HasObserver(this)) update_engine_client->AddObserver(this); update_engine_client->RequestUpdateCheck( @@ -598,9 +597,9 @@ } void MinimumVersionPolicyHandler::OnUpdateCheckStarted( - chromeos::UpdateEngineClient::UpdateCheckResult result) { + UpdateEngineClient::UpdateCheckResult result) { VLOG(1) << "Update check started."; - if (result != chromeos::UpdateEngineClient::UPDATE_RESULT_SUCCESS) + if (result != UpdateEngineClient::UPDATE_RESULT_SUCCESS) UpdateEngineClient::Get()->RemoveObserver(this); }
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h index b9c7bf7..18fd9a8e 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h
@@ -15,7 +15,7 @@ #include "base/version.h" #include "chrome/browser/ash/settings/cros_settings.h" #include "chrome/browser/upgrade_detector/build_state_observer.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" @@ -43,7 +43,7 @@ class MinimumVersionPolicyHandler : public BuildStateObserver, public chromeos::NetworkStateHandlerObserver, - public chromeos::UpdateEngineClient::Observer { + public ash::UpdateEngineClient::Observer { public: static const char kRequirements[]; static const char kChromeOsVersion[]; @@ -219,7 +219,7 @@ void FetchEolInfo(); // Callback after fetching end-of-life info from the update_engine_client. - void OnFetchEolInfo(chromeos::UpdateEngineClient::EolInfo info); + void OnFetchEolInfo(ash::UpdateEngineClient::EolInfo info); // Called when the warning time to apply updates has expired. If the user on // the login screen, the update required screen is shown else the current user @@ -250,8 +250,7 @@ void UpdateOverMeteredPermssionGranted(); // Tells whether starting an update check succeeded or not. - void OnUpdateCheckStarted( - chromeos::UpdateEngineClient::UpdateCheckResult result); + void OnUpdateCheckStarted(ash::UpdateEngineClient::UpdateCheckResult result); // Callback from UpdateEngineClient::SetUpdateOverCellularOneTimePermission(). void OnSetUpdateOverCellularOneTimePermission(bool success);
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc index 31de0c7..64f81d2 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc
@@ -53,10 +53,10 @@ #include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h" #include "chrome/common/pref_names.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/constants/dbus_switches.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_type.h" @@ -113,7 +113,7 @@ void SetUpInProcessBrowserTestFixture() override { LoginManagerTest::SetUpInProcessBrowserTestFixture(); fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); const std::string lsb_release = base::StringPrintf("CHROMEOS_RELEASE_VERSION=%s", kCurrentVersion); version_info_.emplace(lsb_release, base::Time::Now()); @@ -132,7 +132,7 @@ DevicePolicyCrosTestHelper helper_; base::test::ScopedFeatureList feature_list_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; + ash::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; ash::DeviceStateMixin device_state_{ &mixin_host_, ash::DeviceStateMixin::State::OOBE_COMPLETED_CLOUD_ENROLLED};
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc index f39b2ec..f54aedc0 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc
@@ -21,11 +21,11 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -96,7 +96,7 @@ base::test::ScopedFeatureList feature_list_; ash::ScopedTestingCrosSettings scoped_testing_cros_settings_; ash::ScopedStubInstallAttributes scoped_stub_install_attributes_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; + ash::FakeUpdateEngineClient* fake_update_engine_client_; std::unique_ptr<chromeos::NetworkHandlerTestHelper> network_handler_test_helper_; std::unique_ptr<base::Version> current_version_; @@ -110,8 +110,7 @@ void MinimumVersionPolicyHandlerTest::SetUp() { chromeos::DBusThreadManager::Initialize(); - fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + fake_update_engine_client_ = ash::UpdateEngineClient::InitializeFakeForTest(); network_handler_test_helper_ = std::make_unique<chromeos::NetworkHandlerTestHelper>(); @@ -132,7 +131,7 @@ void MinimumVersionPolicyHandlerTest::TearDown() { minimum_version_policy_handler_.reset(); network_handler_test_helper_.reset(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc b/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc index 50e0d94f..8da6c0d 100644 --- a/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc +++ b/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc
@@ -19,12 +19,12 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/scoped_test_system_nss_key_slot_mixin.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_property_changed_observer.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_policy_observer.h" #include "chromeos/system/fake_statistics_provider.h"
diff --git a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc index ef24187..956a719 100644 --- a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc +++ b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc
@@ -48,10 +48,10 @@ #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer_impl.h" #include "chromeos/components/onc/onc_test_utils.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/policy_certificate_provider.h" #include "chromeos/test/chromeos_test_utils.h" #include "components/onc/onc_constants.h"
diff --git a/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.cc b/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.cc index daa05bb..05ec89e 100644 --- a/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.cc +++ b/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.cc
@@ -7,7 +7,7 @@ #include <utility> #include "chrome/browser/browser_process.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_handler.h" #include "components/device_event_log/device_event_log.h" #include "components/policy/core/common/policy_service.h" @@ -21,7 +21,7 @@ update_checker_internal:: kMaxOsAndPoliciesUpdateCheckerRetryIterations, update_checker_internal::kOsAndPoliciesUpdateCheckerRetryTime), - update_engine_client_(chromeos::UpdateEngineClient::Get()) {} + update_engine_client_(ash::UpdateEngineClient::Get()) {} OsAndPoliciesUpdateChecker::~OsAndPoliciesUpdateChecker() { // Called to remove any observers. @@ -191,17 +191,17 @@ } void OsAndPoliciesUpdateChecker::OnUpdateCheckStarted( - chromeos::UpdateEngineClient::UpdateCheckResult result) { + ash::UpdateEngineClient::UpdateCheckResult result) { switch (result) { - case chromeos::UpdateEngineClient::UPDATE_RESULT_SUCCESS: + case ash::UpdateEngineClient::UPDATE_RESULT_SUCCESS: // Nothing to do if the update check started successfully. break; - case chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED: + case ash::UpdateEngineClient::UPDATE_RESULT_FAILED: update_check_task_executor_.ScheduleRetry( base::BindOnce(&OsAndPoliciesUpdateChecker::StartUpdateCheck, base::Unretained(this))); break; - case chromeos::UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED: + case ash::UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED: // No point retrying if the operation is not implemented. Refresh policies // since the update check is done. LOG(ERROR) << "Update check failed: Operation not implemented";
diff --git a/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.h b/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.h index 46cc01c..6b847d2 100644 --- a/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.h +++ b/chrome/browser/ash/policy/scheduled_task_handler/os_and_policies_update_checker.h
@@ -10,7 +10,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "chrome/browser/ash/policy/scheduled_task_handler/task_executor_with_retries.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" @@ -38,7 +38,7 @@ // This class is used by the scheduled update check policy to perform the actual // device update check. class OsAndPoliciesUpdateChecker - : public chromeos::UpdateEngineClient::Observer, + : public ash::UpdateEngineClient::Observer, public chromeos::NetworkStateHandlerObserver { public: explicit OsAndPoliciesUpdateChecker( @@ -92,8 +92,7 @@ void UpdateStatusChanged(const update_engine::StatusResult& status) override; // Tells whether starting an update check succeeded or not. - void OnUpdateCheckStarted( - chromeos::UpdateEngineClient::UpdateCheckResult result); + void OnUpdateCheckStarted(ash::UpdateEngineClient::UpdateCheckResult result); // Refreshes policies. |update_check_result| represents the status of the // previous stage i.e. an OS update check and download. @@ -134,7 +133,7 @@ base::OneShotTimer timeout_timer_; // Not owned. - chromeos::UpdateEngineClient* const update_engine_client_; + ash::UpdateEngineClient* const update_engine_client_; base::WeakPtrFactory<OsAndPoliciesUpdateChecker> weak_factory_{this}; };
diff --git a/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc b/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc index 37c9fc3..731e57e 100644 --- a/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc +++ b/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc
@@ -34,13 +34,13 @@ #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/shill/shill_clients.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/policy/core/common/policy_service.h" @@ -126,7 +126,7 @@ base::Unretained(&wake_lock_provider_))); chromeos::DBusThreadManager::Initialize(); fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); chromeos::PowerManagerClient::InitializeFake(); chromeos::FakePowerManagerClient::Get()->set_tick_clock( task_environment_.GetMockTickClock()); @@ -154,7 +154,7 @@ device_scheduled_update_checker_.reset(); network_state_test_helper_.reset(); chromeos::PowerManagerClient::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); ScopedWakeLock::OverrideWakeLockProviderBinderForTesting( base::NullCallback()); @@ -357,7 +357,7 @@ std::unique_ptr<DeviceScheduledUpdateCheckerForTest> device_scheduled_update_checker_; ash::ScopedTestingCrosSettings cros_settings_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; + ash::FakeUpdateEngineClient* fake_update_engine_client_; std::unique_ptr<chromeos::NetworkStateTestHelper> network_state_test_helper_; device::TestWakeLockProvider wake_lock_provider_;
diff --git a/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc index 9648ac5..0c5451fa 100644 --- a/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc
@@ -46,11 +46,11 @@ #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power_manager/idle.pb.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/system/fake_statistics_provider.h" #include "components/account_id/account_id.h" @@ -201,7 +201,7 @@ chromeos::DBusThreadManager::Initialize(); // Use FakeUpdateEngineClient. - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -219,7 +219,7 @@ testing_profile_.reset(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); // Finish pending tasks.
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector.cc b/chrome/browser/ash/policy/status_collector/device_status_collector.cc index e3b92561..1686f43a7 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector.cc
@@ -67,6 +67,7 @@ #include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" #include "chromeos/dbus/attestation/attestation_client.h" @@ -76,7 +77,6 @@ #include "chromeos/dbus/power_manager/idle.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/util/version_loader.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_handler.h" @@ -2511,7 +2511,7 @@ em::OsUpdateStatus* os_update_status = status->mutable_os_update_status(); const update_engine::StatusResult update_engine_status = - chromeos::UpdateEngineClient::Get()->GetLastStatus(); + ash::UpdateEngineClient::Get()->GetLastStatus(); absl::optional<base::Version> required_platform_version;
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc index 642f80c..ca61a2f 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -68,6 +68,8 @@ #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/services/cros_healthd/public/cpp/fake_cros_healthd.h" @@ -82,8 +84,6 @@ #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/vm_applications/apps.pb.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_handler.h" @@ -904,8 +904,7 @@ // Use FakeUpdateEngineClient. chromeos::DBusThreadManager::Initialize(); - update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + update_engine_client_ = ash::UpdateEngineClient::InitializeFakeForTest(); // Async tasks posted when calling `chromeos::DBusThreadManager::Initialize` // need to be flushed. base::RunLoop().RunUntilIdle(); @@ -939,7 +938,7 @@ chromeos::PowerManagerClient::Shutdown(); ash::UserDataAuthClient::Shutdown(); chromeos::CrasAudioHandler::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); ash::KioskAppManager::Shutdown(); ash::cros_healthd::FakeCrosHealthd::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); @@ -1227,7 +1226,7 @@ const DeviceLocalAccount fake_web_kiosk_device_local_account_; base::ScopedPathOverride user_data_dir_override_; base::ScopedPathOverride crash_dumps_dir_override_; - chromeos::FakeUpdateEngineClient* update_engine_client_; + ash::FakeUpdateEngineClient* update_engine_client_; std::unique_ptr<base::RunLoop> run_loop_; base::test::ScopedFeatureList scoped_feature_list_; base::SimpleTestClock test_clock_;
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc index a92e5aba..7209484 100644 --- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc +++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc
@@ -66,6 +66,7 @@ #include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/services/cros_healthd/public/cpp/service_connection.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" @@ -74,7 +75,6 @@ #include "chromeos/dbus/power_manager/idle.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/util/version_loader.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_handler.h" @@ -2432,7 +2432,7 @@ em::OsUpdateStatus* os_update_status = status->mutable_os_update_status(); const update_engine::StatusResult update_engine_status = - chromeos::UpdateEngineClient::Get()->GetLastStatus(); + ash::UpdateEngineClient::Get()->GetLastStatus(); absl::optional<base::Version> required_platform_version;
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc index 61f7199..c36dee9 100644 --- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc
@@ -66,6 +66,8 @@ #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd.mojom.h" @@ -79,8 +81,6 @@ #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/vm_applications/apps.pb.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_handler.h" @@ -893,8 +893,7 @@ // Use FakeUpdateEngineClient. chromeos::DBusThreadManager::Initialize(); - update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + update_engine_client_ = ash::UpdateEngineClient::InitializeFakeForTest(); // Async tasks posted when calling `chromeos::DBusThreadManager::Initialize` // need to be flushed. base::RunLoop().RunUntilIdle(); @@ -928,7 +927,7 @@ chromeos::PowerManagerClient::Shutdown(); ash::UserDataAuthClient::Shutdown(); chromeos::CrasAudioHandler::Shutdown(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); ash::KioskAppManager::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); @@ -1189,7 +1188,7 @@ const DeviceLocalAccount fake_web_kiosk_device_local_account_; base::ScopedPathOverride user_data_dir_override_; base::ScopedPathOverride crash_dumps_dir_override_; - chromeos::FakeUpdateEngineClient* update_engine_client_; + ash::FakeUpdateEngineClient* update_engine_client_; std::unique_ptr<base::RunLoop> run_loop_; base::test::ScopedFeatureList scoped_feature_list_; base::SimpleTestClock test_clock_;
diff --git a/chrome/browser/ash/preferences.cc b/chrome/browser/ash/preferences.cc index d23d6978..e86b5ae 100644 --- a/chrome/browser/ash/preferences.cc +++ b/chrome/browser/ash/preferences.cc
@@ -50,9 +50,9 @@ #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/pciguard/pciguard_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/components/disks/disks_prefs.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/system/devicemode.h" #include "chromeos/system/statistics_provider.h" #include "components/drive/drive_pref_names.h"
diff --git a/chrome/browser/ash/preferences.h b/chrome/browser/ash/preferences.h index 882d54f0..16602bc 100644 --- a/chrome/browser/ash/preferences.h +++ b/chrome/browser/ash/preferences.h
@@ -10,7 +10,7 @@ #include "ash/public/mojom/cros_display_config.mojom.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/language_preferences.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_member.h" #include "components/sync_preferences/pref_service_syncable_observer.h"
diff --git a/chrome/browser/ash/preferences_unittest.cc b/chrome/browser/ash/preferences_unittest.cc index 7a18dd0..e958663 100644 --- a/chrome/browser/ash/preferences_unittest.cc +++ b/chrome/browser/ash/preferences_unittest.cc
@@ -22,8 +22,8 @@ #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/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/language/core/browser/pref_names.h" #include "components/prefs/pref_member.h" #include "components/sync/base/client_tag_hash.h" @@ -222,7 +222,7 @@ TestingProfile* test_profile_; sync_preferences::TestingPrefServiceSyncable* pref_service_; input_method::MyMockInputMethodManager* mock_manager_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; + FakeUpdateEngineClient* fake_update_engine_client_; }; TEST_F(PreferencesTest, TestUpdatePrefOnBrowserScreenDetails) {
diff --git a/chrome/browser/ash/system/automatic_reboot_manager.cc b/chrome/browser/ash/system/automatic_reboot_manager.cc index 024d46d..96d6445e 100644 --- a/chrome/browser/ash/system/automatic_reboot_manager.cc +++ b/chrome/browser/ash/system/automatic_reboot_manager.cc
@@ -36,7 +36,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/lifetime/termination_notification.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/system/automatic_reboot_manager.h b/chrome/browser/ash/system/automatic_reboot_manager.h index 815d7bf1..71a8c9e0 100644 --- a/chrome/browser/ash/system/automatic_reboot_manager.h +++ b/chrome/browser/ash/system/automatic_reboot_manager.h
@@ -16,8 +16,8 @@ #include "base/timer/timer.h" #include "base/timer/wall_clock_timer.h" #include "chrome/browser/ash/system/automatic_reboot_manager_observer.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_change_registrar.h" #include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager_observer.h"
diff --git a/chrome/browser/ash/system/automatic_reboot_manager_unittest.cc b/chrome/browser/ash/system/automatic_reboot_manager_unittest.cc index 65f4e7f..ff37d29 100644 --- a/chrome/browser/ash/system/automatic_reboot_manager_unittest.cc +++ b/chrome/browser/ash/system/automatic_reboot_manager_unittest.cc
@@ -29,9 +29,9 @@ #include "chrome/browser/ash/system/automatic_reboot_manager_observer.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/account_id/account_id.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h"
diff --git a/chrome/browser/ash/system_token_cert_db_initializer.cc b/chrome/browser/ash/system_token_cert_db_initializer.cc index 407c12f..61d1a12 100644 --- a/chrome/browser/ash/system_token_cert_db_initializer.cc +++ b/chrome/browser/ash/system_token_cert_db_initializer.cc
@@ -26,10 +26,10 @@ #include "chrome/browser/ash/crosapi/crosapi_manager.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/dbus/common/dbus_method_call_status.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/system_token_cert_db_storage.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc b/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc index 123fba1..8418cc8 100644 --- a/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc +++ b/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc
@@ -13,9 +13,9 @@ #include "base/test/task_environment.h" #include "base/time/time.h" #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/system_token_cert_db_storage_test_util.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/network/network_cert_loader.h" #include "content/public/test/browser_task_environment.h" #include "crypto/nss_util.h" #include "crypto/scoped_test_system_nss_key_slot.h"
diff --git a/chrome/browser/ash/tether/tether_service.cc b/chrome/browser/ash/tether/tether_service.cc index 59f62c92..55e6fc33 100644 --- a/chrome/browser/ash/tether/tether_service.cc +++ b/chrome/browser/ash/tether/tether_service.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ui/ash/network/tether_notification_presenter.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/network/device_state.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/network/network_type_pattern.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/tether/tether_service_unittest.cc b/chrome/browser/ash/tether/tether_service_unittest.cc index 7b3b717..9363c11 100644 --- a/chrome/browser/ash/tether/tether_service_unittest.cc +++ b/chrome/browser/ash/tether/tether_service_unittest.cc
@@ -41,6 +41,7 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power/power_manager_client.h" @@ -48,7 +49,6 @@ #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_connect.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_type_pattern.h"
diff --git a/chrome/browser/ash/usb/cros_usb_detector_unittest.cc b/chrome/browser/ash/usb/cros_usb_detector_unittest.cc index 9ab36b4..ffbd52d 100644 --- a/chrome/browser/ash/usb/cros_usb_detector_unittest.cc +++ b/chrome/browser/ash/usb/cros_usb_detector_unittest.cc
@@ -34,13 +34,13 @@ #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/cicerone/fake_cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/concierge/fake_concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/ash/components/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/cros_disks/cros_disks_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "services/device/public/cpp/test/fake_usb_device_info.h" @@ -137,7 +137,7 @@ CrosUsbDetectorTest() { // Needed for ChunneldClient via GuestOsStabilityMonitor. chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ConciergeClient::InitializeFake(); SeneschalClient::InitializeFake(); @@ -162,7 +162,7 @@ SeneschalClient::Shutdown(); ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 5fb35f4a..079713cf 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -251,6 +251,7 @@ "//chromeos/ash/components/dbus/authpolicy", "//chromeos/ash/components/dbus/authpolicy:authpolicy_proto", "//chromeos/ash/components/dbus/biod", + "//chromeos/ash/components/dbus/chunneld", "//chromeos/ash/components/dbus/cicerone", "//chromeos/ash/components/dbus/concierge", "//chromeos/ash/components/dbus/cros_healthd", @@ -280,6 +281,8 @@ "//chromeos/ash/components/dbus/system_proxy", "//chromeos/ash/components/dbus/system_proxy:system_proxy_proto", "//chromeos/ash/components/dbus/typecd", + "//chromeos/ash/components/dbus/update_engine", + "//chromeos/ash/components/dbus/update_engine:proto", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/dbus/userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", @@ -320,7 +323,6 @@ "//chromeos/dbus/attestation", "//chromeos/dbus/attestation:attestation_proto", "//chromeos/dbus/cdm_factory_daemon", - "//chromeos/dbus/chunneld", "//chromeos/dbus/constants", "//chromeos/dbus/cros_disks", "//chromeos/dbus/cryptohome", @@ -348,8 +350,6 @@ "//chromeos/dbus/tpm_manager:tpm_manager_proto", "//chromeos/dbus/u2f", "//chromeos/dbus/u2f:u2f_proto", - "//chromeos/dbus/update_engine", - "//chromeos/dbus/update_engine:proto", "//chromeos/dbus/util", "//chromeos/ime:gencode", "//chromeos/language/language_packs", @@ -2191,6 +2191,7 @@ "//chrome/common:constants", "//chrome/test:test_support", "//chrome/test:test_support_ui", + "//chromeos/ash/components/dbus/chunneld", "//chromeos/ash/components/dbus/cicerone", "//chromeos/ash/components/dbus/concierge", "//chromeos/ash/components/dbus/lorgnette_manager", @@ -2200,7 +2201,6 @@ "//chromeos/ash/components/dbus/userdataauth:userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/dbus:test_support", - "//chromeos/dbus/chunneld", "//chromeos/dbus/cros_disks", "//chromeos/dbus/cryptohome", "//chromeos/dbus/cryptohome:cryptohome_proto", @@ -3173,6 +3173,7 @@ "//chromeos/ash/components/dbus/services:test_support", "//chromeos/ash/components/dbus/session_manager", "//chromeos/ash/components/dbus/system_clock", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/dbus/virtual_file_provider", "//chromeos/ash/components/dbus/vm_plugin_dispatcher", @@ -3195,7 +3196,6 @@ "//chromeos/dbus/power", "//chromeos/dbus/smbprovider", "//chromeos/dbus/smbprovider:proto", - "//chromeos/dbus/update_engine", "//chromeos/ime:gencode", "//chromeos/login/login_state", "//chromeos/login/login_state:test_support",
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index e734a365..17407a1d 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -1155,6 +1155,7 @@ "//chrome/browser/ui/webui/settings/chromeos/constants:mojom", "//chromeos/ash/components/dbus/cicerone:cicerone", "//chromeos/ash/components/dbus/cicerone:cicerone_proto", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/services/assistant/public/cpp", "//chromeos/components/remote_apps/mojom", "//chromeos/dbus", @@ -1162,7 +1163,6 @@ "//chromeos/dbus/cryptohome", "//chromeos/dbus/image_burner", "//chromeos/dbus/power", - "//chromeos/dbus/update_engine", "//chromeos/dbus/util", "//chromeos/language/language_packs", "//chromeos/language/public/mojom",
diff --git a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc index 29346dc..bfa24715 100644 --- a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc +++ b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
@@ -85,31 +85,20 @@ const char kVolumeNotFoundError[] = "Volume not found."; // Fills a list of volumes mounted in the system. -bool GetVolumeListForExtension( - const std::vector<base::WeakPtr<file_manager::Volume>>& available_volumes, - ConsentProvider* consent_provider, - const Extension& extension, - std::vector<file_system::Volume>* result_volumes) { - if (!consent_provider) - return false; +void FillVolumeList(content::BrowserContext* browser_context, + std::vector<file_system::Volume>* result) { + file_manager::VolumeManager* const volume_manager = + file_manager::VolumeManager::Get(browser_context); + DCHECK(volume_manager); - const FileSystemDelegate::GrantVolumesMode mode = - consent_provider->GetGrantVolumesMode(extension); - if (mode == FileSystemDelegate::kGrantNone) - return false; - - // Convert available_volumes to result_volume_list. - for (const auto& volume : available_volumes) { - if (mode == FileSystemDelegate::kGrantAll || - (mode == FileSystemDelegate::kGrantPerVolume && - consent_provider->IsGrantableForVolume(extension, volume))) { - file_system::Volume result_volume; - result_volume.volume_id = volume->volume_id(); - result_volume.writable = !volume->is_read_only(); - result_volumes->push_back(std::move(result_volume)); - } + const auto& volume_list = volume_manager->GetVolumeList(); + // Convert volume_list to result_volume_list. + for (const auto& volume : volume_list) { + file_system::Volume result_volume; + result_volume.volume_id = volume->volume_id(); + result_volume.writable = !volume->is_read_only(); + result->push_back(std::move(result_volume)); } - return true; } // Callback called when consent is granted or denied. @@ -121,8 +110,8 @@ const base::WeakPtr<file_manager::Volume>& volume, bool writable, ConsentProvider::Consent result) { - using file_manager::VolumeManager; using file_manager::Volume; + using file_manager::VolumeManager; // Render frame host can be gone before this callback method is executed. if (!requester->render_frame_host()) { @@ -226,15 +215,11 @@ Profile::FromBrowserContext(browser_context)); ConsentProvider consent_provider(&consent_provider_delegate); - const std::vector<base::WeakPtr<file_manager::Volume>> volume_list = - file_manager::VolumeManager::Get(browser_context)->GetVolumeList(); - + file_system::VolumeListChangedEvent event_args; + FillVolumeList(browser_context, &event_args.volumes); for (const auto& extension : registry->enabled_extensions()) { - file_system::VolumeListChangedEvent event_args; - if (!GetVolumeListForExtension(volume_list, &consent_provider, - *extension.get(), &event_args.volumes)) { + if (!consent_provider.IsGrantable(*extension.get())) continue; - } event_router->DispatchEventToExtension( extension->id(), @@ -338,17 +323,14 @@ } #if BUILDFLAG(IS_CHROMEOS_ASH) -FileSystemDelegate::GrantVolumesMode -ChromeFileSystemDelegate::GetGrantVolumesMode( +bool ChromeFileSystemDelegate::IsGrantable( content::BrowserContext* browser_context, - content::RenderFrameHost* render_frame_host, const Extension& extension) { // Only kiosk apps in kiosk sessions can use this API. // Additionally it is enabled for allowlisted component extensions and apps. ConsentProviderDelegate consent_provider_delegate( Profile::FromBrowserContext(browser_context)); - return ConsentProvider(&consent_provider_delegate) - .GetGrantVolumesMode(extension); + return ConsentProvider(&consent_provider_delegate).IsGrantable(extension); } void ChromeFileSystemDelegate::RequestFileSystem( @@ -363,8 +345,8 @@ Profile::FromBrowserContext(browser_context)); ConsentProvider consent_provider(&consent_provider_delegate); - using file_manager::VolumeManager; using file_manager::Volume; + using file_manager::VolumeManager; VolumeManager* const volume_manager = VolumeManager::Get(browser_context); DCHECK(volume_manager); @@ -374,16 +356,14 @@ return; } - if (consent_provider.GetGrantVolumesMode(extension) == - FileSystemDelegate::kGrantNone) { + if (!consent_provider.IsGrantable(extension)) { std::move(error_callback).Run(kNotSupportedOnNonKioskSessionError); return; } base::WeakPtr<file_manager::Volume> volume = volume_manager->FindVolumeById(volume_id); - if (!volume.get() || - !consent_provider.IsGrantableForVolume(extension, volume)) { + if (!volume.get()) { std::move(error_callback).Run(kVolumeNotFoundError); return; } @@ -417,19 +397,11 @@ void ChromeFileSystemDelegate::GetVolumeList( content::BrowserContext* browser_context, - const Extension& extension, VolumeListCallback success_callback, ErrorCallback error_callback) { - ConsentProviderDelegate consent_provider_delegate( - Profile::FromBrowserContext(browser_context)); - ConsentProvider consent_provider(&consent_provider_delegate); - - const std::vector<base::WeakPtr<file_manager::Volume>> volume_list = - file_manager::VolumeManager::Get(browser_context)->GetVolumeList(); std::vector<file_system::Volume> result_volume_list; + FillVolumeList(browser_context, &result_volume_list); - GetVolumeListForExtension(volume_list, &consent_provider, extension, - &result_volume_list); std::move(success_callback).Run(result_volume_list); }
diff --git a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h index 9be9c0d..9f69c045 100644 --- a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h +++ b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.h
@@ -52,10 +52,8 @@ base::OnceClosure on_cancel) override; int GetDescriptionIdForAcceptType(const std::string& accept_type) override; #if BUILDFLAG(IS_CHROMEOS_ASH) - FileSystemDelegate::GrantVolumesMode GetGrantVolumesMode( - content::BrowserContext* browser_context, - content::RenderFrameHost* render_frame_host, - const Extension& extension) override; + bool IsGrantable(content::BrowserContext* browser_context, + const Extension& extension) override; void RequestFileSystem(content::BrowserContext* browser_context, scoped_refptr<ExtensionFunction> requester, const Extension& extension, @@ -64,7 +62,6 @@ FileSystemCallback success_callback, ErrorCallback error_callback) override; void GetVolumeList(content::BrowserContext* browser_context, - const Extension& extension, VolumeListCallback success_callback, ErrorCallback error_callback) override; #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/api/file_system/consent_provider.cc b/chrome/browser/extensions/api/file_system/consent_provider.cc index 70ad936..8817cf12 100644 --- a/chrome/browser/extensions/api/file_system/consent_provider.cc +++ b/chrome/browser/extensions/api/file_system/consent_provider.cc
@@ -23,7 +23,6 @@ #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/common/api/file_system.h" #include "extensions/common/manifest_handlers/kiosk_mode_info.h" -#include "extensions/common/permissions/permissions_data.h" namespace extensions { @@ -90,7 +89,7 @@ const base::WeakPtr<file_manager::Volume>& volume, bool writable, ConsentCallback callback) { - DCHECK(IsGrantableForVolume(extension, volume)); + DCHECK(IsGrantable(extension)); // If a allowlisted component, then no need to ask or inform the user. if (extension.location() == mojom::ManifestLocation::kComponent && @@ -100,16 +99,6 @@ return; } - // If a allowlisted app or extensions to access Downloads folder, then no - // need to ask or inform the user. - if (volume.get() && - volume->type() == file_manager::VOLUME_TYPE_DOWNLOADS_DIRECTORY && - delegate_->HasRequestDownloadsPermission(extension)) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), CONSENT_GRANTED)); - return; - } - // If auto-launched kiosk app, then no need to ask user either, but show the // notification. if (delegate_->IsAutoLaunched(extension)) { @@ -132,8 +121,7 @@ NOTREACHED() << "Cannot request consent for non-grantable extensions."; } -FileSystemDelegate::GrantVolumesMode ConsentProvider::GetGrantVolumesMode( - const Extension& extension) { +bool ConsentProvider::IsGrantable(const Extension& extension) { const bool is_allowlisted_component = delegate_->IsAllowlistedComponent(extension); @@ -141,27 +129,7 @@ KioskModeInfo::IsKioskOnly(&extension) && user_manager::UserManager::Get()->IsLoggedInAsKioskApp(); - if (is_allowlisted_component || is_running_in_kiosk_session) { - return FileSystemDelegate::kGrantAll; - } - - const bool is_allowlisted_non_component = - delegate_->HasRequestDownloadsPermission(extension); - - return is_allowlisted_non_component ? FileSystemDelegate::kGrantPerVolume - : FileSystemDelegate::kGrantNone; -} - -bool ConsentProvider::IsGrantableForVolume( - const Extension& extension, - const base::WeakPtr<file_manager::Volume>& volume) { - if (volume.get() && - volume->type() == file_manager::VOLUME_TYPE_DOWNLOADS_DIRECTORY && - delegate_->HasRequestDownloadsPermission(extension)) { - return true; - } - - return GetGrantVolumesMode(extension) == FileSystemDelegate::kGrantAll; + return is_allowlisted_component || is_running_in_kiosk_session; } ConsentProviderDelegate::ConsentProviderDelegate(Profile* profile) @@ -253,11 +221,5 @@ return false; } -bool ConsentProviderDelegate::HasRequestDownloadsPermission( - const Extension& extension) { - return extension.permissions_data()->HasAPIPermission( - mojom::APIPermissionID::kFileSystemRequestDownloads); -} - } // namespace file_system_api } // namespace extensions
diff --git a/chrome/browser/extensions/api/file_system/consent_provider.h b/chrome/browser/extensions/api/file_system/consent_provider.h index e6e7aa9..5862832 100644 --- a/chrome/browser/extensions/api/file_system/consent_provider.h +++ b/chrome/browser/extensions/api/file_system/consent_provider.h
@@ -8,7 +8,6 @@ #include "base/callback_forward.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" -#include "extensions/browser/api/file_system/file_system_delegate.h" #include "ui/base/ui_base_types.h" class Profile; @@ -62,9 +61,6 @@ // Checks if the extension is a allowlisted component extension or app. virtual bool IsAllowlistedComponent(const Extension& extension) = 0; - - // Checks if the extension has the permission to access Downloads. - virtual bool HasRequestDownloadsPermission(const Extension& extension) = 0; }; explicit ConsentProvider(DelegateInterface* delegate); @@ -76,21 +72,15 @@ // Requests consent for granting |writable| permissions to the |volume| // volume by the |extension|. Must be called only if the extension is - // grantable, which can be checked with GetGrantVolumesMode() and - // IsGrantableForVolume(). + // grantable, which can be checked with IsGrantable(). void RequestConsent(const Extension& extension, content::RenderFrameHost* host, const base::WeakPtr<file_manager::Volume>& volume, bool writable, ConsentCallback callback); - // Returns granted access mode for the |extension|. - FileSystemDelegate::GrantVolumesMode GetGrantVolumesMode( - const Extension& extension); - - // Checks whether the |extension| can be granted |volume| access. - bool IsGrantableForVolume(const Extension& extension, - const base::WeakPtr<file_manager::Volume>& volume); + // Checks whether the |extension| can be granted access. + bool IsGrantable(const Extension& extension); private: DelegateInterface* const delegate_; @@ -126,7 +116,6 @@ bool writable) override; bool IsAutoLaunched(const Extension& extension) override; bool IsAllowlistedComponent(const Extension& extension) override; - bool HasRequestDownloadsPermission(const Extension& extension) override; Profile* const profile_; };
diff --git a/chrome/browser/extensions/api/file_system/consent_provider_unittest.cc b/chrome/browser/extensions/api/file_system/consent_provider_unittest.cc index c6c1994..3c0fa9c0 100644 --- a/chrome/browser/extensions/api/file_system/consent_provider_unittest.cc +++ b/chrome/browser/extensions/api/file_system/consent_provider_unittest.cc
@@ -8,7 +8,6 @@ #include <string> #include "base/bind.h" -#include "base/files/scoped_temp_dir.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -20,11 +19,9 @@ #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user.h" #include "content/public/test/browser_task_environment.h" -#include "extensions/browser/api/file_system/file_system_delegate.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" #include "extensions/common/manifest.h" -#include "extensions/common/permissions/permissions_data.h" #include "testing/gtest/include/gtest/gtest.h" using extensions::file_system_api::ConsentProvider; @@ -91,11 +88,6 @@ return allowlisted_component_id_.compare(extension.id()) == 0; } - bool HasRequestDownloadsPermission(const Extension& extension) override { - return extension.permissions_data()->HasAPIPermission( - mojom::APIPermissionID::kFileSystemRequestDownloads); - } - int show_dialog_counter_; int show_notification_counter_; ui::DialogButton dialog_button_; @@ -123,8 +115,6 @@ scoped_user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( base::WrapUnique(user_manager_)); - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - download_volume_ = Volume::CreateForDownloads(temp_dir_.GetPath()); } void TearDown() override { @@ -140,8 +130,6 @@ ash::FakeChromeUserManager* user_manager_; // Owned by the scope enabler. std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_enabler_; content::BrowserTaskEnvironment task_environment_; - base::ScopedTempDir temp_dir_; - std::unique_ptr<Volume> download_volume_; }; TEST_F(FileSystemApiConsentProviderTest, ForNonKioskApps) { @@ -153,8 +141,7 @@ .Build()); TestingConsentProviderDelegate delegate; ConsentProvider provider(&delegate); - EXPECT_EQ(provider.GetGrantVolumesMode(*component_extension), - FileSystemDelegate::kGrantNone); + EXPECT_FALSE(provider.IsGrantable(*component_extension)); } // Allowlisted component apps are instantly granted access without asking @@ -167,8 +154,7 @@ TestingConsentProviderDelegate delegate; delegate.SetComponentAllowlist(allowlisted_component_extension->id()); ConsentProvider provider(&delegate); - EXPECT_EQ(provider.GetGrantVolumesMode(*allowlisted_component_extension), - FileSystemDelegate::kGrantAll); + EXPECT_TRUE(provider.IsGrantable(*allowlisted_component_extension)); ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE; provider.RequestConsent(*allowlisted_component_extension.get(), nullptr, @@ -188,8 +174,7 @@ ExtensionBuilder("Test").Build()); TestingConsentProviderDelegate delegate; ConsentProvider provider(&delegate); - EXPECT_EQ(provider.GetGrantVolumesMode(*non_component_extension), - FileSystemDelegate::kGrantNone); + EXPECT_FALSE(provider.IsGrantable(*non_component_extension)); } } @@ -210,8 +195,7 @@ TestingConsentProviderDelegate delegate; delegate.SetIsAutoLaunched(true); ConsentProvider provider(&delegate); - EXPECT_EQ(provider.GetGrantVolumesMode(*auto_launch_kiosk_app), - FileSystemDelegate::kGrantAll); + EXPECT_TRUE(provider.IsGrantable(*auto_launch_kiosk_app)); ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE; provider.RequestConsent(*auto_launch_kiosk_app.get(), nullptr, volume_, @@ -239,8 +223,7 @@ TestingConsentProviderDelegate delegate; delegate.SetDialogButton(ui::DIALOG_BUTTON_OK); ConsentProvider provider(&delegate); - EXPECT_EQ(provider.GetGrantVolumesMode(*manual_launch_kiosk_app), - FileSystemDelegate::kGrantAll); + EXPECT_TRUE(provider.IsGrantable(*manual_launch_kiosk_app)); ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE; provider.RequestConsent(*manual_launch_kiosk_app.get(), nullptr, volume_, @@ -259,8 +242,7 @@ TestingConsentProviderDelegate delegate; ConsentProvider provider(&delegate); delegate.SetDialogButton(ui::DIALOG_BUTTON_CANCEL); - EXPECT_EQ(provider.GetGrantVolumesMode(*manual_launch_kiosk_app), - FileSystemDelegate::kGrantAll); + EXPECT_TRUE(provider.IsGrantable(*manual_launch_kiosk_app)); ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE; provider.RequestConsent(*manual_launch_kiosk_app.get(), nullptr, volume_,
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc index 0bac6c4d..e7cf3220 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc
@@ -27,14 +27,12 @@ #include "extensions/browser/api/file_system/file_system_api.h" #include "extensions/browser/event_router.h" #include "extensions/common/api/file_system.h" -#include "extensions/common/switches.h" #include "storage/browser/file_system/external_mount_points.h" #include "ui/base/ui_base_types.h" // TODO(michaelpg): Port these tests to app_shell: crbug.com/505926. using file_manager::VolumeManager; -using file_manager::VolumeType; namespace extensions { namespace { @@ -42,7 +40,6 @@ // Mount point names for chrome.fileSystem.requestFileSystem() tests. const char kWritableMountPointName[] = "writable"; const char kReadOnlyMountPointName[] = "read-only"; -const char kDownloadsMountPointName[] = "downloads"; // Child directory created in each of the mount points. const char kChildDirectory[] = "child-dir"; @@ -143,9 +140,7 @@ PlatformAppBrowserTest::SetUpOnMainThread(); } - void TearDown() override { - PlatformAppBrowserTest::TearDown(); - } + void TearDown() override { PlatformAppBrowserTest::TearDown(); } base::FilePath GetDriveMountPoint() { return drivefs_mount_point_; } @@ -213,12 +208,6 @@ return drive::SetUpUserDataDirectoryForDriveFsTest(); } - void SetUpCommandLine(base::CommandLine* command_line) override { - PlatformAppBrowserTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII( - extensions::switches::kAllowlistedExtensionID, kTestingExtensionId); - } - // Sets up fake Drive service for tests (this has to be injected before the // real DriveIntegrationService instance is created.) void SetUpInProcessBrowserTestFixture() override { @@ -235,15 +224,8 @@ void SetUpOnMainThread() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - CreateTestingFileSystem(kWritableMountPointName, - file_manager::VOLUME_TYPE_TESTING, - false /* read_only */); - CreateTestingFileSystem(kReadOnlyMountPointName, - file_manager::VOLUME_TYPE_TESTING, - true /* read_only */); - CreateTestingFileSystem(kDownloadsMountPointName, - file_manager::VOLUME_TYPE_DOWNLOADS_DIRECTORY, - false /* read_only */); + CreateTestingFileSystem(kWritableMountPointName, false /* read_only */); + CreateTestingFileSystem(kReadOnlyMountPointName, true /* read_only */); PlatformAppBrowserTest::SetUpOnMainThread(); } @@ -270,7 +252,6 @@ // Creates a testing file system in a testing directory. void CreateTestingFileSystem(const std::string& mount_point_name, - VolumeType volume_type, bool read_only) { const base::FilePath mount_point_path = temp_dir_.GetPath().Append(mount_point_name); @@ -283,9 +264,9 @@ VolumeManager* const volume_manager = VolumeManager::Get(browser()->profile()); ASSERT_TRUE(volume_manager); - volume_manager->AddVolumeForTesting(mount_point_path, volume_type, - chromeos::DEVICE_TYPE_UNKNOWN, - read_only); + volume_manager->AddVolumeForTesting( + mount_point_path, file_manager::VOLUME_TYPE_TESTING, + chromeos::DEVICE_TYPE_UNKNOWN, read_only); } // Simulates entering the kiosk session. @@ -447,7 +428,7 @@ } IN_PROC_BROWSER_TEST_F(FileSystemApiTestForDrive, - FileSystemApiSaveNewFileWithWriteTest) { + FileSystemApiSaveNewFileWithWriteTest) { base::FilePath test_file = GetDriveMountPoint().AppendASCII("root/save_new.txt"); FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest picker( @@ -458,7 +439,7 @@ } IN_PROC_BROWSER_TEST_F(FileSystemApiTestForDrive, - FileSystemApiSaveExistingFileWithWriteTest) { + FileSystemApiSaveExistingFileWithWriteTest) { base::FilePath test_file = GetDriveMountPoint().AppendASCII("root/save_existing.txt"); FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest picker(
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc index 6f230e7e..bae6384 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
@@ -24,6 +24,7 @@ #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" #include "chromeos/ash/components/network/cellular_metrics_logger.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -32,7 +33,6 @@ #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_certificate_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.cc b/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.cc index 506ab3b..bb234617 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/extensions/api/networking_private/networking_private_ui_delegate_chromeos.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/extensions/api/system_private/system_private_api.cc b/chrome/browser/extensions/api/system_private/system_private_api.cc index 8b5709b..bd592cb5 100644 --- a/chrome/browser/extensions/api/system_private/system_private_api.cc +++ b/chrome/browser/extensions/api/system_private/system_private_api.cc
@@ -19,7 +19,7 @@ #include "google_apis/google_api_keys.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #else #include "chrome/browser/upgrade_detector/upgrade_detector.h" #endif @@ -71,7 +71,7 @@ // With UpdateEngineClient, we can provide more detailed information about // system updates on ChromeOS. const update_engine::StatusResult status = - chromeos::UpdateEngineClient::Get()->GetLastStatus(); + ash::UpdateEngineClient::Get()->GetLastStatus(); // |download_progress| is set to 1 after download finishes // (i.e. verify, finalize and need-reboot phase) to indicate the progress // even though |status.download_progress| is 0 in these phases.
diff --git a/chrome/browser/extensions/api/system_private/system_private_apitest.cc b/chrome/browser/extensions/api/system_private/system_private_apitest.cc index f7f7c1f..d20c2ab 100644 --- a/chrome/browser/extensions/api/system_private/system_private_apitest.cc +++ b/chrome/browser/extensions/api/system_private/system_private_apitest.cc
@@ -12,10 +12,8 @@ #include "content/public/test/browser_test.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" - -using chromeos::UpdateEngineClient; +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #endif namespace extensions { @@ -40,7 +38,8 @@ void SetUpInProcessBrowserTestFixture() override { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - fake_update_engine_client_ = UpdateEngineClient::InitializeFakeForTest(); + fake_update_engine_client_ = + ash::UpdateEngineClient::InitializeFakeForTest(); } void TearDownInProcessBrowserTestFixture() override { @@ -48,7 +47,7 @@ } protected: - chromeos::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; + ash::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; }; IN_PROC_BROWSER_TEST_F(GetUpdateStatusApiTest, Progress) {
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 0cd8572..f507a56 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -4699,6 +4699,11 @@ "expiry_milestone": 110 }, { + "name": "omnibox-paste-button", + "owners": [ "christianxu", "stkhapugin", "bling-flags@google.com" ], + "expiry_milestone": 108 + }, + { "name": "omnibox-retain-suggestions-with-headers", "owners": [ "ender@google.com", "mahmadi@google.com", "chrome-omnibox-team@google.com" ], "expiry_milestone": 112 @@ -6169,6 +6174,11 @@ "expiry_milestone": -1 }, { + "name": "use-dns-https-svcb-alpn", + "owners": [ "horo" ], + "expiry_milestone": 115 + }, + { "name": "use-fake-device-for-media-stream", "owners": [ "mcasas", "chromeos-gfx@google.com" ], // This flag is used for ChromeOS media testing to mock a source device.
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 9148258..110f7db 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -258,6 +258,11 @@ "ClientHello, depending on server support and whether those features are " "enabled."; +const char kUseDnsHttpsSvcbAlpnName[] = "Use DNS https alpn"; +const char kUseDnsHttpsSvcbAlpnDescription[] = + "When enabled, Chrome may try QUIC on the first connection using the ALPN" + " information in the DNS HTTPS record."; + const char kEnableFirstPartySetsName[] = "Enable First-Party Sets"; const char kEnableFirstPartySetsDescription[] = "When enabled, Chrome will apply First-Party Sets to features such as the "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 39c6889..39a1dfd 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -401,6 +401,9 @@ extern const char kDnsHttpsSvcbName[]; extern const char kDnsHttpsSvcbDescription[]; +extern const char kUseDnsHttpsSvcbAlpnName[]; +extern const char kUseDnsHttpsSvcbAlpnDescription[]; + extern const char kEditContextName[]; extern const char kEditContextDescription[];
diff --git a/chrome/browser/lifetime/application_lifetime_chromeos.cc b/chrome/browser/lifetime/application_lifetime_chromeos.cc index 8f420c5..07311cae 100644 --- a/chrome/browser/lifetime/application_lifetime_chromeos.cc +++ b/chrome/browser/lifetime/application_lifetime_chromeos.cc
@@ -5,16 +5,16 @@ #include "chrome/browser/lifetime/application_lifetime_chromeos.h" #include "chrome/browser/lifetime/application_lifetime.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" namespace chrome { namespace { -chromeos::UpdateEngineClient* GetUpdateEngineClient() { - chromeos::UpdateEngineClient* update_engine_client = - chromeos::UpdateEngineClient::Get(); +ash::UpdateEngineClient* GetUpdateEngineClient() { + ash::UpdateEngineClient* update_engine_client = + ash::UpdateEngineClient::Get(); DCHECK(update_engine_client); return update_engine_client; }
diff --git a/chrome/browser/lifetime/application_lifetime_chromeos_browsertest.cc b/chrome/browser/lifetime/application_lifetime_chromeos_browsertest.cc index 389c23c..e8c97b154 100644 --- a/chrome/browser/lifetime/application_lifetime_chromeos_browsertest.cc +++ b/chrome/browser/lifetime/application_lifetime_chromeos_browsertest.cc
@@ -12,9 +12,9 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/keep_alive_registry/keep_alive_registry.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" @@ -30,7 +30,7 @@ void SetUpInProcessBrowserTestFixture() override { InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); } void SetUpOnMainThread() override { @@ -74,7 +74,7 @@ } absl::optional<base::RunLoop> quits_on_browser_closing_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; + ash::FakeUpdateEngineClient* fake_update_engine_client_ = nullptr; }; IN_PROC_BROWSER_TEST_F(ApplicationLifetimeTest,
diff --git a/chrome/browser/lifetime/termination_notification.cc b/chrome/browser/lifetime/termination_notification.cc index 69727d8..0e1ff8a 100644 --- a/chrome/browser/lifetime/termination_notification.cc +++ b/chrome/browser/lifetime/termination_notification.cc
@@ -17,9 +17,9 @@ #include "ash/components/login/session/session_termination_manager.h" #include "chrome/browser/lifetime/application_lifetime_chromeos.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" // nogncheck #include "chromeos/dbus/power/power_policy_controller.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #endif namespace browser_shutdown {
diff --git a/chrome/browser/nearby_sharing/wifi_network_configuration/wifi_network_configuration_handler.cc b/chrome/browser/nearby_sharing/wifi_network_configuration/wifi_network_configuration_handler.cc index 3da9e81..c61a7dd 100644 --- a/chrome/browser/nearby_sharing/wifi_network_configuration/wifi_network_configuration_handler.cc +++ b/chrome/browser/nearby_sharing/wifi_network_configuration/wifi_network_configuration_handler.cc
@@ -6,7 +6,7 @@ #include "chrome/browser/nearby_sharing/logging/logging.h" #include "chrome/browser/nearby_sharing/nearby_share_metrics_logger.h" -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/services/network_config/in_process_instance.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
diff --git a/chrome/browser/policy/networking/user_network_configuration_updater_ash.cc b/chrome/browser/policy/networking/user_network_configuration_updater_ash.cc index 272c86f..000025c 100644 --- a/chrome/browser/policy/networking/user_network_configuration_updater_ash.cc +++ b/chrome/browser/policy/networking/user_network_configuration_updater_ash.cc
@@ -18,11 +18,11 @@ #include "chrome/browser/net/nss_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer_impl.h" #include "chromeos/components/onc/onc_parsed_certificates.h" #include "chromeos/components/onc/onc_utils.h" -#include "chromeos/network/network_cert_loader.h" #include "components/policy/policy_constants.h" #include "components/user_manager/user.h" #include "content/public/browser/browser_task_traits.h"
diff --git a/chrome/browser/policy/test/policy_certs_browsertest.cc b/chrome/browser/policy/test/policy_certs_browsertest.cc index 635031d5b..d20a368 100644 --- a/chrome/browser/policy/test/policy_certs_browsertest.cc +++ b/chrome/browser/policy/test/policy_certs_browsertest.cc
@@ -28,10 +28,10 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer_impl.h" #include "chromeos/components/onc/onc_test_utils.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/test/chromeos_test_utils.h" #include "components/onc/onc_constants.h" #include "components/policy/core/browser/browser_policy_connector.h"
diff --git a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_km.xtb b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_km.xtb index 82ebc86c..81ea2b16 100644 --- a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_km.xtb +++ b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_km.xtb
@@ -32,6 +32,7 @@ <translation id="1197088940767939838">ទឹកក្រូច</translation> <translation id="1198865190323699001">ចលនាចុច</translation> <translation id="1201402288615127009">បន្ទាប់</translation> +<translation id="1202112913213080585">បោះបង់</translation> <translation id="1206619573307042055">marquee</translation> <translation id="1207086294218137981">គ្មានផ្នែកក្បាលកម្រិតទី 4 បន្ទាប់ទេ</translation> <translation id="1212770441379271564">ផ្លូវកាត់មួយចំនួនបន្ទាប់មិនមែនជាបញ្ជារបស់ ChromeVox ទេ ប៉ុន្តែផ្លូវកាត់ទាំងនេះនៅតែមានប្រយោជន៍ ដើម្បីទទួលបានអត្ថប្រយោជន៍ច្រើនបំផុតពី Chrome។ @@ -43,6 +44,7 @@ ដើម្បីបើកម៉ឺនុយកម្មវិធីរុករកតាមអ៊ីនធឺណិត Chrome សូមចុច Alt+F។</translation> <translation id="1213216066620407844">ChromeVox - ការផ្តល់សម្លេងទៅ Chrome</translation> <translation id="1225969361094801578">ប្រផេះចាស់</translation> +<translation id="122928249241119550">ផ្លាស់ទីទៅប្រយោគមុន</translation> <translation id="1230503547248836149">ផ្នែកចាប់ផ្ដើមនៃការជ្រើសរើស</translation> <translation id="1236794971743289975">កំណត់ចំណាំនៅខាងចុង</translation> <translation id="1237797094773582699">ស្រដៀងគ្នានេះដែរ ការអូសដោយប្រើម្រាមដៃបួនពីស្ដាំទៅឆ្វេងអាចត្រូវបានប្រើ ដើម្បីទៅកាន់ផ្នែកមុន។ សាកល្បងឥឡូវនេះ!</translation> @@ -213,6 +215,7 @@ <translation id="2435422727584637732">ខៀវខ្ចី</translation> <translation id="2438712309510062123">ណែនាំ</translation> <translation id="2450814015951372393">ប្រអប់ធីក</translation> +<translation id="2450992626945324272">ផ្លាស់ទីទៅប្រយោគបន្ទាប់</translation> <translation id="2461822463642141190">បច្ចុប្បន្ន</translation> <translation id="2462626033734746142">ប៊ូតុងក្រុមវិទ្យុ</translation> <translation id="2467741090055146971">ដកការជ្រើសរើស</translation> @@ -489,6 +492,7 @@ <translation id="42164919740161077">ស៊ីលៀបចាស់</translation> <translation id="4217571870635786043">ការសរសេរតាមអាន</translation> <translation id="4218529045364428769">{COUNT,plural, =1{សញ្ញាដាស}other{# សញ្ញាដាស}}</translation> +<translation id="4220024144662591089">ជ្រើសរើសពី <ph name="START_PHRASE" /> ដល់ <ph name="END_PHRASE" /></translation> <translation id="4221012616705981690">គ្មានបញ្ជីមុនទេ</translation> <translation id="4225355998815256469">ការគ្រប់គ្រងទម្រង់បែបបទ</translation> <translation id="4230834257931120629">ប្រផេះស្រាល</translation> @@ -759,6 +763,7 @@ <translation id="611827076493383239">vtd</translation> <translation id="6122013438240733403">btn</translation> <translation id="6132506484792346370">ប្រអប់បញ្ជី ឬប្រអប់បន្សំ</translation> +<translation id="613344593214611552">លុបប្រយោគមុន</translation> <translation id="6142308968191113180">ផ្នែកក្បាល 4</translation> <translation id="6150023170003443621">បៃតងខ្ចី</translation> <translation id="6158882249329863701">ជួរដេកទី <ph name="TABLECELLROWINDEX" /> ជួរឈរទី <ph name="TABLECELLCOLUMNINDEX" /></translation> @@ -768,6 +773,7 @@ <translation id="6186305613600865047">លោតទៅខាងក្រោមទំព័រ</translation> <translation id="6187190722927752226">បៃតងខ្ចី</translation> <translation id="6197361807490522975">ខៀវចាស់</translation> +<translation id="6218813441317556731">ជំនួស <ph name="DELETE_PHRASE" /> ដោយ <ph name="INSERT_PHRASE" /></translation> <translation id="6236061028292614533">ផ្នែកក្បាលបន្ទាប់</translation> <translation id="6254901459154107917">តំបន់ដែលអាចកែប្រែអត្ថបទបានបន្ទាប់</translation> <translation id="6259464875943891919">បានចាកចេញ <ph name="TYPE" />។</translation> @@ -921,6 +927,7 @@ <translation id="7356610683936413584">ព័ត៌មានលម្អិតអំពីបញ្ជីពណ៌នា</translation> <translation id="7370432716629432284">{COUNT,plural, =1{សញ្ញានឹង}other{# សញ្ញានឹង}}</translation> <translation id="737396357417333429">clk</translation> +<translation id="7388656272362719103">លុបតួអក្សរមុន</translation> <translation id="738899727977260036">ប្រផេះចាស់</translation> <translation id="7393979322571982935">សំឡេង និងការកំណត់</translation> <translation id="739763518212184081">បន្ទាត់ពីមុន</translation> @@ -941,6 +948,7 @@ <translation id="7533226154149229506">លឿងខ្ចី</translation> <translation id="7543255924852002459">លុបចោលស្លាក</translation> <translation id="7552432549459840808">ផ្លូវកាត់ Chrome ដែលមានប្រយោជន៍</translation> +<translation id="7553679324939294712">បញ្ចូល <ph name="INSERT_PHRASE" /> នៅពីមុខ <ph name="BEFORE_PHRASE" /></translation> <translation id="7569983096843329377">ខ្មៅ</translation> <translation id="7579911500627256166">ចំណុច <ph name="DOT" /></translation> <translation id="7592060599656252486">មួយចំនួន</translation> @@ -964,6 +972,7 @@ <translation id="7684431668231950609">កែប្រែអត្ថបទ ធាតុបញ្ចូល URL</translation> <translation id="7685589220304187312">tlbar</translation> <translation id="7693840228159394336">ប៊ូតុងវិទ្យុពីមុន</translation> +<translation id="7696631298608145306">ផ្លាស់ទីទៅពាក្យបន្ទាប់</translation> <translation id="7701040980221191251">គ្មាន</translation> <translation id="7701196182766842984">autolst</translation> <translation id="7713139339518499741">សំឡេងធម្មជាតិ</translation> @@ -1071,6 +1080,7 @@ <translation id="8455868257606149352">អតិបរមា <ph name="X" /></translation> <translation id="84575901236241018">មានពាក្យគន្លឹះចូលប្រើ <ph name="KEY" /></translation> <translation id="8463645336674919227">កំពុងចាកចេញពីកំហុសវេយ្យាករណ៍</translation> +<translation id="8465573210279050749">លុបពាក្យមុន</translation> <translation id="847040613207937740">គ្មានប្រអប់ធីកបន្ទាប់ទេ</translation> <translation id="8473540203671727883">អានអត្ថបទនៅផ្នែកខាងក្រោមកណ្ដុរ</translation> <translation id="8476408756881832830">ផ្អាកការចាក់នៅពេលដែល ChromeVox កំពុងនិយាយ</translation> @@ -1107,6 +1117,7 @@ <translation id="8697111817566059991">{COUNT,plural, =1{បំពង់}other{# បំពង់ឈរ}}</translation> <translation id="8741370088760768424">តម្រុយ៖ ចុចស្វែងរក + ដកឃ្លា ដើម្បីបើកធាតុបច្ចុប្បន្ន។</translation> <translation id="8743786158317878347">ចូលមាតិការចនាសម្ព័ន្ធ ដូចជាតារាងជាដើម</translation> +<translation id="8746846427395705317">ផ្លាស់ទីទៅពាក្យមុន</translation> <translation id="8747966237988593539">បញ្ជីដែលបានតម្រៀប</translation> <translation id="8749988712346667988">ប្រាក់</translation> <translation id="875769700429317857">បានបញ្ចប់ការទាញយក <ph name="FILE_NAME" /></translation> @@ -1134,6 +1145,7 @@ <translation id="8970172509886453271">គ្មានផ្នែកមុនទេ</translation> <translation id="89720367119469899">គេច</translation> <translation id="8978496506222343566">tltip</translation> +<translation id="898089897833732740">លុប <ph name="PHRASE" /></translation> <translation id="8986362086234534611">បំភ្លេច</translation> <translation id="8989104346085848538">ដើម្បីបញ្ឈប់ការនិយាយបច្ចុប្បន្នរបស់ ChromeVox សូមចុចគ្រាប់ចុច Control។</translation> <translation id="8993737615451556423">ផ្ដល់ការគ្រប់គ្រង ដើម្បីបង្កើនល្បឿន បន្ថយល្បឿន និងផ្អាកសំឡេងអាន</translation>
diff --git a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_uz.xtb b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_uz.xtb index 2ce2651..53ba3c2 100644 --- a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_uz.xtb +++ b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings_uz.xtb
@@ -32,6 +32,7 @@ <translation id="1197088940767939838">Apelsinrang</translation> <translation id="1198865190323699001">Sensorli ishoralar</translation> <translation id="1201402288615127009">Keyingisi</translation> +<translation id="1202112913213080585">bekor qilish</translation> <translation id="1206619573307042055">marquee</translation> <translation id="1207086294218137981">Bundan keyin boshqa 2-darajali sarlavha mavjud emas</translation> <translation id="1212770441379271564">Quyidagi tezkor tugmalar ChromeVox buyruqlari emas, lekin Chrome bilan ishlashda juda foydali bo‘ladi: @@ -42,6 +43,7 @@ Chrome brauzeri menyusini ochish uchun “Alt + F” tugmalarini bosing.</translation> <translation id="1213216066620407844">ChromeVox - Chrome’ga ovoz baxsh etib</translation> <translation id="1225969361094801578">Koʻkimtir toʻq kulrang</translation> +<translation id="122928249241119550">avvalgi gapga oʻtish</translation> <translation id="1230503547248836149">Matnni belgilashni boshlash</translation> <translation id="1236794971743289975">Yakuniy izoh</translation> <translation id="1237797094773582699">Toʻrt barmoq bilan oʻngdan chapga surish kabi avvalgi boʻlimga qaytish mumkin. Hoziroq sinang!</translation> @@ -212,6 +214,7 @@ <translation id="2435422727584637732">Xira koʻk</translation> <translation id="2438712309510062123">Taklif qilish</translation> <translation id="2450814015951372393">Belgilash katakchasi</translation> +<translation id="2450992626945324272">keyingi gapga oʻtish</translation> <translation id="2461822463642141190">Ayni vaqtda</translation> <translation id="2462626033734746142">Tanlash tugmalari guruhi</translation> <translation id="2467741090055146971">tanlovni bekor qilish</translation> @@ -488,6 +491,7 @@ <translation id="42164919740161077">Eski gumbazrang</translation> <translation id="4217571870635786043">Ovoz bilan yozish</translation> <translation id="4218529045364428769">{COUNT,plural, =1{tire belgisi}other{# ta tire belgisi}}</translation> +<translation id="4220024144662591089"><ph name="START_PHRASE" /> — <ph name="END_PHRASE" /> dan tanlash</translation> <translation id="4221012616705981690">Bundan oldin boshqa roʻyxat mavjud emas</translation> <translation id="4225355998815256469">Shakl sozlamalari</translation> <translation id="4230834257931120629">Och koʻkimtir kulrang</translation> @@ -758,6 +762,7 @@ <translation id="611827076493383239">vtd</translation> <translation id="6122013438240733403">btn</translation> <translation id="6132506484792346370">Oddiy yoki birlashgan ro‘yxat</translation> +<translation id="613344593214611552">avvalgi gapni oʻchirish</translation> <translation id="6142308968191113180">4-darajali sarlavha</translation> <translation id="6150023170003443621">Yorqin yashil</translation> <translation id="6158882249329863701"><ph name="TABLECELLROWINDEX" />-qator <ph name="TABLECELLCOLUMNINDEX" />-ustun</translation> @@ -767,6 +772,7 @@ <translation id="6186305613600865047">Sahifaning oxiriga o‘tish</translation> <translation id="6187190722927752226">Och dengizrang</translation> <translation id="6197361807490522975">Toʻq moviy</translation> +<translation id="6218813441317556731"><ph name="DELETE_PHRASE" /> iborasini <ph name="INSERT_PHRASE" />ga almashtirish</translation> <translation id="6236061028292614533">Keyingi sarlavha</translation> <translation id="6254901459154107917">Keyingi matn tahrirlash qatori</translation> <translation id="6259464875943891919"><ph name="TYPE" /> konteyneridan chiqish.</translation> @@ -920,6 +926,7 @@ <translation id="7356610683936413584">Tavsif roʻyxat elementi</translation> <translation id="7370432716629432284">{COUNT,plural, =1{ampersand}other{# ta ampersand}}</translation> <translation id="737396357417333429">clk</translation> +<translation id="7388656272362719103">avvalgi belgini oʻchirish</translation> <translation id="738899727977260036">Koʻkimtir kulrang</translation> <translation id="7393979322571982935">Tovushlar va sozlamalar</translation> <translation id="739763518212184081">Avvalgi qator</translation> @@ -940,6 +947,7 @@ <translation id="7533226154149229506">Oqimtir sariq</translation> <translation id="7543255924852002459">“Bekor qilish” tugmasi</translation> <translation id="7552432549459840808">Foydali Chrome tezkor tugmalari</translation> +<translation id="7553679324939294712"><ph name="INSERT_PHRASE" /> iborasini <ph name="BEFORE_PHRASE" /> dan avval joylash</translation> <translation id="7569983096843329377">Qora</translation> <translation id="7579911500627256166">nuqta <ph name="DOT" /></translation> <translation id="7592060599656252486">Ayrimlar</translation> @@ -963,6 +971,7 @@ <translation id="7684431668231950609">Matnni tahrirlash, URL manzil</translation> <translation id="7685589220304187312">tlbar</translation> <translation id="7693840228159394336">Avvalgi tanlash tugmasi</translation> +<translation id="7696631298608145306">keyingi soʻzga oʻtish</translation> <translation id="7701040980221191251">Hech qanday</translation> <translation id="7701196182766842984">autolst</translation> <translation id="7713139339518499741">Tabiiy ovoz</translation> @@ -1070,6 +1079,7 @@ <translation id="8455868257606149352">Maks <ph name="X" /></translation> <translation id="84575901236241018"><ph name="KEY" /> ruxsat kaliti bor</translation> <translation id="8463645336674919227">Grammatik xatoni qoldirish</translation> +<translation id="8465573210279050749">avvalgi soʻzni oʻchirish</translation> <translation id="847040613207937740">Keyingi belgilash katakchasi mavjud emas</translation> <translation id="8473540203671727883">Sichqoncha ostidagi matnni ovoz chiqarib oʻqish</translation> <translation id="8476408756881832830">ChromeVox ekrandan o‘qiyotganda media fayllar ijrosi vaqtincha to‘xtatilsin</translation> @@ -1106,6 +1116,7 @@ <translation id="8697111817566059991">{COUNT,plural, =1{vertikal chiziq}other{ # ta vertikal chiziq}}</translation> <translation id="8741370088760768424">Maslahat: Joriy elementni faollashtirish uchun Qidiruv + Boʻsh joy tugmalarini bosing.</translation> <translation id="8743786158317878347">jadval kabi tartiblangan ma’lumot kiritish</translation> +<translation id="8746846427395705317">avvalgi soʻzga oʻtish</translation> <translation id="8747966237988593539">Tartibli ro‘yxat</translation> <translation id="8749988712346667988">Kumushrang</translation> <translation id="875769700429317857"><ph name="FILE_NAME" /> fayli yuklab olindi</translation> @@ -1133,6 +1144,7 @@ <translation id="8970172509886453271">Bundan oldin boshqa qism mavjud emas</translation> <translation id="89720367119469899">O‘chirib qo‘yish</translation> <translation id="8978496506222343566">tltip</translation> +<translation id="898089897833732740"><ph name="PHRASE" /> iborasini oʻchirish</translation> <translation id="8986362086234534611">Olib tashlash</translation> <translation id="8989104346085848538">ChromeVox nutqini toʻxtatish uchun Control tugmasini bosing.</translation> <translation id="8993737615451556423">Oʻqish ovozini tezlatish, sekinlatish va pauza qilish kabi boshqaruv elementlarini chiqaradi</translation>
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_group.js b/chrome/browser/resources/chromeos/emoji_picker/emoji_group.js index 04f148b..fd0fd15 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_group.js +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_group.js
@@ -34,6 +34,8 @@ return { /** @type {!Array<EmojiVariants>} */ data: {type: Array, readonly: true}, + /** @type {?string} */ + group: {type: String, value: null, readonly: true}, /** @type {Object<string,string>} */ preferred: {type: Object, value: () => ({})}, /** @type {boolean} */
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html index c53dba9..44871d2 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html
@@ -360,19 +360,25 @@ history is the "recently used" group and is populated in code, whereas the other groups are created from the emoji metadata. --> - <div data-group="history"> - <template is="dom-if" if="[[emojiHistory.emoji.length]]"> - <emoji-group data="[[emojiHistory.emoji]]" - group="[[emojiHistory.group]]" preferred="{}" clearable - class="group history" category="emoji"> + + <div data-group="emoji-history"> + <template is="dom-if" + if="[[isHistoryGroupVisible( + categoryHistoryVisibility.emoji, + categoriesHistory.emoji.data.history)]]"> + <emoji-group + data="[[getHistoryEmojis(categoriesHistory.emoji.data.history)]]" + group="Recently used" + preferred="{}" clearable class="group history" + category="emoji"> </emoji-group> </template> </div> <template is="dom-repeat" items="[[emojiData]]"> <div data-group$="[[getDataGroupIndex('emoji', index)]]"> <emoji-group data="[[item.emoji]]" group="[[item.group]]" - preferred="[[preferenceMapping]]" class="group" - category="emoji"> + preferred="{{categoriesHistory.emoji.data.preference}}" + class="group" category="emoji"> </emoji-group> </div> </template> @@ -381,11 +387,14 @@ <template is="dom-if" if="[[v2Enabled]]"> <div data-group="emoticon-history"> <template is="dom-if" - if="[[_isHistoryReadyToPresent( - emojiGroupsFullyLoaded,emoticonHistory.emoji.length)]]"> - <emoji-group data="[[emoticonHistory.emoji]]" - group="[[emoticonHistory.group]]" - clearable class="group history" + if="[[isHistoryGroupVisible( + categoryHistoryVisibility.emoticon, + categoriesHistory.emoticon.data.history)]]"> + <emoji-group + data="[[getHistoryEmojis( + categoriesHistory.emoticon.data.history)]]" + group="Recently used" + preferred="{}" clearable class="group history" category="emoticon"> </emoji-group> </template>
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js index 22c9282..393ac77b 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js
@@ -21,20 +21,6 @@ const EMOJI_ORDERING_JSON_TEMPLATE = '/emoji_14_0_ordering'; const EMOTICON_ORDERING_JSON_TEMPLATE = '/emoticon_ordering.json'; -/** - * Constructs the emoji group data structure from a given list of recent emoji - * data from localstorage. - * - * @param {!Array<StoredItem>} recentEmoji list of recently used emoji strings. - * @return {!Array<EmojiVariants>} list of emoji data structures - */ -function makeRecentlyUsed(recentEmoji) { - return recentEmoji.map( - emoji => ({ - base: {string: emoji.base, name: emoji.name, keywords: []}, - alternates: emoji.alternates - })); -} export class EmojiPicker extends PolymerElement { static get is() { @@ -51,7 +37,7 @@ emojiDataUrl: {type: String, value: EMOJI_ORDERING_JSON_TEMPLATE}, /** {string} */ emoticonDataUrl: {type: String, value: EMOTICON_ORDERING_JSON_TEMPLATE}, - /** @private {string} */ + /** @private {CategoryEnum} */ category: {type: String, value: 'emoji', observer: 'onCategoryChanged'}, /** @type {string} */ /** @private {!Array<!SubcategoryData>} */ @@ -66,12 +52,8 @@ categoriesData: {type: Array, value: () => ([])}, /** @type {?EmojiGroupData} */ emoticonData: {type: Array, value: () => ([])}, - /** @private {Object<string,string>} */ - preferenceMapping: {type: Object}, - /** @private {!EmojiGroup} */ - emojiHistory: {type: Object}, - /** @private {!EmojiGroup} */ - emoticonHistory: {type: Object}, + /** @private {Object<CategoryEnum,RecentlyUsedStore>} */ + categoriesHistory: {type: Object, value: () => ({})}, /** @private {number} */ pagination: {type: Number, value: 1, observer: 'onPaginationChanged'}, /** @private {string} */ @@ -90,30 +72,21 @@ /** @private {boolean} */ searchExtensionEnabled: {type: Boolean, value: false}, /** @private {boolean} */ - emojiGroupsFullyLoaded: {type: Boolean, value: false}, + incognito: {type: Boolean, value: true}, + /** @private {Object<CategoryEnum,Boolean>} */ + categoryHistoryVisibility: {type: Object, value: () => ({})}, }; } constructor() { super(); - /** @type {!RecentlyUsedStore} */ - this.recentEmojiStore = new RecentlyUsedStore('emoji-recently-used'); - /** @type {!RecentlyUsedStore} */ - this.recentEmoticonStore = new RecentlyUsedStore('emoticon-recently-used'); + // Incognito mode is set based on the default value. + this.updateIncognitoState(this.incognito); this.emojiGroupTabs = EMOJI_GROUP_TABS; this.emojiData = []; - // TODO(b/216475720): rename the data structure below for a generic naming. - this.emojiHistory = { - 'group': 'Recently used', 'emoji': [], 'category': CategoryEnum.EMOJI}; - this.emoticonHistory = { - 'group': 'Recently used', 'emoji': [], - 'category': CategoryEnum.EMOTICON}; - - this.preferenceMapping = {}; - /** @private {?number} */ this.scrollTimeout = null; @@ -150,7 +123,6 @@ ev => this.onShowEmojiVariants( /** @type {!events.EmojiVariantsShownEvent} */ (ev))); this.addEventListener('click', () => this.hideDialogs()); - this.getHistory(); } /** @@ -163,20 +135,9 @@ }; } - async getHistory() { - const incognito = (await this.apiProxy_.isIncognitoTextField()).incognito; - if (incognito) { - this.set(['emojiHistory', 'emoji'], makeRecentlyUsed([])); - this.set(['emoticonHistory', 'emoji'], makeRecentlyUsed([])); - } else { - this.set( - ['emojiHistory', 'emoji'], - makeRecentlyUsed(this.recentEmojiStore.data.history || [])); - this.set( - ['emoticonHistory', 'emoji'], - makeRecentlyUsed(this.recentEmoticonStore.data.history || [])); - this.set( - ['preferenceMapping'], this.recentEmojiStore.getPreferenceMapping()); + initHistoryUI(incognito) { + if (incognito !== this.incognito) { + this.updateIncognitoState(incognito); } this.updateHistoryTabDisabledProperty(); // Make highlight bar visible (now we know where it should be) and @@ -193,8 +154,11 @@ const initializationPromise = Promise.all([ this.apiProxy_.getFeatureList().then( (response) => this.setActiveFeatures(response.featureList)), - this.fetchOrderingData(this.emojiDataUrl + '_start.json') - .then(data => this.onEmojiDataLoaded(data)) + this.fetchOrderingData( + this.emojiDataUrl + '_start.json').then( + data => this.onEmojiDataLoaded(data)), + this.apiProxy_.isIncognitoTextField().then( + (response) => this.initHistoryUI(response.incognito)) ]); initializationPromise.then(() => { @@ -275,6 +239,9 @@ emojiGroup.category = category; }); + // Allow history group to be visible. + this.updateHistoryVisibility(category, true); + // TODO(b/235418846): Remove the following. // Update the data variable of the category. switch (category) { @@ -320,36 +287,17 @@ /** * @param {CategoryEnum} category - * @param {{emoji: string, isVariant: boolean, baseEmoji: string, allVariants: - * !Array<!string>, name: string}} item + * @param {{emoji: string, isVariant: boolean, baseEmoji: string, + * allVariants: ?Array<!string>, name: string}} item */ async insertText(category, item) { const {text, isVariant, baseEmoji, allVariants, name} = item; this.$.message.textContent = text + ' inserted.'; - const incognito = (await this.apiProxy_.isIncognitoTextField()).incognito; - if (!incognito) { - switch (category) { - case CategoryEnum.EMOJI: - this.recentEmojiStore.bumpItem( - {base: text, alternates: allVariants, name: name}); - this.recentEmojiStore.savePreferredVariant(baseEmoji, text); - this.set( - ['emojiHistory', 'emoji'], - makeRecentlyUsed(this.recentEmojiStore.data.history)); - break; + this.insertHistoryItem(category, + {selectedEmoji: text, baseEmoji: baseEmoji, + alternates: allVariants || [], name: name}); - case CategoryEnum.EMOTICON: - this.recentEmoticonStore.bumpItem({base: text, name, alternates: []}); - this.set( - ['emoticonHistory', 'emoji'], - makeRecentlyUsed(this.recentEmoticonStore.data.history)); - break; - - default: - throw new Error(`Unknown category "${category}."`); - } - } const searchLength = /** @type {!CrSearchFieldElement} */ ( this.$['search-container'].shadowRoot.querySelector( @@ -362,28 +310,13 @@ } clearRecentEmoji(event) { - switch (event.detail.category) { - case CategoryEnum.EMOJI: - this.set(['emojiHistory', 'emoji'], makeRecentlyUsed([])); - this.recentEmojiStore.clearRecents(); - break; - - case CategoryEnum.EMOTICON: - this.set(['emoticonHistory', 'emoji'], makeRecentlyUsed([])); - this.recentEmoticonStore.clearRecents(); - break; - - default: - throw new Error( - 'Clear history logic is not implemented ' + - `for category "${this.category}."`); - } - + const category = event.detail.category; + this.clearHistoryData(category); afterNextRender( this, () => { this.updateActiveGroup(/*updateTabsScroll=*/ true); this.updateHistoryTabDisabledProperty(); - }); + }); } /** @@ -440,7 +373,7 @@ this.$.tabs.scrollLeft = 0; this.scrollToGroup(EMOJI_GROUP_TABS[0].groupId); this.groupTabsMoving = true; - if (this.emojiHistory.emoji.length > 0) { + if (!this.isCategoryHistoryEmpty(CategoryEnum.EMOJI)) { this.$.bar.style.left = '0'; } else { this.$.bar.style.left = constants.EMOJI_PICKER_TOTAL_EMOJI_WIDTH_PX; @@ -534,7 +467,8 @@ const activeGroup = groupElements.find( el => el.getBoundingClientRect().bottom - thisRect.top >= 10); - const activeGroupId = activeGroup ? activeGroup.dataset.group : 'history'; + const activeGroupId = activeGroup ? + activeGroup.dataset.group : 'emoji-history'; return activeGroupId; } @@ -562,12 +496,8 @@ this.set(['emojiGroupTabs', i, 'active'], isActive); }); - const shouldDeactivateEmojiHistoryTab = this.category === 'emoji' && - index === 0 && this.emojiHistory.emoji.length === 0; - const shouldDeactivateEmoticonHistoryTab = this.category === 'emoticon' && - index === 0 && this.emoticonHistory.emoji.length === 0; // Ensure that the history tab is not set as active if it is empty. - if (shouldDeactivateEmojiHistoryTab || shouldDeactivateEmoticonHistoryTab) { + if (index === 0 && this.isCategoryHistoryEmpty(this.category)) { this.set(['emojiGroupTabs', 0, 'active'], false); this.set(['emojiGroupTabs', 1, 'active'], true); index = 1; @@ -659,25 +589,13 @@ hideDialogs() { this.hideEmojiVariants(); - if (this.emojiHistory.emoji.length > 0) { - this.shadowRoot.querySelector(`div[data-group="history"]`) - .querySelector('emoji-group') - .showClearRecents = false; - } - if (this.emoticonHistory.emoji.length > 0) { - /** - * When disabling V2, V1 can still access the history even though there - * is be no emoticon-history element. - * For V2, emoticon can be there but emoji-groups can be loaded later. - */ - const emoticonHistoryElement = this.shadowRoot.querySelector( - `div[data-group="emoticon-history"]`); - if (emoticonHistoryElement) { - const emoticonGroup = emoticonHistoryElement.querySelector( - 'emoji-group'); - if (emoticonGroup) { - emoticonGroup.showClearRecents = false; + for (const category of Object.values(CategoryEnum)) { + if (!this.isCategoryHistoryEmpty(category)) { + const historyButton = this.shadowRoot.querySelector( + `emoji-group.history[category=${category}]`); + if (historyButton) { + historyButton.showClearRecents = false; } } } @@ -691,59 +609,155 @@ } /** - * Returns true when there are history items ("Recently Used") and - * the previous groups (e.g. emoji) are already shown. This function - * is a helper to implement the logic in the UI components. - * - * @param {boolean} previousGroupShown A boolean denoting - * whether the previous group is show. - * @param {number} historyLength Lengths of the history items. - * @returns {boolean} - */ - _isHistoryReadyToPresent(previousGroupShown, historyLength) { - return previousGroupShown && historyLength > 0; - } - - /** * Disables the history tab when there is no usage history for the * selected category and enables it otherwise. */ updateHistoryTabDisabledProperty() { this.set( ['emojiGroupTabs', 0, 'disabled'], - this.isCategoryUsageHistoryEmpty(this.category) - ); + this.isCategoryHistoryEmpty(this.category) + ); } /** - * Returns whether the usage history of a give category is empty or not. - * @param {string} category Input category. - * @returns {boolean} + * Sets the visibility of the history group for a category. + * + * @param {CategoryEnum} category + * @param {boolean} visible If history group needs to be visible or hidden. */ - isCategoryUsageHistoryEmpty(category) { - return this.getCategoryUsageHistory(this.category).emoji.length === 0; + updateHistoryVisibility(category, visible) { + // TODO(b/235418846): Remove the func when adding history to emoji groups. + this.set(['categoryHistoryVisibility', category], visible); } /** - * Returns the usage history instance for a given category. - * @param {string} category Input category. - * @returns {EmojiGroup} The history instance for the given category. + * Checks if history group need to be visible in the UI. + * + * @param {?boolean} visible True if the history group is allowed to be + * visible. + * @param {?Array<StoredItem>} historyDataItems Array of history items. + * @returns {?boolean} True if there are history items and group is allowed + * to be visible and False otherwise. */ - getCategoryUsageHistory(category) { - // TODO(b/231500029): Simplify the logic after unifying `history` structs. - // Histories for different categories (e.g. emoticon and emoji) can be - // maintained as a dictionary of Object<CategoryEnum,EmojiGroup> to allow - // generalization to more categories without much code duplication. In that - // case, the following logic can be simplified as a dictionary lookup. + isHistoryGroupVisible(visible, historyDataItems) { + // TODO(b/235418846): Remove the func when adding history to emoji groups. + return visible && historyDataItems && historyDataItems.length > 0; + } - switch (category) { - case CategoryEnum.EMOJI: - return this.emojiHistory; - case CategoryEnum.EMOTICON: - return this.emoticonHistory; - default: - throw new Error(`Unknown category "${category}."`); + /** + * Converts history stored items to list of emojis. + * + * @param {!Array<StoredItem>} storedItems List of recently used stored + * items. + * @return {!Array<EmojiVariants>} List of emojis. + */ + getHistoryEmojis(storedItems) { + // TODO(b/235418846): Change the argument to category. + if (!storedItems) { + return []; } + + return storedItems.map( + emoji => ({ + base: {string: emoji.base, name: emoji.name, keywords: []}, + alternates: emoji.alternates + })); + } + + /** + * Handles the event where history or preferences are modified for a + * category. + * + * @param {CategoryEnum} category Category of the modified history. + * @param {boolean} historyUpdated True only if history items are updated. + * @param {boolean} preferenceUpdated True only if preferences are updated. + */ + categoryHistoryUpdated(category, + historyUpdated = true, preferenceUpdated = true) { + + // TODO(b/235418846): Remove the notifications. + // Notify the path that is updated. Manual update is required given + // history storage is outside Polymer but HTML depends on it. + if(historyUpdated) { + this.notifyPath(`categoriesHistory.${category}.data.history`); + } + if(preferenceUpdated) { + this.notifyPath(`categoriesHistory.${category}.data.preference`); + } + } + + /** + * Updates incognito state and variables that needs to be updated by the + * change of incognito state. + * + * @param {boolean} incognito True for incognito mode. + */ + updateIncognitoState(incognito) { + this.incognito = incognito; + + // TODO(b/235418846): Remove the dummy history. + // Set the recently used to a dummy history for incognito state. + // This is used to reduce the complexity for handling of special + // case of empty history when rendering the UI. + // Note: no data must be saved in the dummy history. + const dummyRecentlyUsed = incognito ? + new RecentlyUsedStore('dummy-empty-recently-used') : null; + + // Load the history items for each category. + for (const category of Object.values(CategoryEnum)) { + this.categoriesHistory[category] = incognito ? + dummyRecentlyUsed : new RecentlyUsedStore(`${category}-recently-used`); + this.categoryHistoryUpdated(category, true, true); + } + } + + /** + * Inserts a new item to the history of a category. It will do nothing during + * incognito state. + * + * @param {CategoryEnum} category + * @param {{selectedEmoji: string, baseEmoji: string, + * alternates: !Array<!string>, name: string}} item + */ + insertHistoryItem(category, item) { + if (this.incognito) { + return; + } + + const {selectedEmoji, baseEmoji, alternates, name} = item; + + this.categoriesHistory[category].bumpItem({ + base: selectedEmoji, alternates: alternates, name: name}); + + const preferenceUpdated = this.categoriesHistory[category] + .savePreferredVariant(baseEmoji, selectedEmoji); + + this.categoryHistoryUpdated(category, true, preferenceUpdated); + } + + /** + * Clears history items for a category. + * + * @param {CategoryEnum} category Category of the history items. + */ + clearHistoryData(category) { + if (this.incognito) { + return; + } + + this.categoriesHistory[category].clearRecents(); + this.categoryHistoryUpdated(category, true, false); + } + + /** + * Check if the history items of a category is empty. + * + * @param {CategoryEnum} category Input category. + * @returns {boolean} True for empty history. + */ + isCategoryHistoryEmpty(category) { + return this.incognito || + this.categoriesHistory[category].data.history.length == 0; } /** @@ -825,9 +839,6 @@ this.updateCategoryData(data, CategoryEnum.EMOJI, !this.v2Enabled); this.dispatchEvent(events.createCustomEvent( events.EMOJI_REMAINING_DATA_LOADED)); - afterNextRender(this, () => { - this.emojiGroupsFullyLoaded = true; - }); } /** @@ -885,15 +896,6 @@ } /** - * @private - * @param {SubcategoryData} tab - * @return {boolean} - */ - isNonHistoryTab(tab) { - return tab.groupId !== 'history'; - } - - /** * Returns true if the subcategory bar requires text group buttons. * @private * @param {boolean} v2Enabled @@ -934,6 +936,7 @@ * @returns */ getDataGroupIndex(category, offsetIndex) { + // TODO(b/235418846): Remove the func after adding history to emoji groups. const firstTabByCategory = V2_SUBCATEGORY_TABS.find( tab => tab.category === category && !tab.groupId.includes('history')); return parseInt(firstTabByCategory.groupId, 10) + offsetIndex;
diff --git a/chrome/browser/resources/chromeos/emoji_picker/metadata_extension.js b/chrome/browser/resources/chromeos/emoji_picker/metadata_extension.js index 609d023..a85d518a 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/metadata_extension.js +++ b/chrome/browser/resources/chromeos/emoji_picker/metadata_extension.js
@@ -28,7 +28,7 @@ name: 'Recently Used', icon: 'emoji_picker:schedule', category: 'emoji', - groupId: 'history', + groupId: 'emoji-history', active: false, disabled: true, pagination: 1
diff --git a/chrome/browser/resources/chromeos/emoji_picker/store.js b/chrome/browser/resources/chromeos/emoji_picker/store.js index b08411a..f1f24457 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/store.js +++ b/chrome/browser/resources/chromeos/emoji_picker/store.js
@@ -35,12 +35,32 @@ this.data = load(name); } + /** + * Saves preferences for a base emoji. + * + * @param {string} baseEmoji + * @param {string} variant + * @returns {boolean} True if any preferences are updated and false + * otherwise. + */ savePreferredVariant(baseEmoji, variant) { if (!baseEmoji) { - return; + return false; } - this.data.preference[baseEmoji] = variant; + + // Base emoji must not be set as preference. So, store it only + // if variant and baseEmoji are different and remove it from preference + // otherwise. + if (baseEmoji !== variant && variant) { + this.data.preference[baseEmoji] = variant; + } else if (baseEmoji in this.data.preference) { + delete this.data.preference[baseEmoji]; + } else { + return false; + } + save(this.storeName, this.data); + return true; } getPreferenceMapping() {
diff --git a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.html b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.html index 6a9157b..fb81c9f 100644 --- a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.html +++ b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.html
@@ -1,7 +1,31 @@ -<style include="settings-shared"></style> -<div id="export" class="settings-box first"> +<style include="settings-shared"> + .container-select { + padding: 0 8px; + } + + .two-line-settings-box { + min-height: 80px; + } + + #secondaryText { + padding: 3px 0; + } +</style> +<div id="export" + class$="settings-box first [[getSettingsBoxClass_(allContainers_)]]"> <div id="exportCrostiniLabel" class="start"> $i18n{crostiniExportLabel} + <template is="dom-if" if="[[showContainerSelect_]]" restamp> + <div class="secondary" id="secondaryText"> + Container to backup + <settings-crostini-container-select + class="container-select" + id="exportContainerSelect" + containers="[[allContainers_]]" + selected-container-id="{{exportContainerId_}}"> + </settings-crostini-container-select> + </div> + </template> </div> <cr-button on-click="onExportClick_" disabled="[[!enableButtons_]]" aria-labelledby="exportCrostiniLabel" @@ -9,9 +33,20 @@ $i18n{crostiniExport} </cr-button> </div> -<div id="import" class="settings-box hr"> +<div id="import" class$="settings-box [[getSettingsBoxClass_(allContainers_)]]"> <div id="importCrostiniLabel" class="start"> $i18n{crostiniImportLabel} + <template is="dom-if" if="[[showContainerSelect_]]" restamp> + <div class="secondary" id="secondaryText"> + Container to restore + <settings-crostini-container-select + class="container-select" + id="importContainerSelect" + containers="[[allContainers_]]" + selected-container-id="{{importContainerId_}}"> + </settings-crostini-container-select> + </div> + </template> </div> <cr-button on-click="onImportClick_" disabled="[[!enableButtons_]]" aria-labelledby="importCrostiniLabel" @@ -21,6 +56,7 @@ </div> <template is="dom-if" if="[[showImportConfirmationDialog_]]" restamp> <settings-crostini-import-confirmation-dialog - on-close="onImportConfirmationDialogClose_"> + on-close="onImportConfirmationDialogClose_" + import-container-id="{{importContainerId_}}"> </settings-crostini-import-confirmation-dialog> </template>
diff --git a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.js b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.js index 9d0df3a8..365f3b0 100644 --- a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.js +++ b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_export_import.js
@@ -20,7 +20,8 @@ import {routes} from '../os_route.js'; import {RouteObserverBehavior, RouteObserverBehaviorInterface} from '../route_observer_behavior.js'; -import {CrostiniBrowserProxy, CrostiniBrowserProxyImpl, DEFAULT_CROSTINI_CONTAINER, DEFAULT_CROSTINI_VM} from './crostini_browser_proxy.js'; +import {ContainerInfo, CrostiniBrowserProxy, CrostiniBrowserProxyImpl, DEFAULT_CONTAINER_ID, GuestId} from './crostini_browser_proxy.js'; +import {equalContainerId} from './crostini_container_select.js'; /** * @constructor @@ -60,7 +61,16 @@ enableButtons_: { type: Boolean, computed: - 'setEnableButtons_(installerShowing_, exportImportInProgress_)', + 'isEnabledButtons_(installerShowing_, exportImportInProgress_)', + }, + + /** + * Whether the container select element is displayed. + * @private {boolean} + */ + showContainerSelect_: { + type: Boolean, + computed: 'isMultiContainer_(allContainers_)', }, /** @private */ @@ -76,6 +86,41 @@ }, /** + * The known containers for display in the UI. + * @private {!Array<!ContainerInfo>} + */ + allContainers_: { + type: Array, + notify: true, + value() { + return []; + }, + }, + + /** + * The GuestId of the container to be exported. + * @private {!GuestId} + */ + exportContainerId_: { + type: Object, + value() { + return DEFAULT_CONTAINER_ID; + }, + }, + + /** + * The GuestId of the container to be overwritten by an imported + * container file. + * @private {!GuestId} + */ + importContainerId_: { + type: Object, + value() { + return DEFAULT_CONTAINER_ID; + }, + }, + + /** * Used by DeepLinkingBehavior to focus this page's deep links. * @type {!Set<!chromeos.settings.mojom.Setting>} */ @@ -96,9 +141,9 @@ this.browserProxy_ = CrostiniBrowserProxyImpl.getInstance(); } + /** @override */ connectedCallback() { super.connectedCallback(); - this.addWebUIListener( 'crostini-export-import-operation-status-changed', inProgress => { this.exportImportInProgress_ = inProgress; @@ -107,9 +152,12 @@ 'crostini-installer-status-changed', installerShowing => { this.installerShowing_ = installerShowing; }); + this.addWebUIListener( + 'crostini-container-info', (infos) => this.onContainerInfo_(infos)); this.browserProxy_.requestCrostiniExportImportOperationStatus(); this.browserProxy_.requestCrostiniInstallerStatus(); + this.browserProxy_.requestContainerInfo(); } /** @@ -125,12 +173,21 @@ this.attemptDeepLink(); } + /** + * @param {!Array<!ContainerInfo>} containerInfos + * @private + */ + onContainerInfo_(containerInfos) { + this.allContainers_ = containerInfos; + if (!this.isMultiContainer_(containerInfos)) { + this.exportContainerId_ = DEFAULT_CONTAINER_ID; + this.importContainerId_ = DEFAULT_CONTAINER_ID; + } + } + /** @private */ onExportClick_() { - this.browserProxy_.exportCrostiniContainer({ - vm_name: DEFAULT_CROSTINI_VM, - container_name: DEFAULT_CROSTINI_CONTAINER - }); + this.browserProxy_.exportCrostiniContainer(this.exportContainerId_); } /** @private */ @@ -144,13 +201,29 @@ } /** - * @param {boolean} installerShowing - * @param {boolean} exportImportInProgress + * @param {!Boolean} installerShowing + * @param {!Boolean} exportImportInProgress * @private */ - setEnableButtons_(installerShowing, exportImportInProgress) { + isEnabledButtons_(installerShowing, exportImportInProgress) { return !(installerShowing || exportImportInProgress); } + + + /** + * @param {!Array<!ContainerInfo>} allContainers + * @return boolean + * @private + */ + isMultiContainer_(allContainers) { + return !( + allContainers.length === 1 && + equalContainerId(allContainers[0].id, DEFAULT_CONTAINER_ID)); + } + + getSettingsBoxClass_(allContainers) { + return this.isMultiContainer_(allContainers) ? 'two-line-settings-box' : ''; + } } customElements.define(
diff --git a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_import_confirmation_dialog.js b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_import_confirmation_dialog.js index d43a26d..51aa8c9 100644 --- a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_import_confirmation_dialog.js +++ b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_import_confirmation_dialog.js
@@ -13,7 +13,7 @@ import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {CrostiniBrowserProxy, CrostiniBrowserProxyImpl, DEFAULT_CROSTINI_CONTAINER, DEFAULT_CROSTINI_VM} from './crostini_browser_proxy.js'; +import {CrostiniBrowserProxy, CrostiniBrowserProxyImpl, GuestId} from './crostini_browser_proxy.js'; /** @polymer */ class SettingsCrostiniImportConfirmationDialogElement extends PolymerElement { @@ -25,6 +25,15 @@ return html`{__html_template__}`; } + static get properties() { + return { + /** @type {!GuestId} */ + importContainerId: { + type: Object, + }, + }; + } + constructor() { super(); @@ -46,10 +55,7 @@ /** @private */ onContinueTap_() { - this.browserProxy_.importCrostiniContainer({ - vm_name: DEFAULT_CROSTINI_VM, - container_name: DEFAULT_CROSTINI_CONTAINER - }); + this.browserProxy_.importCrostiniContainer(this.importContainerId); this.$.dialog.close(); } }
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.html b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.html index 10651c33..69308ae 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.html
@@ -12,7 +12,6 @@ #dialog { background-color: var(--cr-card-background-color); border: 0; - display: block; height: 100vh; margin: 0; max-height: 100vh; @@ -21,6 +20,10 @@ width: 100vw; } + #dialog[open] { + display: block; + } + settings-privacy-guide-page::part(privacyGuideCard) { background-color: transparent; box-shadow: none;
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/chrome/browser/resources/settings/privacy_page/privacy_page.ts index 98a6d4a2..58f04f7 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts
@@ -353,7 +353,7 @@ } private onPrivacyGuideDialogClosed_() { - Router.getInstance().navigateTo(routes.PRIVACY_GUIDE.parent!); + Router.getInstance().navigateToPreviousRoute(); const toFocus = this.shadowRoot!.querySelector('#privacyGuideLinkRow'); assert(toFocus); focusWithoutInk(toFocus);
diff --git a/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc b/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc index 7194878..4c6f321f 100644 --- a/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc +++ b/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc
@@ -252,9 +252,10 @@ base::RunLoop run_loop_; }; -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS) || \ + BUILDFLAG(IS_LINUX) // Disabled because it fails for mac specific context menu: -// TODO(crbug.com/1275253): Flakily crashes under Windows and Mac. +// TODO(crbug.com/1275253): Flakily crashes under Windows and Mac & Linux. // TODO(crbug.com/1276463): Flakily crashes under lacros. #define MAYBE_LinkGenerationTest DISABLED_LinkGenerationTest #else
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 5b6801d..b93b7391 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3139,6 +3139,7 @@ "//chromeos/ash/components/dbus/session_manager", "//chromeos/ash/components/dbus/spaced", "//chromeos/ash/components/dbus/system_clock", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/dbus/userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", @@ -3169,7 +3170,6 @@ "//chromeos/dbus/power", "//chromeos/dbus/tpm_manager", "//chromeos/dbus/tpm_manager:tpm_manager_proto", - "//chromeos/dbus/update_engine", "//chromeos/dbus/util", "//chromeos/login/login_state", "//chromeos/network",
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb index 4c44dffd..fc6df9c 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb
@@ -912,10 +912,10 @@ <translation id="6000203700195075278">Segui di nuovo</translation> <translation id="6002122790816966947">I tuoi dispositivi</translation> <translation id="6005538289190791541">Password consigliata</translation> -<translation id="6032091552407840792">Questa prova è attiva soltanto in <ph name="BEGIN_LINK" />alcune aree geografiche<ph name="END_LINK" />.</translation> +<translation id="6032091552407840792">Questa prova è attiva soltanto in <ph name="BEGIN_LINK" />alcune regioni<ph name="END_LINK" />.</translation> <translation id="6033245666633565791">Con <ph name="BEGIN_LINK" />Privacy Sandbox<ph name="END_LINK" />, Chrome sviluppa nuove tecnologie che ti tutelano dai meccanismi di tracciamento tra siti salvaguardando al contempo il Web aperto. -Le prove di Privacy Sandbox sono ancora in fase di sviluppo attivo e sono disponibili soltanto in alcune aree geografiche. Per il momento i siti possono provare Privacy Sandbox continuando a usare le attuali tecnologie web quali i cookie di terze parti.</translation> +Le prove di Privacy Sandbox sono ancora in fase di sviluppo attivo e sono disponibili soltanto in alcune regioni. Per il momento i siti possono provare Privacy Sandbox continuando a usare le attuali tecnologie web quali i cookie di terze parti.</translation> <translation id="6039379616847168523">Vai alla scheda successiva</translation> <translation id="6040143037577758943">Chiudi</translation> <translation id="604124094241169006">Automatico</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb index f02fcc6b..7033e0af6ef 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb
@@ -443,6 +443,7 @@ <translation id="3334729583274622784">ប្ដូរកន្ទុយឯកសារឬ?</translation> <translation id="3341262203274374114">មិនអាចឈប់តាមដានបានទេ។ មានអ្វីមួយខុសប្រក្រតី។</translation> <translation id="3359667936385849800">ប្រើក្រុមហ៊ុនផ្ដល់សេវាបច្ចុប្បន្នរបស់អ្នក</translation> +<translation id="3365271666488085187">Chrome អាចពិចារណាចំណាប់អារម្មណ៍នេះ</translation> <translation id="3367813778245106622">ចូលគណនីម្តងទៀតដើម្បីចាប់ផ្តើមសមកាលកម្ម</translation> <translation id="3373979091428520308">ដើម្បីចែករំលែកទំព័រនេះជាមួយឧបករណ៍ផ្សេង សូមបើកសមកាលកម្មនៅក្នុងការកំណត់ Chrome នៅលើឧបករណ៍ផ្សេងទៀត</translation> <translation id="3374023511497244703">ចំណាំ ប្រវត្តិ ពាក្យសម្ងាត់ និងទិន្នន័យ Chrome ផ្សេងទៀតរបស់អ្នកនឹងមិនធ្វើសមកាលកម្មទៅក្នុងគណនី Google របស់អ្នកទៀតទេ</translation> @@ -476,6 +477,7 @@ <translation id="3542235761944717775">ទំនេរ <ph name="KILOBYTES" /> KB</translation> <translation id="3549657413697417275">ស្វែងរកប្រវត្តិរបស់អ្នក</translation> <translation id="3557336313807607643">បញ្ចូលទៅក្នុងទំនាក់ទំនង</translation> +<translation id="3560491354538957576">គេហទំព័រអាចកំណត់ចំណាប់អារម្មណ៍</translation> <translation id="3563767357928833671">ខ្លឹមសារឃ្លីបបតត្រូវបានបង្ហាញ</translation> <translation id="3566923219790363270">Chrome កំពុងរៀបចំសម្រាប់ VR នៅឡើយ។ ចាប់ផ្តើម Chrome ឡើងវិញនៅពេលក្រោយ។</translation> <translation id="3568688522516854065">ដើម្បីទទួលបានផ្ទាំងរបស់អ្នកពីឧបករណ៍ផ្សេងទៀតរបស់អ្នក សូមចូលគណនី និងបើកសមកាលកម្ម</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb index 9bd9c6e..afe4f55 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb
@@ -443,6 +443,7 @@ <translation id="3334729583274622784">Fayl kengaytmasi oʻzgartirilsinmi?</translation> <translation id="3341262203274374114">Obuna bekor qilinmadi. Xatolik yuz berdi.</translation> <translation id="3359667936385849800">Joriy xizmat provayderingiz orqali</translation> +<translation id="3365271666488085187">Chrome bu qiziqishni taxmin qilishi mumkin</translation> <translation id="3367813778245106622">Yana sinxronlashni boshlash uchun hisobingizga kiring</translation> <translation id="3373979091428520308">Bu sahifani boshqa qurilmaga ulashish uchun oʻsha qurilmadagi Chrome sozlamalarida sinxronizatsiyani yoqing</translation> <translation id="3374023511497244703">Bukmarklar, tarix, parollar va boshqa Chrome maʼlumotlaringiz bilan Google hisobingiz sinxronizatsiyasi uziladi</translation> @@ -476,6 +477,7 @@ <translation id="3542235761944717775"><ph name="KILOBYTES" /> KB bo‘sh</translation> <translation id="3549657413697417275">Tarix ichidan qidirish</translation> <translation id="3557336313807607643">Kontaktlarga saqlash</translation> +<translation id="3560491354538957576">Sayt qiziqishlarni taxmin qilishi mumkin</translation> <translation id="3563767357928833671">Vaqtincha xotira kontenti chiqarildi</translation> <translation id="3566923219790363270">Chrome hali ham VR rejimga tayyorlanmoqda. Chromeni keyinroq qayta ishga tushirish.</translation> <translation id="3568688522516854065">Boshqa qurilmalaringizdagi brauzer sahifalarini ko‘rish uchun hisobingizga kiring va sinxronizatsiyani yoqing</translation>
diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc index 993235f..d458cb3 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
@@ -41,10 +41,10 @@ #include "chrome/browser/web_applications/web_app_id_constants.h" #include "chrome/common/chrome_constants.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/crx_file/id_util.h" #include "components/services/app_service/public/cpp/app_types.h" @@ -644,7 +644,7 @@ public: void SetUp() override { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -663,7 +663,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); } };
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc index e6051e6..2e17e6d5 100644 --- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -61,10 +61,10 @@ #include "chrome/browser/ui/views/select_file_dialog_extension.h" #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" #include "chrome/browser/ui/views/tabs/tab_scrubber_chromeos.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/components/quick_answers/public/cpp/controller/quick_answers_controller.h" #include "chromeos/components/quick_answers/quick_answers_client.h" -#include "chromeos/network/network_connect.h" #include "chromeos/services/bluetooth_config/fast_pair_delegate.h" #include "chromeos/services/bluetooth_config/in_process_instance.h" #include "components/crash/core/common/crash_key.h"
diff --git a/chrome/browser/ui/ash/clipboard_history_browsertest.cc b/chrome/browser/ui/ash/clipboard_history_browsertest.cc index 9e724afc..a9f44d1e 100644 --- a/chrome/browser/ui/ash/clipboard_history_browsertest.cc +++ b/chrome/browser/ui/ash/clipboard_history_browsertest.cc
@@ -1093,8 +1093,9 @@ // Verify that the clipboard data history is recorded as expected in the // Multiuser environment. +// TODO(http://crbug.com/1341601): Flakily crashes under ChromeOS IN_PROC_BROWSER_TEST_F(ClipboardHistoryMultiProfileBrowserTest, - VerifyClipboardHistoryAcrossMultiUser) { + DISABLED_VerifyClipboardHistoryAcrossMultiUser) { EXPECT_TRUE(GetClipboardItems().empty()); // Store text when the user1 is active.
diff --git a/chrome/browser/ui/ash/network/mobile_data_notifications.cc b/chrome/browser/ui/ash/network/mobile_data_notifications.cc index bf241346..2b42a88 100644 --- a/chrome/browser/ui/ash/network/mobile_data_notifications.cc +++ b/chrome/browser/ui/ash/network/mobile_data_notifications.cc
@@ -17,8 +17,8 @@ #include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_type_pattern.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ui/ash/network/mobile_data_notifications.h b/chrome/browser/ui/ash/network/mobile_data_notifications.h index 86bee78..f0551aa5 100644 --- a/chrome/browser/ui/ash/network/mobile_data_notifications.h +++ b/chrome/browser/ui/ash/network/mobile_data_notifications.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "base/timer/timer.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" #include "components/session_manager/core/session_manager_observer.h"
diff --git a/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc b/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc index 75e1c42..e665606 100644 --- a/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc +++ b/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc
@@ -18,10 +18,10 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_connect.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/pref_service.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.h b/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.h index a0435a92..d1429a0 100644 --- a/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.h +++ b/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.h
@@ -8,7 +8,7 @@ #include <memory> #include <string> -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" namespace ash { class SystemTrayClient;
diff --git a/chrome/browser/ui/ash/network/network_state_notifier.cc b/chrome/browser/ui/ash/network/network_state_notifier.cc index 4099d27..dd3e3c3a 100644 --- a/chrome/browser/ui/ash/network/network_state_notifier.cc +++ b/chrome/browser/ui/ash/network/network_state_notifier.cc
@@ -17,9 +17,9 @@ #include "chrome/browser/notifications/system_notification_helper.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/network/cellular_esim_profile_handler.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connect.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connect.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_name_util.h" #include "chromeos/network/network_state.h"
diff --git a/chrome/browser/ui/ash/network/network_state_notifier.h b/chrome/browser/ui/ash/network/network_state_notifier.h index 34ef79db3..a92e55b 100644 --- a/chrome/browser/ui/ash/network/network_state_notifier.h +++ b/chrome/browser/ui/ash/network/network_state_notifier.h
@@ -14,7 +14,7 @@ #include "base/scoped_observation.h" #include "base/time/time.h" #include "base/values.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc b/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc index 7a9c239b..975d881 100644 --- a/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc +++ b/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc
@@ -16,12 +16,12 @@ #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_browser_process.h" #include "chromeos/ash/components/network/cellular_metrics_logger.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_connect.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/testing_pref_service.h"
diff --git a/chrome/browser/ui/ash/network/tether_notification_presenter.cc b/chrome/browser/ui/ash/network/tether_notification_presenter.cc index 37dd4e20e..625f8b7 100644 --- a/chrome/browser/ui/ash/network/tether_notification_presenter.cc +++ b/chrome/browser/ui/ash/network/tether_notification_presenter.cc
@@ -22,7 +22,7 @@ #include "chrome/common/url_constants.h" #include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image.h"
diff --git a/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc b/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc index e33b3b34..726279a 100644 --- a/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc +++ b/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc
@@ -15,7 +15,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" namespace { const int kTestNetworkSignalStrength = 50;
diff --git a/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc b/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc index bad84465..329439f 100644 --- a/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc +++ b/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc
@@ -50,10 +50,10 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/chrome_ash_test_base.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include "chromeos/ash/components/dbus/cicerone/cicerone_client.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/exo/shell_surface_util.h" #include "components/prefs/pref_service.h" @@ -106,7 +106,7 @@ void SetUp() override { chromeos::DBusThreadManager::Initialize(); - chromeos::ChunneldClient::InitializeFake(); + ash::ChunneldClient::InitializeFake(); ash::CiceroneClient::InitializeFake(); ash::ConciergeClient::InitializeFake(); ash::SeneschalClient::InitializeFake(); @@ -212,7 +212,7 @@ ash::SeneschalClient::Shutdown(); ash::ConciergeClient::Shutdown(); ash::CiceroneClient::Shutdown(); - chromeos::ChunneldClient::Shutdown(); + ash::ChunneldClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); }
diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc index f4f0b05..6fae00f 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
@@ -1476,8 +1476,15 @@ popup->window()->GetBounds().width()); } +#if BUILDFLAG(IS_CHROMEOS_LACROS) +// TODO(crbug.com/1341599): Flakily crashes on Lacros. +#define MAYBE_FindMovesOnTabClose_Issue1343052 \ + DISABLED_FindMovesOnTabClose_Issue1343052 +#else +#define MAYBE_FindMovesOnTabClose_Issue1343052 FindMovesOnTabClose_Issue1343052 +#endif IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, - FindMovesOnTabClose_Issue1343052) { + MAYBE_FindMovesOnTabClose_Issue1343052) { EnsureFindBoxOpen(); content::RunAllPendingInMessageLoop(); // Needed on Linux.
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index cfb9a2f..de46593 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -6,6 +6,7 @@ #include "base/metrics/histogram_macros.h" #include "build/build_config.h" +#include "build/buildflag.h" #include "build/chromeos_buildflags.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/browser_process.h" @@ -39,6 +40,8 @@ #if BUILDFLAG(IS_WIN) #include "chrome/browser/taskbar/taskbar_decorator_win.h" +#include "ui/display/win/screen_win.h" +#include "ui/views/win/hwnd_util.h" #endif // static @@ -325,6 +328,25 @@ } #if BUILDFLAG(IS_WIN) +// Sending the WM_NCPOINTERDOWN, WM_NCPOINTERUPDATE, and WM_NCPOINTERUP to the +// default window proc does not bring up the system menu on long press, so we +// use the gesture recognizer to turn it into a LONG_TAP gesture and handle it +// here. See https://crbug.com/1327506 for more info. +void BrowserNonClientFrameView::OnGestureEvent(ui::GestureEvent* event) { + gfx::Point event_loc = event->location(); + // This opens the title bar system context menu on long press in the titlebar. + // NonClientHitTest returns HTCAPTION if `event_loc` is in the empty space on + // the titlebar. + if (event->type() == ui::ET_GESTURE_LONG_TAP && + NonClientHitTest(event_loc) == HTCAPTION) { + views::View::ConvertPointToScreen(this, &event_loc); + event_loc = display::win::ScreenWin::DIPToScreenPoint(event_loc); + views::ShowSystemMenuAtScreenPixelLocation(views::HWNDForView(this), + event_loc); + event->SetHandled(); + } +} + int BrowserNonClientFrameView::GetSystemMenuY() const { if (!browser_view()->GetTabStripVisible()) return GetTopInset(false); @@ -333,7 +355,7 @@ .bottom() - GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP); } -#endif +#endif // BUILDFLAG(IS_WIN) BEGIN_METADATA(BrowserNonClientFrameView, views::NonClientFrameView) END_METADATA
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h index 9e106494..d113479 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
@@ -180,10 +180,13 @@ } private: - // views::NonClientFrameView: #if BUILDFLAG(IS_WIN) + // ui::EventHandler: + void OnGestureEvent(ui::GestureEvent* event) override; + + // views::NonClientFrameView: int GetSystemMenuY() const override; -#endif +#endif // BUILDFLAG(IS_WIN) // The frame that hosts this view. const raw_ptr<BrowserFrame> frame_;
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index d4648e1..a628c17 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -2117,8 +2117,15 @@ EXPECT_FALSE(tab_strip->GetWidget()->HasCapture()); } +// TODO(crbug.com/1341444) Flaky on lacros. +#if BUILDFLAG(IS_CHROMEOS_LACROS) +#define MAYBE_TabDragContextOwnsDraggedTabs \ + DISABLED_TabDragContextOwnsDraggedTabs +#else +#define MAYBE_TabDragContextOwnsDraggedTabs TabDragContextOwnsDraggedTabs +#endif IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, - TabDragContextOwnsDraggedTabs) { + MAYBE_TabDragContextOwnsDraggedTabs) { AddTabsAndResetBrowser(browser(), 1); TabStrip* tab_strip = GetTabStripForBrowser(browser());
diff --git a/chrome/browser/ui/web_applications/web_app_browsertest.cc b/chrome/browser/ui/web_applications/web_app_browsertest.cc index c891c24..3e7a2824 100644 --- a/chrome/browser/ui/web_applications/web_app_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_browsertest.cc
@@ -333,69 +333,78 @@ EXPECT_EQ(provider->registrar().GetAppThemeColor(app_id), SK_ColorGREEN); } -// Enumeration of test modes for `BackgroundColorChangeWebAppBrowserTest`s. -enum class BackgroundColorChangeTestMode { - kSWA, - kNonSWA, -}; +// Also see BackgroundColorChangeSystemWebAppBrowserTest.BackgroundColorChange +// below. +IN_PROC_BROWSER_TEST_F(WebAppBrowserTest, BackgroundColorChange) { + const GURL app_url = GetSecureAppURL(); + auto web_app_info = std::make_unique<WebAppInstallInfo>(); + web_app_info->start_url = app_url; + web_app_info->scope = app_url.GetWithoutFilename(); + web_app_info->theme_color = SK_ColorWHITE; + web_app_info->dark_mode_theme_color = SK_ColorBLACK; + web_app_info->background_color = SK_ColorWHITE; + web_app_info->dark_mode_background_color = SK_ColorBLACK; -// Base class for `BackgroundColorChange` tests, parameterized by test mode and -// whether to prefer manifest background color. -class BackgroundColorChangeWebAppBrowserTest + const AppId app_id = InstallWebApp(std::move(web_app_info)); + + Browser* const app_browser = LaunchWebAppBrowser(app_id); + content::WebContents* const web_contents = + app_browser->tab_strip_model()->GetActiveWebContents(); + + // Wait for original background color to load. + { + content::BackgroundColorChangeWaiter waiter(web_contents); + waiter.Wait(); + EXPECT_EQ(app_browser->app_controller()->GetBackgroundColor().value(), + SK_ColorWHITE); + } + content::AwaitDocumentOnLoadCompleted(web_contents); + + // Changing background color should update the toolbar color. + { + content::BackgroundColorChangeWaiter waiter(web_contents); + EXPECT_TRUE(content::ExecuteScript( + web_contents, "document.body.style.backgroundColor = 'cyan';")); + waiter.Wait(); + EXPECT_EQ(app_browser->app_controller()->GetBackgroundColor().value(), + SK_ColorCYAN); + SkColor download_shelf_color; + app_browser->app_controller()->GetThemeSupplier()->GetColor( + ThemeProperties::COLOR_TOOLBAR, &download_shelf_color); + EXPECT_EQ(download_shelf_color, SK_ColorCYAN); + } +} + +// TODO(crbug.com/1321984): Make is Ash only using BUILDFLAG(IS_CHROMEOS_ASH). +class BackgroundColorChangeSystemWebAppBrowserTest : public WebAppBrowserTest, public testing::WithParamInterface< - std::tuple<BackgroundColorChangeTestMode, - /*prefer_manifest_background_color=*/bool>> { + /*prefer_manifest_background_color=*/bool> { public: - BackgroundColorChangeWebAppBrowserTest() { + BackgroundColorChangeSystemWebAppBrowserTest() { #if BUILDFLAG(IS_CHROMEOS_LACROS) web_app::EnableSystemWebAppsInLacrosForTesting(); #endif // BUILDFLAG(IS_CHROMEOS_LACROS) - switch (GetBackgroundColorChangeTestMode()) { - case BackgroundColorChangeTestMode::kSWA: - system_web_app_installation_ = - ash::TestSystemWebAppInstallation::SetUpAppWithColors( - /*theme_color=*/SK_ColorWHITE, - /*dark_mode_theme_color=*/SK_ColorBLACK, - /*background_color=*/SK_ColorWHITE, - /*dark_mode_background_color=*/SK_ColorBLACK); - static_cast<ash::UnittestingSystemAppDelegate*>( - system_web_app_installation_->GetDelegate()) - ->SetPreferManifestBackgroundColor(PreferManifestBackgroundColor()); - break; - case BackgroundColorChangeTestMode::kNonSWA: - break; - } - } - - // Returns test mode given test parameterization. - BackgroundColorChangeTestMode GetBackgroundColorChangeTestMode() const { - return std::get<0>(GetParam()); + system_web_app_installation_ = + ash::TestSystemWebAppInstallation::SetUpAppWithColors( + /*theme_color=*/SK_ColorWHITE, + /*dark_mode_theme_color=*/SK_ColorBLACK, + /*background_color=*/SK_ColorWHITE, + /*dark_mode_background_color=*/SK_ColorBLACK); + static_cast<ash::UnittestingSystemAppDelegate*>( + system_web_app_installation_->GetDelegate()) + ->SetPreferManifestBackgroundColor(PreferManifestBackgroundColor()); } // Returns whether the web app under test prefers manifest background colors // over web contents background colors. - bool PreferManifestBackgroundColor() const { return std::get<1>(GetParam()); } + bool PreferManifestBackgroundColor() const { return GetParam(); } // Installs the web app under test, blocking until installation is complete, // and returning the `AppId` for the installed web app. - AppId WaitForAppInstall() { - switch (GetBackgroundColorChangeTestMode()) { - case BackgroundColorChangeTestMode::kSWA: - system_web_app_installation_->WaitForAppInstall(); - return system_web_app_installation_->GetAppId(); - case BackgroundColorChangeTestMode::kNonSWA: { - const GURL app_url = GetSecureAppURL(); - auto web_app_info = std::make_unique<WebAppInstallInfo>(); - web_app_info->start_url = app_url; - web_app_info->scope = app_url.GetWithoutFilename(); - web_app_info->theme_color = SK_ColorWHITE; - web_app_info->dark_mode_theme_color = SK_ColorBLACK; - web_app_info->background_color = SK_ColorWHITE; - web_app_info->dark_mode_background_color = SK_ColorBLACK; - return InstallWebApp(std::move(web_app_info)); - } - } + AppId WaitForSwaInstall() { + system_web_app_installation_->WaitForAppInstall(); + return system_web_app_installation_->GetAppId(); } private: @@ -403,43 +412,19 @@ system_web_app_installation_; }; -INSTANTIATE_TEST_SUITE_P( - Mode, - BackgroundColorChangeWebAppBrowserTest, - testing::Combine(testing::Values(BackgroundColorChangeTestMode::kSWA, - BackgroundColorChangeTestMode::kNonSWA), - /*prefer_manifest_background_color=*/testing::Bool()), - [](const testing::TestParamInfo< - std::tuple<BackgroundColorChangeTestMode, - /*prefer_manifest_background_color=*/bool>>& info) { - BackgroundColorChangeTestMode test_mode = std::get<0>(info.param); - bool prefer_manifest_background_color = std::get<1>(info.param); +INSTANTIATE_TEST_SUITE_P(All, + BackgroundColorChangeSystemWebAppBrowserTest, + /*prefer_manifest_background_color=*/testing::Bool(), + [](const testing::TestParamInfo< + /*prefer_manifest_background_color=*/bool>& info) { + return info.param ? "PreferManifestBackgroundColor" + : "WebContentsBackgroundColor"; + }); - std::stringstream name; - switch (test_mode) { - case BackgroundColorChangeTestMode::kSWA: - name << "kSWA"; - break; - case BackgroundColorChangeTestMode::kNonSWA: - name << "kNonSWA"; - break; - } - - if (prefer_manifest_background_color) - name << "_PreferManifestBackgroundColor"; - - return name.str(); - }); - -IN_PROC_BROWSER_TEST_P(BackgroundColorChangeWebAppBrowserTest, +// Also see WebAppBrowserTest.BackgroundColorChange above. +IN_PROC_BROWSER_TEST_P(BackgroundColorChangeSystemWebAppBrowserTest, BackgroundColorChange) { - const bool is_non_swa = GetBackgroundColorChangeTestMode() == - BackgroundColorChangeTestMode::kNonSWA; - // Skip test parameterizations for non-system web apps that don't make sense. - if (is_non_swa && PreferManifestBackgroundColor()) - GTEST_SKIP(); - - const AppId app_id = WaitForAppInstall(); + const AppId app_id = WaitForSwaInstall(); Browser* const app_browser = LaunchWebAppBrowser(app_id); content::WebContents* const web_contents = app_browser->tab_strip_model()->GetActiveWebContents(); @@ -450,9 +435,8 @@ { content::BackgroundColorChangeWaiter waiter(web_contents); waiter.Wait(); - EXPECT_EQ( - app_browser->app_controller()->GetBackgroundColor().value(), - !is_non_swa && is_dark_mode_state ? SK_ColorBLACK : SK_ColorWHITE); + EXPECT_EQ(app_browser->app_controller()->GetBackgroundColor().value(), + is_dark_mode_state ? SK_ColorBLACK : SK_ColorWHITE); } content::AwaitDocumentOnLoadCompleted(web_contents);
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_captive_portal_dialog.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_captive_portal_dialog.cc index b0978c3..fef0228 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_captive_portal_dialog.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_captive_portal_dialog.cc
@@ -7,7 +7,7 @@ #include "ash/constants/ash_features.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "components/captive_portal/core/captive_portal_detector.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.cc index 2a5818e..01bba02 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.cc
@@ -30,7 +30,7 @@ #include "chrome/common/webui_url_constants.h" #include "chrome/grit/browser_resources.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/web_modal/web_contents_modal_dialog_manager.h"
diff --git a/chrome/browser/ui/webui/chromeos/network_ui.cc b/chrome/browser/ui/webui/chromeos/network_ui.cc index 3659bdca..3c02ef23 100644 --- a/chrome/browser/ui/webui/chromeos/network_ui.cc +++ b/chrome/browser/ui/webui/chromeos/network_ui.cc
@@ -38,8 +38,8 @@ #include "chromeos/ash/components/network/cellular_utils.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/ui/webui/help/version_updater.h b/chrome/browser/ui/webui/help/version_updater.h index 2c2450a..7eab1c2 100644 --- a/chrome/browser/ui/webui/help/version_updater.h +++ b/chrome/browser/ui/webui/help/version_updater.h
@@ -12,7 +12,7 @@ #include "build/chromeos_buildflags.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -53,7 +53,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) typedef base::OnceCallback<void(const std::string&)> ChannelCallback; using EolInfoCallback = - base::OnceCallback<void(chromeos::UpdateEngineClient::EolInfo eol_info)>; + base::OnceCallback<void(ash::UpdateEngineClient::EolInfo eol_info)>; using IsFeatureEnabledCallback = base::OnceCallback<void(absl::optional<bool>)>; #endif
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chrome/browser/ui/webui/help/version_updater_chromeos.cc index 65a0642..d62d6652 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
@@ -20,8 +20,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/help/help_utils_chromeos.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" @@ -34,9 +34,9 @@ namespace { +using ::ash::UpdateEngineClient; using ::chromeos::OwnerSettingsServiceAsh; using ::chromeos::OwnerSettingsServiceAshFactory; -using ::chromeos::UpdateEngineClient; // Network status in the context of device update. enum NetworkStatus { @@ -240,9 +240,8 @@ weak_ptr_factory_.GetWeakPtr(), std::move(cb))); } -void VersionUpdaterCros::OnGetEolInfo( - EolInfoCallback cb, - chromeos::UpdateEngineClient::EolInfo eol_info) { +void VersionUpdaterCros::OnGetEolInfo(EolInfoCallback cb, + UpdateEngineClient::EolInfo eol_info) { std::move(cb).Run(std::move(eol_info)); }
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.h b/chrome/browser/ui/webui/help/version_updater_chromeos.h index 8eaa940..5af757a 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.h +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.h
@@ -15,7 +15,7 @@ } class VersionUpdaterCros : public VersionUpdater, - public chromeos::UpdateEngineClient::Observer { + public ash::UpdateEngineClient::Observer { public: VersionUpdaterCros(const VersionUpdaterCros&) = delete; VersionUpdaterCros& operator=(const VersionUpdaterCros&) = delete; @@ -49,7 +49,7 @@ void UpdateStatusChanged(const update_engine::StatusResult& status) override; // Callback from UpdateEngineClient::RequestUpdateCheck(). - void OnUpdateCheck(chromeos::UpdateEngineClient::UpdateCheckResult result); + void OnUpdateCheck(ash::UpdateEngineClient::UpdateCheckResult result); // Callback from UpdateEngineClient::SetUpdateOverCellularOneTimePermission(). void OnSetUpdateOverCellularOneTimePermission(bool success); @@ -59,7 +59,7 @@ // Callback from UpdateEngineClient::GetEolInfo(). void OnGetEolInfo(EolInfoCallback cb, - chromeos::UpdateEngineClient::EolInfo eol_info); + ash::UpdateEngineClient::EolInfo eol_info); // Callback from UpdateEngineClient::IsFeatureEnabled(). void OnIsFeatureEnabled(IsFeatureEnabledCallback callback,
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc index 4b88a6e7..616ef54b 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
@@ -13,10 +13,10 @@ #include "base/test/mock_callback.h" #include "chrome/browser/ash/login/users/mock_user_manager.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -61,7 +61,8 @@ void SetUp() override { DBusThreadManager::Initialize(); - fake_update_engine_client_ = UpdateEngineClient::InitializeFakeForTest(); + fake_update_engine_client_ = + ash::UpdateEngineClient::InitializeFakeForTest(); EXPECT_CALL(*mock_user_manager_, IsCurrentUserOwner()) .WillRepeatedly(Return(false)); @@ -96,7 +97,7 @@ void TearDown() override { network_handler_test_helper_.reset(); version_updater_.reset(); - UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); DBusThreadManager::Shutdown(); } @@ -104,7 +105,7 @@ std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; std::unique_ptr<VersionUpdater> version_updater_; VersionUpdaterCros* version_updater_cros_ptr_; - FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. + ash::FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. MockUserManager* mock_user_manager_; // Not owned. user_manager::ScopedUserManager user_manager_enabler_;
diff --git a/chrome/browser/ui/webui/settings/about_handler.cc b/chrome/browser/ui/webui/settings/about_handler.cc index 1c09def..b2ee5511e 100644 --- a/chrome/browser/ui/webui/settings/about_handler.cc +++ b/chrome/browser/ui/webui/settings/about_handler.cc
@@ -66,8 +66,8 @@ #include "chrome/browser/ui/webui/help/help_utils_chromeos.h" #include "chrome/browser/ui/webui/help/version_updater_chromeos.h" #include "chrome/browser/ui/webui/webui_util.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/util/version_loader.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" @@ -653,7 +653,7 @@ void AboutHandler::OnGetEndOfLifeInfo( std::string callback_id, - chromeos::UpdateEngineClient::EolInfo eol_info) { + ash::UpdateEngineClient::EolInfo eol_info) { base::Value response(base::Value::Type::DICTIONARY); if (!eol_info.eol_date.is_null()) { bool has_eol_passed = eol_info.eol_date <= clock_->Now();
diff --git a/chrome/browser/ui/webui/settings/about_handler.h b/chrome/browser/ui/webui/settings/about_handler.h index 16e63ed..da737e2 100644 --- a/chrome/browser/ui/webui/settings/about_handler.h +++ b/chrome/browser/ui/webui/settings/about_handler.h
@@ -182,7 +182,7 @@ // Callbacks for version_updater_->GetEolInfo calls. void OnGetEndOfLifeInfo(std::string callback_id, - chromeos::UpdateEngineClient::EolInfo eol_info); + ash::UpdateEngineClient::EolInfo eol_info); // Get the managed auto update cros setting. void HandleIsManagedAutoUpdateEnabled(const base::Value::List& args);
diff --git a/chrome/browser/ui/webui/settings/about_handler_unittest.cc b/chrome/browser/ui/webui/settings/about_handler_unittest.cc index 45e6ac45..424db6a 100644 --- a/chrome/browser/ui/webui/settings/about_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/about_handler_unittest.cc
@@ -8,9 +8,9 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/test_web_ui.h" #include "testing/gtest/include/gtest/gtest.h" @@ -41,7 +41,8 @@ void SetUp() override { DBusThreadManager::Initialize(); - fake_update_engine_client_ = UpdateEngineClient::InitializeFakeForTest(); + fake_update_engine_client_ = + ash::UpdateEngineClient::InitializeFakeForTest(); ConciergeClient::InitializeFake(/*fake_cicerone_client=*/nullptr); handler_ = std::make_unique<TestAboutHandler>(&profile_); @@ -57,7 +58,7 @@ handler_.reset(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); ConciergeClient::Shutdown(); - UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); DBusThreadManager::Shutdown(); } @@ -102,7 +103,7 @@ TestingProfile profile_; content::TestWebUI web_ui_; std::unique_ptr<TestAboutHandler> handler_; - FakeUpdateEngineClient* fake_update_engine_client_; + ash::FakeUpdateEngineClient* fake_update_engine_client_; std::unique_ptr<base::SimpleTestClock> clock_; };
diff --git a/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc b/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc index 8138071..ae545ef 100644 --- a/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chrome/browser/upgrade_detector/installed_version_updater_chromeos.cc b/chrome/browser/upgrade_detector/installed_version_updater_chromeos.cc index 5571643..7a1adec 100644 --- a/chrome/browser/upgrade_detector/installed_version_updater_chromeos.cc +++ b/chrome/browser/upgrade_detector/installed_version_updater_chromeos.cc
@@ -8,7 +8,7 @@ #include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "chrome/browser/upgrade_detector/build_state.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" namespace { @@ -24,12 +24,12 @@ InstalledVersionUpdater::InstalledVersionUpdater(BuildState* build_state) : build_state_(build_state) { - chromeos::UpdateEngineClient::Get()->AddObserver(this); + ash::UpdateEngineClient::Get()->AddObserver(this); } InstalledVersionUpdater::~InstalledVersionUpdater() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - chromeos::UpdateEngineClient::Get()->RemoveObserver(this); + ash::UpdateEngineClient::Get()->RemoveObserver(this); } void InstalledVersionUpdater::UpdateStatusChanged(
diff --git a/chrome/browser/upgrade_detector/installed_version_updater_chromeos.h b/chrome/browser/upgrade_detector/installed_version_updater_chromeos.h index c23fd7a..5bfdd5a5 100644 --- a/chrome/browser/upgrade_detector/installed_version_updater_chromeos.h +++ b/chrome/browser/upgrade_detector/installed_version_updater_chromeos.h
@@ -9,20 +9,20 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" class BuildState; // Observes the system UpdateEngineClient for updates that require a device // restart. Update information is pushed to the given BuildState as it happens. -class InstalledVersionUpdater : public chromeos::UpdateEngineClient::Observer { +class InstalledVersionUpdater : public ash::UpdateEngineClient::Observer { public: explicit InstalledVersionUpdater(BuildState* build_state); InstalledVersionUpdater(const InstalledVersionUpdater&) = delete; InstalledVersionUpdater& operator=(const InstalledVersionUpdater&) = delete; ~InstalledVersionUpdater() override; - // chromeos::UpdateEngineClient::Observer: + // ash::UpdateEngineClient::Observer: void UpdateStatusChanged(const update_engine::StatusResult& status) override; private:
diff --git a/chrome/browser/upgrade_detector/installed_version_updater_chromeos_unittest.cc b/chrome/browser/upgrade_detector/installed_version_updater_chromeos_unittest.cc index 2e577815..c78532f 100644 --- a/chrome/browser/upgrade_detector/installed_version_updater_chromeos_unittest.cc +++ b/chrome/browser/upgrade_detector/installed_version_updater_chromeos_unittest.cc
@@ -10,10 +10,10 @@ #include "base/test/task_environment.h" #include "chrome/browser/upgrade_detector/build_state.h" #include "chrome/browser/upgrade_detector/mock_build_state_observer.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,7 +28,7 @@ InstalledVersionUpdaterTest() { chromeos::DBusThreadManager::Initialize(); fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); build_state_.AddObserver(&mock_observer_); } @@ -37,7 +37,7 @@ build_state_.RemoveObserver(&mock_observer_); // Be kind; rewind. - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); } @@ -50,7 +50,7 @@ BuildState build_state_; private: - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. + ash::FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. }; // Tests that an unrelated status change notification does not push data to the
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_chromeos.cc b/chrome/browser/upgrade_detector/upgrade_detector_chromeos.cc index c4571dd..e494d1dd 100644 --- a/chrome/browser/upgrade_detector/upgrade_detector_chromeos.cc +++ b/chrome/browser/upgrade_detector/upgrade_detector_chromeos.cc
@@ -20,16 +20,16 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/upgrade_detector/build_state.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/icu/source/i18n/unicode/timezone.h" -using chromeos::UpdateEngineClient; - namespace { +using ::ash::UpdateEngineClient; + // How long to wait (each cycle) before checking which severity level we should // be at. Once we reach the highest severity, the timer will stop. constexpr base::TimeDelta kNotifyCycleDelta = base::Minutes(20);
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_chromeos.h b/chrome/browser/upgrade_detector/upgrade_detector_chromeos.h index c083b5e3..cdbbd4c 100644 --- a/chrome/browser/upgrade_detector/upgrade_detector_chromeos.h +++ b/chrome/browser/upgrade_detector/upgrade_detector_chromeos.h
@@ -11,7 +11,7 @@ #include "chrome/browser/upgrade_detector/build_state_observer.h" #include "chrome/browser/upgrade_detector/installed_version_updater_chromeos.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" class PrefRegistrySimple; namespace base { @@ -21,7 +21,7 @@ class UpgradeDetectorChromeos : public UpgradeDetector, public BuildStateObserver, - public chromeos::UpdateEngineClient::Observer { + public ash::UpdateEngineClient::Observer { public: UpgradeDetectorChromeos(const UpgradeDetectorChromeos&) = delete; UpgradeDetectorChromeos& operator=(const UpgradeDetectorChromeos&) = delete; @@ -65,7 +65,7 @@ // UpgradeDetector: void OnMonitoredPrefsChanged() override; - // chromeos::UpdateEngineClient::Observer implementation. + // ash::UpdateEngineClient::Observer implementation. void UpdateStatusChanged(const update_engine::StatusResult& status) override; void OnUpdateOverCellularOneTimePermissionGranted() override;
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_chromeos_unittest.cc b/chrome/browser/upgrade_detector/upgrade_detector_chromeos_unittest.cc index 7ec1880..7fef34d8 100644 --- a/chrome/browser/upgrade_detector/upgrade_detector_chromeos_unittest.cc +++ b/chrome/browser/upgrade_detector/upgrade_detector_chromeos_unittest.cc
@@ -19,9 +19,9 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" #include "components/prefs/testing_pref_service.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -100,7 +100,7 @@ chromeos::DBusThreadManager::Initialize(); fake_update_engine_client_ = - chromeos::UpdateEngineClient::InitializeFakeForTest(); + ash::UpdateEngineClient::InitializeFakeForTest(); // Fast forward to set current time to local 2am . This is done to align the // relaunch deadline within the default relaunch window of 2am to 4am so @@ -122,7 +122,7 @@ } tzset(); - chromeos::UpdateEngineClient::Shutdown(); + ash::UpdateEngineClient::Shutdown(); chromeos::DBusThreadManager::Shutdown(); } @@ -208,7 +208,7 @@ std::unique_ptr<base::Environment> env_; absl::optional<std::string> original_tz_; - chromeos::FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. + ash::FakeUpdateEngineClient* fake_update_engine_client_; // Not owned. }; TEST_F(UpgradeDetectorChromeosTest, PolicyNotEnabled) {
diff --git a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs_browsertest.cc b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs_browsertest.cc index 657d1bce..c533b9c 100644 --- a/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs_browsertest.cc +++ b/chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs_browsertest.cc
@@ -103,8 +103,9 @@ EXPECT_EQ(absl::nullopt, preinstalled_prefs.LookUpAppIdByInstallUrl(url2)); } +// TODO(crbug.com/1341391): Flakily crashes on Mac, Windows, Chrome OS, Linux. IN_PROC_BROWSER_TEST_F(UserUninstalledPreinstalledWebAppPrefsBrowserTest, - PrefsPropagateProperlyOnDefaultUninstall) { + DISABLED_PrefsPropagateProperlyOnDefaultUninstall) { auto app_info1 = std::make_unique<WebAppInstallInfo>(); app_info1->start_url = GURL("https://example_url1.com/"); app_info1->title = u"Example App1";
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 437616b..2fb6dc81 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1656870358-f420b0848cbfe76959495f9cfaf588cfe179626c.profdata +chrome-linux-main-1656914368-5001a8b9b8044ee35db01ee492cabbd1f395b5b0.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 12a8008..3e87d7f 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1656870358-930e15f5c5c80025f6e29f2b3b51a83317c44f9e.profdata +chrome-mac-arm-main-1656914368-b3c0f85b2f944b6fe9ef2bd7ff7718f75238f9c9.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 3981d671e..72fa882 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1656870358-1d7fec7ba548023443997da4db9ed043cab88946.profdata +chrome-mac-main-1656914368-9e11ca866685478cd0552483fe965b102fa6ea9a.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index d811050..f0674d9 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1656870358-d9900044feaba18506b65e4bc4bead034a276254.profdata +chrome-win32-main-1656924679-1489720740e0ed53dceee8e75fd004fada5af955.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 455deef..da4b91a 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1656870358-e42489b188d5f34447123a95fbf1b534cbebb79c.profdata +chrome-win64-main-1656924679-f2572f186d1f9a201ba710fbe839c2e4b1145827.profdata
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index 390dca74..0960abc 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -863,7 +863,6 @@ skip.insert(APIPermissionID::kHid); skip.insert(APIPermissionID::kFileSystem); skip.insert(APIPermissionID::kFileSystemProvider); - skip.insert(APIPermissionID::kFileSystemRequestDownloads); skip.insert(APIPermissionID::kFileSystemRequestFileSystem); skip.insert(APIPermissionID::kFileSystemRetainEntries); skip.insert(APIPermissionID::kFileSystemWrite);
diff --git a/chrome/services/sharing/nearby/platform/DEPS b/chrome/services/sharing/nearby/platform/DEPS index f597e0b..9194d40e 100644 --- a/chrome/services/sharing/nearby/platform/DEPS +++ b/chrome/services/sharing/nearby/platform/DEPS
@@ -12,8 +12,8 @@ '+unicode/locid.h', '+chromeos/ash/components/network/proxy/ui_proxy_config_service.h', '+chromeos/ash/components/network/managed_network_configuration_handler.h', + '+chromeos/ash/components/network/network_configuration_handler.h', '+chromeos/login/login_state/login_state.h', - '+chromeos/network/network_configuration_handler.h', '+chromeos/network/network_profile_handler.h', '+components/onc/onc_constants.h', '+components/onc/onc_pref_names.h',
diff --git a/chrome/services/sharing/nearby/platform/wifi_lan_medium_unittest.cc b/chrome/services/sharing/nearby/platform/wifi_lan_medium_unittest.cc index b7a18814..434ff80 100644 --- a/chrome/services/sharing/nearby/platform/wifi_lan_medium_unittest.cc +++ b/chrome/services/sharing/nearby/platform/wifi_lan_medium_unittest.cc
@@ -16,9 +16,9 @@ #include "base/threading/thread_restrictions.h" #include "chrome/services/sharing/nearby/platform/wifi_lan_server_socket.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/services/network_config/in_process_instance.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index f5d96cf..fbfceb1 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -4125,6 +4125,7 @@ "//chromeos/ash/components/dbus/system_clock", "//chromeos/ash/components/dbus/system_proxy", "//chromeos/ash/components/dbus/system_proxy:system_proxy_proto", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/dbus/vm_plugin_dispatcher", "//chromeos/ash/components/network/portal_detector", @@ -4144,7 +4145,6 @@ "//chromeos/dbus/dlp", "//chromeos/dbus/image_burner", "//chromeos/dbus/power", - "//chromeos/dbus/update_engine", "//chromeos/login/login_state:test_support", "//chromeos/process_proxy", "//chromeos/services/assistant/public/proto", @@ -7267,6 +7267,8 @@ "//chromeos/ash/components/dbus/cicerone", "//chromeos/ash/components/dbus/concierge", "//chromeos/ash/components/dbus/seneschal", + "//chromeos/ash/components/dbus/update_engine", + "//chromeos/ash/components/dbus/update_engine:proto", "//chromeos/ash/services/assistant/public/cpp", "//chromeos/components/feature_usage:feature_usage", "//chromeos/components/onc", @@ -7285,8 +7287,6 @@ "//chromeos/dbus/power", "//chromeos/dbus/shill", "//chromeos/dbus/u2f", - "//chromeos/dbus/update_engine", - "//chromeos/dbus/update_engine:proto", "//chromeos/ime:gencode", "//chromeos/login/login_state:test_support", "//chromeos/services/assistant/public/shared",
diff --git a/chrome/test/data/extensions/api_test/file_system/get_volume_list/background.js b/chrome/test/data/extensions/api_test/file_system/get_volume_list/background.js index a02c0a0..fd7a5de 100644 --- a/chrome/test/data/extensions/api_test/file_system/get_volume_list/background.js +++ b/chrome/test/data/extensions/api_test/file_system/get_volume_list/background.js
@@ -12,21 +12,19 @@ // Whether Drive is available in the real kiosk session is tested // separately in: // chrome/browser/ash/login/app_mode/kiosk_browsertest.cc. - chrome.test.assertEq(6, volumeList.length); + chrome.test.assertEq(5, volumeList.length); chrome.test.assertTrue(/^downloads:.*/.test(volumeList[0].volumeId)); chrome.test.assertTrue(volumeList[0].writable); - chrome.test.assertEq('downloads:downloads', volumeList[1].volumeId); + chrome.test.assertEq('drive:drive-user', volumeList[1].volumeId); chrome.test.assertTrue(volumeList[1].writable); - chrome.test.assertEq('drive:drive-user', volumeList[2].volumeId); - chrome.test.assertTrue(volumeList[2].writable); chrome.test.assertEq( - 'system_internal:ShareCache', volumeList[3].volumeId); - chrome.test.assertFalse(volumeList[3].writable); + 'system_internal:ShareCache', volumeList[2].volumeId); + chrome.test.assertFalse(volumeList[2].writable); - chrome.test.assertEq('testing:read-only', volumeList[4].volumeId); - chrome.test.assertFalse(volumeList[4].writable); - chrome.test.assertEq('testing:writable', volumeList[5].volumeId); - chrome.test.assertTrue(volumeList[5].writable); + chrome.test.assertEq('testing:read-only', volumeList[3].volumeId); + chrome.test.assertFalse(volumeList[3].writable); + chrome.test.assertEq('testing:writable', volumeList[4].volumeId); + chrome.test.assertTrue(volumeList[4].writable); })); } ]);
diff --git a/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js b/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js index c4c3156..bf68199 100644 --- a/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js +++ b/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js
@@ -7,16 +7,16 @@ function onVolumeListChanged() { chrome.fileSystem.getVolumeList( chrome.test.callbackPass(function(volumeList) { - chrome.test.assertEq(6, volumeList.length); + chrome.test.assertEq(5, volumeList.length); // Confirm that adding a newly mounted volume emits an event, and // that the volume list is updated. chrome.fileSystem.onVolumeListChanged.addListener( chrome.test.callbackPass(function(event) { - chrome.test.assertEq(7, event.volumes.length); + chrome.test.assertEq(6, event.volumes.length); chrome.fileSystem.getVolumeList( chrome.test.callbackPass(function(volumeList) { - chrome.test.assertEq(7, volumeList.length); + chrome.test.assertEq(6, volumeList.length); })); })); }));
diff --git a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/background.js b/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/background.js deleted file mode 100644 index d2dd402..0000000 --- a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/background.js +++ /dev/null
@@ -1,7 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -chrome.app.runtime.onLaunched.addListener(function() { - chrome.app.window.create('test.html'); -});
diff --git a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/manifest.json b/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/manifest.json deleted file mode 100644 index 234fe55b..0000000 --- a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/manifest.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - // chrome-extension://pkplfbidichfdicaijlchgnapepdginl - "manifest_version": 2, - "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtDfX9dHNh948bt00YhZBm3P6E5QLaOt+v8kXVtibQfiPtOD2FTScB/f0wX/EQWVO7BkaSOsRkTPcPIgocyMPYr2FLgqGLFlYT9nQpKJZUFNF5oJ5rG6Nv7ppf4zEB3j6da1IBRTz2yOZ+6O1TMZxol/V62/QcqrJeggsHTEPGLdr9Ua4b1Ka0xKJnJngZljsbw93FI1o+P9dAh5BS6wTPiZI/vmJVjvMTkSTnaZ3n9Go2t7A0XLcSxLcVyuLAd2mAvSN0mIviOukdM66wr7llif71nKuUt+4qvlr/r9HfwzN6pA4jkwhtS1UD+3CmB+wsHwsnohNcuu4FIQ6rgq/7QIDAQAB", - "name": "chrome.fileSystem.requestFileSystem test for whitelisted extensions", - "version": "0.1", - "description": "Test for requesting Downloads via chrome.fileSystem.requestFileSystem by whitelisted extensions.", - "app": { - "background": { - "scripts": ["background.js"] - } - }, - "permissions": [ - { - "fileSystem": ["requestDownloads"] - } - ] -}
diff --git a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.html b/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.html deleted file mode 100644 index 8d7d1db..0000000 --- a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.html +++ /dev/null
@@ -1,3 +0,0 @@ -<html> -<script src="test.js"></script> -</html>
diff --git a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.js b/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.js deleted file mode 100644 index d58ea34..0000000 --- a/chrome/test/data/extensions/api_test/file_system/request_downloads_allowed_extension/test.js +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -chrome.test.runTests([ - function readOnlyVolume() { - chrome.fileSystem.requestFileSystem( - {volumeId: 'downloads:downloads'}, - chrome.test.callbackPass(function(fileSystem) { - chrome.test.assertTrue(!!fileSystem); - })); - } -]);
diff --git a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_extension_test.js b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_extension_test.js index 11fa1da..16778ce4 100644 --- a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_extension_test.js +++ b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_extension_test.js
@@ -35,6 +35,10 @@ document.body.innerHTML = ''; window.localStorage.clear(); + // Set default incognito state to False. + EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => + new Promise((resolve) => resolve({incognito: false})); + emojiPicker = /** @type {!EmojiPicker} */ (document.createElement('emoji-picker')); emojiPicker.emojiDataUrl = '/emoji_test_ordering'; @@ -185,8 +189,7 @@ 'clicking at recently used emoticon buttons should trigger emoticon ' + 'insertion.', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); const emoticonButton = findEmojiFirstButton(emoticonGroupSelector); emoticonButton.click(); @@ -212,9 +215,7 @@ 'recently used emoticon group should contain the correct emoticon ' + 'after it is clicked.', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); - + emojiPicker.updateIncognitoState(false); const emoticonButton = findEmojiFirstButton(emoticonGroupSelector); emoticonButton.click();
diff --git a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js index f2a42c0..2e9faf7 100644 --- a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js +++ b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js
@@ -29,6 +29,10 @@ document.body.innerHTML = ''; window.localStorage.clear(); + // Set default incognito state to False. + EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => + new Promise((resolve) => resolve({incognito: false})); + emojiPicker = /** @type {!EmojiPicker} */ (document.createElement('emoji-picker')); emojiPicker.emojiDataUrl = '/emoji_test_ordering'; @@ -57,7 +61,7 @@ test('first non-chevron, tab should be active by default', async () => { const button = findInEmojiPicker( - 'emoji-group-button[data-group="history"]', 'cr-icon-button'); + 'emoji-group-button[data-group="emoji-history"]', 'cr-icon-button'); assertFalse(isGroupButtonActive(button)); }); @@ -82,7 +86,7 @@ // the first non-history group (0) may not trigger a scroll, so scroll to // group (1). const firstButton = findInEmojiPicker( - 'emoji-group-button[data-group="history"]', 'cr-icon-button'); + 'emoji-group-button[data-group="emoji-history"]', 'cr-icon-button'); const thirdButton = findInEmojiPicker( 'emoji-group-button[data-group="1"]', 'cr-icon-button'); @@ -107,15 +111,14 @@ test('recently used should be hidden when empty', () => { const recentlyUsed = - findInEmojiPicker('[data-group=history] > emoji-group'); + findInEmojiPicker('[data-group="emoji-history"] > emoji-group'); assert(!recentlyUsed); }); test( 'recently used should be populated after emoji is clicked normally', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); // yield to allow emoji-group and emoji buttons to render. const emojiButton = await waitForCondition( () => findEmojiFirstButton( @@ -124,8 +127,8 @@ // wait until emoji exists in recently used section. const recentlyUsed = await waitForCondition( - () => findEmojiFirstButton( - '[data-group=history] > emoji-group')); + () => findEmojiFirstButton( + '[data-group="emoji-history"] > emoji-group')); // check text is correct. const recentText = recentlyUsed.innerText; @@ -135,10 +138,7 @@ test( 'clicking an emoji with no text field should copy it to the clipboard', async () => { - // Note: this whole test has no text field, so we should always copy to - // the clipboard. - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); // yield to allow emoji-group and emoji buttons to render. const emojiButton = await waitForCondition( () => findEmojiFirstButton( @@ -148,7 +148,7 @@ // wait until emoji exists in recently used section. const recentlyUsed = await waitForCondition( () => findEmojiFirstButton( - '[data-group=history] > emoji-group')); + '[data-group="emoji-history"] > emoji-group')); // check text is correct. await (waitForCondition(async () => { @@ -158,8 +158,7 @@ }); test('recently-used should have variants for variant emoji', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); // yield to allow emoji-group and emoji buttons to render. const emojiButton = (await waitForCondition( () => findInEmojiPicker( @@ -171,7 +170,7 @@ const recentlyUsed = (await waitForCondition( () => findEmojiFirstButton( - '[data-group=history] > emoji-group'))); + '[data-group="emoji-history"] > emoji-group'))); // check variants class is applied assertTrue(recentlyUsed.classList.contains('has-variants')); @@ -180,8 +179,7 @@ test( 'recently-used should have no variants for non-variant emoji', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); // yield to allow emoji-group and emoji buttons to render. const emojiButton = (await waitForCondition( () => findInEmojiPicker( @@ -193,7 +191,7 @@ const recentlyUsed = (await waitForCondition( () => findEmojiFirstButton( - '[data-group=history] > emoji-group'))); + '[data-group="emoji-history"] > emoji-group'))); // check variants class is not applied assertFalse(recentlyUsed.classList.contains('has-variants')); @@ -202,8 +200,7 @@ test( 'recently-used should be empty after emoji is clicked in incognito mode', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - new Promise((resolve) => resolve({incognito: true})); + emojiPicker.updateIncognitoState(true); // yield to allow emoji-group and emoji buttons to render. const emojiButton = await waitForCondition( () => findEmojiFirstButton('[data-group="0"] > emoji-group')); @@ -213,14 +210,12 @@ await timeout(1000); const recentlyUsed = - findInEmojiPicker('[data-group=history] > emoji-group'); + findInEmojiPicker('[data-group="emoji-history"] > emoji-group'); assert(!recentlyUsed); }); test('recently used should be empty after clearing', async () => { - EmojiPickerApiProxyImpl.getInstance().isIncognitoTextField = () => - // first - insert an emoji to populate recently used - new Promise((resolve) => resolve({incognito: false})); + emojiPicker.updateIncognitoState(false); // yield to allow emoji-group and emoji buttons to render. const emojiButton = (await waitForCondition( () => findInEmojiPicker( @@ -232,7 +227,7 @@ const recentlyUsed = (await waitForCondition( () => findEmojiFirstButton( - '[data-group=history] > emoji-group'))); + '[data-group="emoji-history"] > emoji-group'))); // click show clear button findInEmojiPicker('.group', '#show-clear').click(); @@ -243,7 +238,7 @@ // Expect no more history. await waitForCondition( - () => findInEmojiPicker('[data-group=history] > emoji-group') + () => findInEmojiPicker('[data-group="emoji-history"] > emoji-group') .style.display === 'none', 'history failed to disappear'); });
diff --git a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test_util.js b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test_util.js index cb6659d..af2e77e 100644 --- a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test_util.js +++ b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test_util.js
@@ -87,7 +87,8 @@ export function waitWithTimeout(promise, ms, message) { message = message || 'waiting for promise timed out after ' + ms + ' ms.'; return Promise.race( - [promise, timeout(ms).then((resolve, reject) => reject(message))]); + [promise, timeout(ms).then( + () => Promise.reject(new Error(message)))]); } /**
diff --git a/chrome/test/data/webui/settings/chromeos/crostini_page_test.js b/chrome/test/data/webui/settings/chromeos/crostini_page_test.js index 12d552ca..9d595da 100644 --- a/chrome/test/data/webui/settings/chromeos/crostini_page_test.js +++ b/chrome/test/data/webui/settings/chromeos/crostini_page_test.js
@@ -26,6 +26,36 @@ const MIC_ALLOWED_PATH = 'prefs.crostini.mic_allowed.value'; +const singleContainer = /** @type {!Array<!ContainerInfo>}*/ + ([ + { + id: { + vm_name: 'termina', + container_name: 'penguin', + }, + ipv4: '1.2.3.4', + }, + ]); + +const multipleContainers = /** @type {!Array<!ContainerInfo>}*/ + ([ + { + id: { + vm_name: 'termina', + container_name: 'penguin', + }, + ipv4: '1.2.3.4', + }, + { + id: { + vm_name: 'not-termina', + container_name: 'not-penguin', + + }, + ipv4: '1.2.3.5', + } + ]); + function setCrostiniPrefs(enabled, optional = {}) { const { sharedPaths = {}, @@ -308,126 +338,6 @@ 'requestCrostiniInstallerStatus') >= 1); }); - test('Export', async function() { - assertTrue( - !!subpage.shadowRoot.querySelector('#crostini-export-import')); - subpage.shadowRoot.querySelector('#crostini-export-import').click(); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertTrue(!!subpage.shadowRoot.querySelector('#export cr-button')); - subpage.shadowRoot.querySelector('#export cr-button').click(); - assertEquals( - 1, crostiniBrowserProxy.getCallCount('exportCrostiniContainer')); - }); - - test('Deep link to backup linux', async () => { - const params = new URLSearchParams(); - params.append('settingId', '802'); - Router.getInstance().navigateTo( - routes.CROSTINI_EXPORT_IMPORT, params); - - flush(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - - const deepLinkElement = - subpage.shadowRoot.querySelector('#export cr-button'); - await waitAfterNextRender(deepLinkElement); - assertEquals( - deepLinkElement, getDeepActiveElement(), - 'Export button should be focused for settingId=802.'); - }); - - test('Import', async function() { - assertTrue( - !!subpage.shadowRoot.querySelector('#crostini-export-import')); - subpage.shadowRoot.querySelector('#crostini-export-import').click(); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - subpage.shadowRoot.querySelector('#import cr-button').click(); - - await flushTasks(); - subpage = subpage.shadowRoot.querySelector( - 'settings-crostini-import-confirmation-dialog'); - subpage.shadowRoot.querySelector('cr-dialog cr-button[id="continue"]') - .click(); - assertEquals( - 1, crostiniBrowserProxy.getCallCount('importCrostiniContainer')); - }); - - test('ExportImportButtonsGetDisabledOnOperationStatus', async function() { - assertTrue( - !!subpage.shadowRoot.querySelector('#crostini-export-import')); - subpage.shadowRoot.querySelector('#crostini-export-import').click(); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertFalse( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertFalse( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - webUIListenerCallback( - 'crostini-export-import-operation-status-changed', true); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertTrue( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertTrue( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - webUIListenerCallback( - 'crostini-export-import-operation-status-changed', false); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertFalse( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertFalse( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - }); - - test( - 'ExportImportButtonsDisabledOnWhenInstallingCrostini', - async function() { - assertTrue( - !!subpage.shadowRoot.querySelector('#crostini-export-import')); - subpage.shadowRoot.querySelector('#crostini-export-import').click(); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertFalse( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertFalse( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - webUIListenerCallback('crostini-installer-status-changed', true); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertTrue( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertTrue( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - webUIListenerCallback( - 'crostini-installer-status-changed', false); - - await flushTasks(); - subpage = crostiniPage.shadowRoot.querySelector( - 'settings-crostini-export-import'); - assertFalse( - subpage.shadowRoot.querySelector('#export cr-button').disabled); - assertFalse( - subpage.shadowRoot.querySelector('#import cr-button').disabled); - }); - test('ToggleCrostiniMicPermissionCancel', async function() { // Crostini is assumed to be running when the page is loaded. assertTrue(!!subpage.shadowRoot.querySelector( @@ -580,6 +490,184 @@ }); }); + suite('subPageBackupRestore', function() { + /** @type {?SettingsCrostiniExportImportElement} */ + let subpage; + + setup(async function() { + const requestInstallerStatusCallCount = + crostiniBrowserProxy.getCallCount('requestCrostiniInstallerStatus'); + + loadTimeData.overrideValues({ + showCrostiniExportImport: true, + showCrostiniContainerUpgrade: true, + showCrostiniPortForwarding: true, + showCrostiniDiskResize: true, + arcAdbSideloadingSupported: true, + showCrostiniExtraContainers: true, + }); + crostiniBrowserProxy.containerInfo = singleContainer; + await flushTasks(); + + Router.getInstance().navigateTo(routes.CROSTINI_EXPORT_IMPORT); + + await flushTasks(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + + assertTrue(!!subpage); + assertEquals( + 1, + crostiniBrowserProxy.getCallCount( + 'requestCrostiniExportImportOperationStatus')); + assertEquals( + requestInstallerStatusCallCount + 1, + crostiniBrowserProxy.getCallCount( + 'requestCrostiniInstallerStatus')); + assertEquals( + 1, crostiniBrowserProxy.getCallCount('requestContainerInfo')); + }); + + test('Deep link to backup linux', async () => { + const params = new URLSearchParams(); + params.append('settingId', '802'); + Router.getInstance().navigateTo(routes.CROSTINI_EXPORT_IMPORT, params); + + flush(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + + const deepLinkElement = + subpage.shadowRoot.querySelector('#export cr-button'); + await waitAfterNextRender(deepLinkElement); + assertEquals( + deepLinkElement, getDeepActiveElement(), + 'Export button should be focused for settingId=802.'); + }); + + test('ExportSingleContainer', async function() { + assertFalse(!!subpage.shadowRoot.querySelector( + '#exportCrostiniLabel .secondary')); + assertTrue(!!subpage.shadowRoot.querySelector('#export cr-button')); + subpage.shadowRoot.querySelector('#export cr-button').click(); + assertEquals( + 1, crostiniBrowserProxy.getCallCount('exportCrostiniContainer')); + }); + + test('ExportMultiContainer', async function() { + crostiniBrowserProxy.containerInfo = multipleContainers; + webUIListenerCallback('crostini-container-info', multipleContainers); + await flushTasks(); + + assertTrue(!!subpage.shadowRoot.querySelector( + '#exportCrostiniLabel .secondary')); + const select = subpage.root.querySelector('#exportContainerSelect'); + selectContainerByIndex(select, 1); + + assertTrue(!!subpage.shadowRoot.querySelector('#export cr-button')); + subpage.shadowRoot.querySelector('#export cr-button').click(); + assertEquals( + 1, crostiniBrowserProxy.getCallCount('exportCrostiniContainer')); + const args = crostiniBrowserProxy.getArgs('exportCrostiniContainer'); + assertEquals(1, args.length); + assertEquals(args[0].vm_name, 'not-termina'); + assertEquals(args[0].container_name, 'not-penguin'); + }); + + test('ImportSingleContainer', async function() { + assertFalse(!!subpage.shadowRoot.querySelector( + '#importCrostiniLabel .secondary')); + subpage.shadowRoot.querySelector('#import cr-button').click(); + + await flushTasks(); + subpage = subpage.shadowRoot.querySelector( + 'settings-crostini-import-confirmation-dialog'); + subpage.shadowRoot.querySelector('cr-dialog cr-button[id="continue"]') + .click(); + assertEquals( + 1, crostiniBrowserProxy.getCallCount('importCrostiniContainer')); + }); + + test('ImportMultiContainer', async function() { + crostiniBrowserProxy.containerInfo = multipleContainers; + webUIListenerCallback('crostini-container-info', multipleContainers); + await flushTasks(); + + assertTrue(!!subpage.shadowRoot.querySelector( + '#importCrostiniLabel .secondary')); + const select = subpage.root.querySelector('#importContainerSelect'); + selectContainerByIndex(select, 1); + + assertTrue(!!subpage.shadowRoot.querySelector('#import cr-button')); + subpage.shadowRoot.querySelector('#import cr-button').click(); + await flushTasks(); + subpage = subpage.shadowRoot.querySelector( + 'settings-crostini-import-confirmation-dialog'); + subpage.shadowRoot.querySelector('cr-dialog cr-button[id="continue"]') + .click(); + assertEquals( + 1, crostiniBrowserProxy.getCallCount('importCrostiniContainer')); + const args = crostiniBrowserProxy.getArgs('importCrostiniContainer'); + assertEquals(1, args.length); + assertEquals(args[0].vm_name, 'not-termina'); + assertEquals(args[0].container_name, 'not-penguin'); + }); + + test('ExportImportButtonsGetDisabledOnOperationStatus', async function() { + assertFalse( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertFalse( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + webUIListenerCallback( + 'crostini-export-import-operation-status-changed', true); + + await flushTasks(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + assertTrue( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertTrue( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + webUIListenerCallback( + 'crostini-export-import-operation-status-changed', false); + + await flushTasks(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + assertFalse( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertFalse( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + }); + + test( + 'ExportImportButtonsDisabledOnWhenInstallingCrostini', + async function() { + assertFalse( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertFalse( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + webUIListenerCallback('crostini-installer-status-changed', true); + + await flushTasks(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + assertTrue( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertTrue( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + webUIListenerCallback('crostini-installer-status-changed', false); + + await flushTasks(); + subpage = crostiniPage.shadowRoot.querySelector( + 'settings-crostini-export-import'); + assertFalse( + subpage.shadowRoot.querySelector('#export cr-button').disabled); + assertFalse( + subpage.shadowRoot.querySelector('#import cr-button').disabled); + }); + }); + suite('SubPagePortForwarding', function() { /** @type {?SettingsCrostiniPortForwarding} */ let subpage;
diff --git a/chrome/test/data/webui/settings/chromeos/test_crostini_browser_proxy.js b/chrome/test/data/webui/settings/chromeos/test_crostini_browser_proxy.js index e244f75..c0d7410 100644 --- a/chrome/test/data/webui/settings/chromeos/test_crostini_browser_proxy.js +++ b/chrome/test/data/webui/settings/chromeos/test_crostini_browser_proxy.js
@@ -38,6 +38,7 @@ 'requestContainerInfo', 'setContainerBadgeColor', 'stopContainer', + 'requestCrostiniExportImportOperationStatus', ]); this.crostiniMicSharingEnabled = false; this.crostiniIsRunning = true; @@ -100,6 +101,7 @@ /** @override */ requestCrostiniExportImportOperationStatus() { + this.methodCalled('requestCrostiniExportImportOperationStatus'); webUIListenerCallback( 'crostini-export-import-operation-status-changed', false); }
diff --git a/chromeos/ash/components/dbus/BUILD.gn b/chromeos/ash/components/dbus/BUILD.gn index 014b6cce..36670ef 100644 --- a/chromeos/ash/components/dbus/BUILD.gn +++ b/chromeos/ash/components/dbus/BUILD.gn
@@ -26,6 +26,7 @@ "//chromeos/ash/components/dbus/services:unit_tests", "//chromeos/ash/components/dbus/session_manager", "//chromeos/ash/components/dbus/system_clock:unit_tests", + "//chromeos/ash/components/dbus/update_engine:unit_tests", "//chromeos/ash/components/dbus/userdataauth", "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/dbus:test_support",
diff --git a/chromeos/dbus/chunneld/BUILD.gn b/chromeos/ash/components/dbus/chunneld/BUILD.gn similarity index 73% rename from chromeos/dbus/chunneld/BUILD.gn rename to chromeos/ash/components/dbus/chunneld/BUILD.gn index 74d4328..7854b510 100644 --- a/chromeos/dbus/chunneld/BUILD.gn +++ b/chromeos/ash/components/dbus/chunneld/BUILD.gn
@@ -5,11 +5,12 @@ import("//build/config/chromeos/ui_mode.gni") import("//third_party/protobuf/proto_library.gni") -assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //chromeos") +assert(is_chromeos_ash, + "Non-Chrome-OS builds must not depend on //chromeos/ash") component("chunneld") { - output_name = "chromeos_chunneld" - defines = [ "IS_CHROMEOS_DBUS_CHUNNELD_IMPL" ] + output_name = "ash_chunneld" + defines = [ "IS_ASH_DBUS_CHUNNELD_IMPL" ] deps = [ ":proto", "//base", @@ -28,5 +29,5 @@ sources = [ "//third_party/cros_system_api/dbus/chunneld/chunneld_service.proto" ] - proto_out_dir = "chromeos/dbus/chunneld" + proto_out_dir = "chromeos/ash/components/dbus/chunneld" }
diff --git a/chromeos/dbus/chunneld/chunneld_client.cc b/chromeos/ash/components/dbus/chunneld/chunneld_client.cc similarity index 94% rename from chromeos/dbus/chunneld/chunneld_client.cc rename to chromeos/ash/components/dbus/chunneld/chunneld_client.cc index ed4050ba..14f0b95 100644 --- a/chromeos/dbus/chunneld/chunneld_client.cc +++ b/chromeos/ash/components/dbus/chunneld/chunneld_client.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/dbus/chunneld/chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" #include <memory> @@ -12,12 +12,12 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_task_runner_handle.h" -#include "chromeos/dbus/chunneld/fake_chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h" #include "dbus/bus.h" #include "dbus/message.h" #include "third_party/cros_system_api/dbus/chunneld/dbus-constants.h" -namespace chromeos { +namespace ash { namespace { ChunneldClient* g_instance = nullptr; @@ -129,4 +129,4 @@ g_instance = nullptr; } -} // namespace chromeos +} // namespace ash
diff --git a/chromeos/dbus/chunneld/chunneld_client.h b/chromeos/ash/components/dbus/chunneld/chunneld_client.h similarity index 83% rename from chromeos/dbus/chunneld/chunneld_client.h rename to chromeos/ash/components/dbus/chunneld/chunneld_client.h index e6f7af8c..9beaf751 100644 --- a/chromeos/dbus/chunneld/chunneld_client.h +++ b/chromeos/ash/components/dbus/chunneld/chunneld_client.h
@@ -2,21 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_ -#define CHROMEOS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_ +#define CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_ #include "base/component_export.h" #include "base/observer_list_types.h" -#include "chromeos/dbus/chunneld/chunneld_service.pb.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_service.pb.h" #include "chromeos/dbus/common/dbus_client.h" #include "chromeos/dbus/common/dbus_method_call_status.h" #include "dbus/object_proxy.h" -namespace chromeos { +namespace ash { // ChunneldClient is used to communicate with chunneld and monitor chunneld. -class COMPONENT_EXPORT(CHROMEOS_DBUS_CHUNNELD) ChunneldClient - : public DBusClient { +class COMPONENT_EXPORT(ASH_DBUS_CHUNNELD) ChunneldClient : public DBusClient { public: class Observer : public base::CheckedObserver { public: @@ -62,6 +61,6 @@ ~ChunneldClient() override; }; -} // namespace chromeos +} // namespace ash -#endif // CHROMEOS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_ +#endif // CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_CHUNNELD_CLIENT_H_
diff --git a/chromeos/dbus/chunneld/fake_chunneld_client.cc b/chromeos/ash/components/dbus/chunneld/fake_chunneld_client.cc similarity index 90% rename from chromeos/dbus/chunneld/fake_chunneld_client.cc rename to chromeos/ash/components/dbus/chunneld/fake_chunneld_client.cc index e44b71f..0fc6def 100644 --- a/chromeos/dbus/chunneld/fake_chunneld_client.cc +++ b/chromeos/ash/components/dbus/chunneld/fake_chunneld_client.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/dbus/chunneld/fake_chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h" #include <utility> #include "base/bind.h" #include "base/threading/thread_task_runner_handle.h" -namespace chromeos { +namespace ash { FakeChunneldClient::FakeChunneldClient() {} @@ -40,4 +40,4 @@ FROM_HERE, base::BindOnce(std::move(callback), true)); } -} // namespace chromeos +} // namespace ash
diff --git a/chromeos/dbus/chunneld/fake_chunneld_client.h b/chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h similarity index 72% rename from chromeos/dbus/chunneld/fake_chunneld_client.h rename to chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h index ea4e20d..63dfd79 100644 --- a/chromeos/dbus/chunneld/fake_chunneld_client.h +++ b/chromeos/ash/components/dbus/chunneld/fake_chunneld_client.h
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_ -#define CHROMEOS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_ +#define CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_ #include "base/component_export.h" #include "base/observer_list.h" -#include "chromeos/dbus/chunneld/chunneld_client.h" +#include "chromeos/ash/components/dbus/chunneld/chunneld_client.h" -namespace chromeos { +namespace ash { // FakeChunneldClient is a stub implementation of ChunneldClient used for // testing. -class COMPONENT_EXPORT(CHROMEOS_DBUS_CHUNNELD) FakeChunneldClient +class COMPONENT_EXPORT(ASH_DBUS_CHUNNELD) FakeChunneldClient : public ChunneldClient { public: FakeChunneldClient(); @@ -37,6 +37,6 @@ base::ObserverList<Observer> observer_list_; }; -} // namespace chromeos +} // namespace ash -#endif // CHROMEOS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_ +#endif // CHROMEOS_ASH_COMPONENTS_DBUS_CHUNNELD_FAKE_CHUNNELD_CLIENT_H_
diff --git a/chromeos/dbus/update_engine/BUILD.gn b/chromeos/ash/components/dbus/update_engine/BUILD.gn similarity index 84% rename from chromeos/dbus/update_engine/BUILD.gn rename to chromeos/ash/components/dbus/update_engine/BUILD.gn index 94032d4..08cfea3 100644 --- a/chromeos/dbus/update_engine/BUILD.gn +++ b/chromeos/ash/components/dbus/update_engine/BUILD.gn
@@ -8,14 +8,13 @@ assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //chromeos") component("update_engine") { - output_name = "chromeos_update_engine" - defines = [ "IS_CHROMEOS_DBUS_UPDATE_ENGINE_IMPL" ] + output_name = "ash_update_engine" + defines = [ "IS_ASH_DBUS_UPDATE_ENGINE_IMPL" ] deps = [ ":proto", "//base", "//chromeos/dbus/common", "//chromeos/dbus/constants", - "//chromeos/dbus/util", "//dbus", ] sources = [ @@ -40,5 +39,5 @@ sources = [ "//third_party/cros_system_api/dbus/update_engine/update_engine.proto" ] - proto_out_dir = "chromeos/dbus/update_engine" + proto_out_dir = "chromeos/ash/components/dbus/update_engine" }
diff --git a/chromeos/dbus/update_engine/fake_update_engine_client.cc b/chromeos/ash/components/dbus/update_engine/fake_update_engine_client.cc similarity index 97% rename from chromeos/dbus/update_engine/fake_update_engine_client.cc rename to chromeos/ash/components/dbus/update_engine/fake_update_engine_client.cc index c2d6b2c6..7391a89 100644 --- a/chromeos/dbus/update_engine/fake_update_engine_client.cc +++ b/chromeos/ash/components/dbus/update_engine/fake_update_engine_client.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "base/bind.h" #include "base/callback.h" #include "base/threading/thread_task_runner_handle.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { FakeUpdateEngineClient::FakeUpdateEngineClient() {} @@ -137,4 +137,4 @@ features_[feature] = opt_enabled; } -} // namespace chromeos +} // namespace ash
diff --git a/chromeos/dbus/update_engine/fake_update_engine_client.h b/chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h similarity index 91% rename from chromeos/dbus/update_engine/fake_update_engine_client.h rename to chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h index d2289fb..e6c7832 100644 --- a/chromeos/dbus/update_engine/fake_update_engine_client.h +++ b/chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_ -#define CHROMEOS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_ +#define CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_ #include <map> #include <string> @@ -13,16 +13,16 @@ #include "base/containers/queue.h" #include "base/observer_list.h" #include "base/time/time.h" -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { // A fake implementation of UpdateEngineClient. The user of this class can // use set_update_engine_client_status() to set a fake last Status and // GetLastStatus() returns the fake with no modification. Other methods do // nothing. -class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) FakeUpdateEngineClient +class COMPONENT_EXPORT(ASH_DBUS_UPDATE_ENGINE) FakeUpdateEngineClient : public UpdateEngineClient { public: FakeUpdateEngineClient(); @@ -150,12 +150,6 @@ base::Time eol_date_; }; -} // namespace chromeos +} // namespace ash -// TODO(https://crbug.com/1164001): remove when Chrome OS code migration is -// done. -namespace ash { -using ::chromeos::FakeUpdateEngineClient; -} - -#endif // CHROMEOS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_ +#endif // CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_FAKE_UPDATE_ENGINE_CLIENT_H_
diff --git a/chromeos/dbus/update_engine/update_engine_client.cc b/chromeos/ash/components/dbus/update_engine/update_engine_client.cc similarity index 98% rename from chromeos/dbus/update_engine/update_engine_client.cc rename to chromeos/ash/components/dbus/update_engine/update_engine_client.cc index 1e637209..898526b 100644 --- a/chromeos/dbus/update_engine/update_engine_client.cc +++ b/chromeos/ash/components/dbus/update_engine/update_engine_client.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include <stdint.h> @@ -19,16 +19,15 @@ #include "base/strings/string_util.h" #include "base/task/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" +#include "chromeos/ash/components/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/dbus/constants/dbus_switches.h" -#include "chromeos/dbus/update_engine/fake_update_engine_client.h" -#include "chromeos/dbus/util/version_loader.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" #include "dbus/object_proxy.h" #include "third_party/cros_system_api/dbus/service_constants.h" -namespace chromeos { +namespace ash { namespace { @@ -801,4 +800,4 @@ g_instance = nullptr; } -} // namespace chromeos +} // namespace ash
diff --git a/chromeos/dbus/update_engine/update_engine_client.h b/chromeos/ash/components/dbus/update_engine/update_engine_client.h similarity index 94% rename from chromeos/dbus/update_engine/update_engine_client.h rename to chromeos/ash/components/dbus/update_engine/update_engine_client.h index c168d60..9516a62 100644 --- a/chromeos/dbus/update_engine/update_engine_client.h +++ b/chromeos/ash/components/dbus/update_engine/update_engine_client.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_ -#define CHROMEOS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_ +#define CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_ #include <stdint.h> @@ -12,18 +12,18 @@ #include "base/callback.h" #include "base/component_export.h" #include "base/time/time.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine.pb.h" #include "chromeos/dbus/common/dbus_client.h" -#include "chromeos/dbus/update_engine/update_engine.pb.h" #include "dbus/message.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" -namespace chromeos { +namespace ash { class FakeUpdateEngineClient; // UpdateEngineClient is used to communicate with the update engine. -class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) UpdateEngineClient +class COMPONENT_EXPORT(ASH_DBUS_UPDATE_ENGINE) UpdateEngineClient : public DBusClient { public: // The result code used for RequestUpdateCheck(). @@ -195,12 +195,6 @@ ~UpdateEngineClient() override; }; -} // namespace chromeos +} // namespace ash -// TODO(https://crbug.com/1164001): remove when Chrome OS code migration is -// done. -namespace ash { -using ::chromeos::UpdateEngineClient; -} - -#endif // CHROMEOS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_ +#endif // CHROMEOS_ASH_COMPONENTS_DBUS_UPDATE_ENGINE_UPDATE_ENGINE_CLIENT_H_
diff --git a/chromeos/dbus/update_engine/update_engine_client_unittest.cc b/chromeos/ash/components/dbus/update_engine/update_engine_client_unittest.cc similarity index 96% rename from chromeos/dbus/update_engine/update_engine_client_unittest.cc rename to chromeos/ash/components/dbus/update_engine/update_engine_client_unittest.cc index f5d23a09..4f92137 100644 --- a/chromeos/dbus/update_engine/update_engine_client_unittest.cc +++ b/chromeos/ash/components/dbus/update_engine/update_engine_client_unittest.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/dbus/update_engine/update_engine_client.h" +#include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { TEST(UpdateEngineClientTest, IsTargetChannelMoreStable) { EXPECT_FALSE(UpdateEngineClient::IsTargetChannelMoreStable("stable-channel", @@ -53,4 +53,4 @@ "other-invalid-channel", "invalid-channel")); } -} // namespace chromeos +} // namespace ash
diff --git a/chromeos/ash/components/network/BUILD.gn b/chromeos/ash/components/network/BUILD.gn index 1474db5..9bc81c5 100644 --- a/chromeos/ash/components/network/BUILD.gn +++ b/chromeos/ash/components/network/BUILD.gn
@@ -20,6 +20,7 @@ "//chromeos/ash/components/network/proxy", "//chromeos/components/feature_usage", "//chromeos/components/onc", + "//chromeos/dbus/common", "//chromeos/dbus/hermes", "//chromeos/dbus/permission_broker", "//chromeos/dbus/shill", @@ -88,6 +89,27 @@ "managed_network_configuration_handler_impl.h", "managed_state.cc", "managed_state.h", + "network_activation_handler.h", + "network_activation_handler_impl.cc", + "network_activation_handler_impl.h", + "network_cert_loader.cc", + "network_cert_loader.h", + "network_cert_migrator.cc", + "network_cert_migrator.h", + "network_certificate_handler.cc", + "network_certificate_handler.h", + "network_configuration_handler.cc", + "network_configuration_handler.h", + "network_configuration_observer.cc", + "network_configuration_observer.h", + "network_connect.cc", + "network_connect.h", + "network_connection_handler.cc", + "network_connection_handler.h", + "network_connection_handler_impl.cc", + "network_connection_handler_impl.h", + "network_connection_observer.cc", + "network_connection_observer.h", ] } @@ -187,5 +209,10 @@ "geolocation_handler_unittest.cc", "managed_cellular_pref_handler_unittest.cc", "managed_network_configuration_handler_unittest.cc", + "network_cert_loader_unittest.cc", + "network_cert_migrator_unittest.cc", + "network_configuration_handler_unittest.cc", + "network_connect_unittest.cc", + "network_connection_handler_impl_unittest.cc", ] }
diff --git a/chromeos/ash/components/network/auto_connect_handler.cc b/chromeos/ash/components/network/auto_connect_handler.cc index e39ad67b..55a708a0 100644 --- a/chromeos/ash/components/network/auto_connect_handler.cc +++ b/chromeos/ash/components/network/auto_connect_handler.cc
@@ -15,9 +15,9 @@ #include "base/values.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_type_pattern.h"
diff --git a/chromeos/ash/components/network/auto_connect_handler.h b/chromeos/ash/components/network/auto_connect_handler.h index 13d48181..51a9d93a 100644 --- a/chromeos/ash/components/network/auto_connect_handler.h +++ b/chromeos/ash/components/network/auto_connect_handler.h
@@ -12,8 +12,8 @@ #include "base/observer_list.h" #include "base/scoped_observation.h" #include "chromeos/ash/components/network/client_cert_resolver.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_observer.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_policy_observer.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/ash/components/network/auto_connect_handler_unittest.cc b/chromeos/ash/components/network/auto_connect_handler_unittest.cc index 502794a..6dcc32b 100644 --- a/chromeos/ash/components/network/auto_connect_handler_unittest.cc +++ b/chromeos/ash/components/network/auto_connect_handler_unittest.cc
@@ -18,10 +18,10 @@ #include "base/test/task_environment.h" #include "chromeos/ash/components/network/client_cert_resolver.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/system_token_cert_db_storage.h"
diff --git a/chromeos/ash/components/network/cellular_connection_handler.cc b/chromeos/ash/components/network/cellular_connection_handler.cc index 225a9d8..03dc8436 100644 --- a/chromeos/ash/components/network/cellular_connection_handler.cc +++ b/chromeos/ash/components/network/cellular_connection_handler.cc
@@ -11,10 +11,10 @@ #include "chromeos/ash/components/network/cellular_esim_profile_handler.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/hermes_metrics_util.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" #include "chromeos/dbus/hermes/hermes_manager_client.h" #include "chromeos/dbus/hermes/hermes_profile_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_type_pattern.h"
diff --git a/chromeos/ash/components/network/cellular_connection_handler_unittest.cc b/chromeos/ash/components/network/cellular_connection_handler_unittest.cc index d9bab65..280a70bf 100644 --- a/chromeos/ash/components/network/cellular_connection_handler_unittest.cc +++ b/chromeos/ash/components/network/cellular_connection_handler_unittest.cc
@@ -16,9 +16,9 @@ #include "base/time/time.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/fake_stub_cellular_networks_provider.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/components/network/cellular_esim_installer.cc b/chromeos/ash/components/network/cellular_esim_installer.cc index 157c45aa..db50ac0 100644 --- a/chromeos/ash/components/network/cellular_esim_installer.cc +++ b/chromeos/ash/components/network/cellular_esim_installer.cc
@@ -10,10 +10,10 @@ #include "chromeos/ash/components/network/cellular_connection_handler.h" #include "chromeos/ash/components/network/cellular_utils.h" #include "chromeos/ash/components/network/hermes_metrics_util.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" #include "chromeos/dbus/hermes/hermes_profile_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/ash/components/network/cellular_esim_installer_unittest.cc b/chromeos/ash/components/network/cellular_esim_installer_unittest.cc index 9111923..4e1636f 100644 --- a/chromeos/ash/components/network/cellular_esim_installer_unittest.cc +++ b/chromeos/ash/components/network/cellular_esim_installer_unittest.cc
@@ -14,6 +14,7 @@ #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/fake_network_connection_handler.h" #include "chromeos/ash/components/network/fake_stub_cellular_networks_provider.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" @@ -24,7 +25,6 @@ #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/ash/components/network/cellular_esim_uninstall_handler.cc b/chromeos/ash/components/network/cellular_esim_uninstall_handler.cc index 9004c9c..7afd1f43 100644 --- a/chromeos/ash/components/network/cellular_esim_uninstall_handler.cc +++ b/chromeos/ash/components/network/cellular_esim_uninstall_handler.cc
@@ -12,10 +12,10 @@ #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/hermes_metrics_util.h" #include "chromeos/ash/components/network/managed_cellular_pref_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" #include "chromeos/dbus/hermes/hermes_profile_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "components/device_event_log/device_event_log.h"
diff --git a/chromeos/ash/components/network/cellular_esim_uninstall_handler_unittest.cc b/chromeos/ash/components/network/cellular_esim_uninstall_handler_unittest.cc index 8e7deb28..7d1c91d 100644 --- a/chromeos/ash/components/network/cellular_esim_uninstall_handler_unittest.cc +++ b/chromeos/ash/components/network/cellular_esim_uninstall_handler_unittest.cc
@@ -14,6 +14,8 @@ #include "chromeos/ash/components/network/fake_network_connection_handler.h" #include "chromeos/ash/components/network/fake_stub_cellular_networks_provider.h" #include "chromeos/ash/components/network/managed_cellular_pref_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/hermes/hermes_euicc_client.h" @@ -22,8 +24,6 @@ #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/testing_pref_service.h"
diff --git a/chromeos/ash/components/network/cellular_metrics_logger.cc b/chromeos/ash/components/network/cellular_metrics_logger.cc index ac5bce9..e419661 100644 --- a/chromeos/ash/components/network/cellular_metrics_logger.cc +++ b/chromeos/ash/components/network/cellular_metrics_logger.cc
@@ -12,9 +12,9 @@ #include "chromeos/ash/components/network/cellular_esim_profile.h" #include "chromeos/ash/components/network/cellular_esim_profile_handler.h" #include "chromeos/ash/components/network/cellular_utils.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/components/feature_usage/feature_usage_metrics.h" #include "chromeos/dbus/hermes/hermes_manager_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/chromeos/ash/components/network/cellular_metrics_logger.h b/chromeos/ash/components/network/cellular_metrics_logger.h index c165a05..89a6cc09 100644 --- a/chromeos/ash/components/network/cellular_metrics_logger.h +++ b/chromeos/ash/components/network/cellular_metrics_logger.h
@@ -12,8 +12,8 @@ #include "base/time/time.h" #include "base/timer/elapsed_timer.h" #include "base/timer/timer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_observer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chromeos/ash/components/network/cellular_metrics_logger_unittest.cc b/chromeos/ash/components/network/cellular_metrics_logger_unittest.cc index b7abb16..584ffca 100644 --- a/chromeos/ash/components/network/cellular_metrics_logger_unittest.cc +++ b/chromeos/ash/components/network/cellular_metrics_logger_unittest.cc
@@ -13,11 +13,11 @@ #include "base/time/time.h" #include "chromeos/ash/components/network/cellular_esim_profile.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/components/feature_usage/feature_usage_metrics.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_ui_data.h" #include "dbus/object_path.h"
diff --git a/chromeos/ash/components/network/cellular_policy_handler_unittest.cc b/chromeos/ash/components/network/cellular_policy_handler_unittest.cc index 2468c0cc..ad73836 100644 --- a/chromeos/ash/components/network/cellular_policy_handler_unittest.cc +++ b/chromeos/ash/components/network/cellular_policy_handler_unittest.cc
@@ -18,14 +18,14 @@ #include "chromeos/ash/components/network/fake_network_connection_handler.h" #include "chromeos/ash/components/network/managed_cellular_pref_handler.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/components/onc/onc_utils.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/ash/components/network/client_cert_resolver.h b/chromeos/ash/components/network/client_cert_resolver.h index 729bf26..4c7045af 100644 --- a/chromeos/ash/components/network/client_cert_resolver.h +++ b/chromeos/ash/components/network/client_cert_resolver.h
@@ -18,7 +18,7 @@ #include "base/sequence_checker.h" #include "base/time/time.h" #include "chromeos/ash/components/network/client_cert_util.h" -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/network/network_policy_observer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h"
diff --git a/chromeos/ash/components/network/client_cert_resolver_unittest.cc b/chromeos/ash/components/network/client_cert_resolver_unittest.cc index 1cdc8a1f..7778ac4fe 100644 --- a/chromeos/ash/components/network/client_cert_resolver_unittest.cc +++ b/chromeos/ash/components/network/client_cert_resolver_unittest.cc
@@ -20,14 +20,14 @@ #include "base/test/task_environment.h" #include "base/values.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/onc/onc_certificate_importer_impl.h" #include "chromeos/components/onc/onc_test_utils.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/system_token_cert_db_storage.h"
diff --git a/chromeos/ash/components/network/fake_network_activation_handler.h b/chromeos/ash/components/network/fake_network_activation_handler.h index 49e109e..ce469618 100644 --- a/chromeos/ash/components/network/fake_network_activation_handler.h +++ b/chromeos/ash/components/network/fake_network_activation_handler.h
@@ -8,7 +8,7 @@ #include <string> #include "base/component_export.h" -#include "chromeos/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_activation_handler.h" #include "chromeos/network/network_handler_callbacks.h" namespace chromeos {
diff --git a/chromeos/ash/components/network/fake_network_connection_handler.h b/chromeos/ash/components/network/fake_network_connection_handler.h index 0757cf40..6bd9d63 100644 --- a/chromeos/ash/components/network/fake_network_connection_handler.h +++ b/chromeos/ash/components/network/fake_network_connection_handler.h
@@ -10,7 +10,7 @@ #include "base/callback_forward.h" #include "base/component_export.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_handler_callbacks.h" namespace chromeos {
diff --git a/chromeos/ash/components/network/managed_network_configuration_handler_impl.cc b/chromeos/ash/components/network/managed_network_configuration_handler_impl.cc index d6deca8..89bb14e 100644 --- a/chromeos/ash/components/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/ash/components/network/managed_network_configuration_handler_impl.cc
@@ -24,6 +24,7 @@ #include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/onc/onc_merger.h" #include "chromeos/ash/components/network/onc/onc_translator.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" @@ -33,7 +34,6 @@ #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_policy_observer.h"
diff --git a/chromeos/ash/components/network/managed_network_configuration_handler_unittest.cc b/chromeos/ash/components/network/managed_network_configuration_handler_unittest.cc index 707ccc1..785862d 100644 --- a/chromeos/ash/components/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/ash/components/network/managed_network_configuration_handler_unittest.cc
@@ -23,6 +23,8 @@ #include "chromeos/ash/components/network/managed_cellular_pref_handler.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" #include "chromeos/ash/components/network/mock_network_state_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" #include "chromeos/components/onc/onc_signature.h" @@ -34,8 +36,6 @@ #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_policy_observer.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/chromeos/ash/components/network/metrics/connection_info_metrics_logger.cc b/chromeos/ash/components/network/metrics/connection_info_metrics_logger.cc index de4fb0d..e753120 100644 --- a/chromeos/ash/components/network/metrics/connection_info_metrics_logger.cc +++ b/chromeos/ash/components/network/metrics/connection_info_metrics_logger.cc
@@ -7,7 +7,7 @@ #include "base/containers/contains.h" #include "base/containers/flat_set.h" #include "chromeos/ash/components/network/metrics/network_metrics_helper.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
diff --git a/chromeos/ash/components/network/metrics/connection_info_metrics_logger.h b/chromeos/ash/components/network/metrics/connection_info_metrics_logger.h index 094afb5..2d850e6 100644 --- a/chromeos/ash/components/network/metrics/connection_info_metrics_logger.h +++ b/chromeos/ash/components/network/metrics/connection_info_metrics_logger.h
@@ -7,7 +7,7 @@ #include "base/component_export.h" #include "base/containers/flat_map.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_state_handler_observer.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chromeos/ash/components/network/metrics/connection_info_metrics_logger_unittest.cc b/chromeos/ash/components/network/metrics/connection_info_metrics_logger_unittest.cc index 47cfaf8..9e7111e 100644 --- a/chromeos/ash/components/network/metrics/connection_info_metrics_logger_unittest.cc +++ b/chromeos/ash/components/network/metrics/connection_info_metrics_logger_unittest.cc
@@ -11,9 +11,9 @@ #include "base/test/task_environment.h" #include "chromeos/ash/components/network/metrics/connection_results.h" #include "chromeos/ash/components/network/metrics/network_metrics_helper.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" @@ -257,4 +257,4 @@ ShillConnectResult::kSuccess, 1); } -} // namespace chromeos \ No newline at end of file +} // namespace chromeos
diff --git a/chromeos/ash/components/network/metrics/connection_results.cc b/chromeos/ash/components/network/metrics/connection_results.cc index b6341bec..0439173 100644 --- a/chromeos/ash/components/network/metrics/connection_results.cc +++ b/chromeos/ash/components/network/metrics/connection_results.cc
@@ -4,7 +4,7 @@ #include "chromeos/ash/components/network/metrics/connection_results.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "third_party/cros_system_api/dbus/service_constants.h" namespace chromeos {
diff --git a/chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger_unittest.cc b/chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger_unittest.cc index f187109..9c8bef46 100644 --- a/chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger_unittest.cc +++ b/chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger_unittest.cc
@@ -10,9 +10,9 @@ #include "base/test/task_environment.h" #include "base/time/time.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_ui_data.h"
diff --git a/chromeos/ash/components/network/metrics/vpn_network_metrics_helper.h b/chromeos/ash/components/network/metrics/vpn_network_metrics_helper.h index ef99aba7..0fd377e 100644 --- a/chromeos/ash/components/network/metrics/vpn_network_metrics_helper.h +++ b/chromeos/ash/components/network/metrics/vpn_network_metrics_helper.h
@@ -9,8 +9,8 @@ #include "base/component_export.h" #include "base/scoped_observation.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_configuration_observer.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" namespace chromeos {
diff --git a/chromeos/ash/components/network/metrics/vpn_network_metrics_helper_unittest.cc b/chromeos/ash/components/network/metrics/vpn_network_metrics_helper_unittest.cc index 7b7db10..dfe97ba 100644 --- a/chromeos/ash/components/network/metrics/vpn_network_metrics_helper_unittest.cc +++ b/chromeos/ash/components/network/metrics/vpn_network_metrics_helper_unittest.cc
@@ -12,9 +12,9 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_ui_data.h" #include "chromeos/network/shill_property_util.h"
diff --git a/chromeos/network/network_activation_handler.h b/chromeos/ash/components/network/network_activation_handler.h similarity index 86% rename from chromeos/network/network_activation_handler.h rename to chromeos/ash/components/network/network_activation_handler.h index 88a5d2c..790f1fbd 100644 --- a/chromeos/network/network_activation_handler.h +++ b/chromeos/ash/components/network/network_activation_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_ -#define CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_ #include <string> @@ -43,4 +43,4 @@ using ::chromeos::NetworkActivationHandler; } -#endif // CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_
diff --git a/chromeos/network/network_activation_handler_impl.cc b/chromeos/ash/components/network/network_activation_handler_impl.cc similarity index 94% rename from chromeos/network/network_activation_handler_impl.cc rename to chromeos/ash/components/network/network_activation_handler_impl.cc index 24953130..29a9492 100644 --- a/chromeos/network/network_activation_handler_impl.cc +++ b/chromeos/ash/components/network/network_activation_handler_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_activation_handler_impl.h" +#include "chromeos/ash/components/network/network_activation_handler_impl.h" #include "base/bind.h" #include "base/callback_helpers.h"
diff --git a/chromeos/network/network_activation_handler_impl.h b/chromeos/ash/components/network/network_activation_handler_impl.h similarity index 80% rename from chromeos/network/network_activation_handler_impl.h rename to chromeos/ash/components/network/network_activation_handler_impl.h index e58a154..f241a94 100644 --- a/chromeos/network/network_activation_handler_impl.h +++ b/chromeos/ash/components/network/network_activation_handler_impl.h
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_ -#define CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_ #include <string> #include "base/component_export.h" #include "base/memory/weak_ptr.h" -#include "chromeos/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_activation_handler.h" #include "chromeos/network/network_handler_callbacks.h" namespace chromeos { @@ -43,4 +43,4 @@ } // namespace chromeos -#endif // CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_ACTIVATION_HANDLER_IMPL_H_
diff --git a/chromeos/network/network_cert_loader.cc b/chromeos/ash/components/network/network_cert_loader.cc similarity index 99% rename from chromeos/network/network_cert_loader.cc rename to chromeos/ash/components/network/network_cert_loader.cc index d682296..19139d0 100644 --- a/chromeos/network/network_cert_loader.cc +++ b/chromeos/ash/components/network/network_cert_loader.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include <algorithm> #include <initializer_list>
diff --git a/chromeos/network/network_cert_loader.h b/chromeos/ash/components/network/network_cert_loader.h similarity index 98% rename from chromeos/network/network_cert_loader.h rename to chromeos/ash/components/network/network_cert_loader.h index 9ab81af..f7be40b 100644 --- a/chromeos/network/network_cert_loader.h +++ b/chromeos/ash/components/network/network_cert_loader.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CERT_LOADER_H_ -#define CHROMEOS_NETWORK_NETWORK_CERT_LOADER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_LOADER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_LOADER_H_ #include <string> #include <vector> @@ -284,4 +284,4 @@ using ::chromeos::NetworkCertLoader; } -#endif // CHROMEOS_NETWORK_NETWORK_CERT_LOADER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_LOADER_H_
diff --git a/chromeos/network/network_cert_loader_unittest.cc b/chromeos/ash/components/network/network_cert_loader_unittest.cc similarity index 99% rename from chromeos/network/network_cert_loader_unittest.cc rename to chromeos/ash/components/network/network_cert_loader_unittest.cc index 61656ab84..6b33453 100644 --- a/chromeos/network/network_cert_loader_unittest.cc +++ b/chromeos/ash/components/network/network_cert_loader_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include <stddef.h>
diff --git a/chromeos/network/network_cert_migrator.cc b/chromeos/ash/components/network/network_cert_migrator.cc similarity index 98% rename from chromeos/network/network_cert_migrator.cc rename to chromeos/ash/components/network/network_cert_migrator.cc index 45e550d..cac2849 100644 --- a/chromeos/network/network_cert_migrator.cc +++ b/chromeos/ash/components/network/network_cert_migrator.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_cert_migrator.h" +#include "chromeos/ash/components/network/network_cert_migrator.h" #include <cert.h> #include <string>
diff --git a/chromeos/network/network_cert_migrator.h b/chromeos/ash/components/network/network_cert_migrator.h similarity index 85% rename from chromeos/network/network_cert_migrator.h rename to chromeos/ash/components/network/network_cert_migrator.h index 1b4da782..ed43b3b 100644 --- a/chromeos/network/network_cert_migrator.h +++ b/chromeos/ash/components/network/network_cert_migrator.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CERT_MIGRATOR_H_ -#define CHROMEOS_NETWORK_NETWORK_CERT_MIGRATOR_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_MIGRATOR_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_MIGRATOR_H_ #include "base/component_export.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" @@ -52,4 +52,4 @@ } // namespace chromeos -#endif // CHROMEOS_NETWORK_NETWORK_CERT_MIGRATOR_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_MIGRATOR_H_
diff --git a/chromeos/network/network_cert_migrator_unittest.cc b/chromeos/ash/components/network/network_cert_migrator_unittest.cc similarity index 98% rename from chromeos/network/network_cert_migrator_unittest.cc rename to chromeos/ash/components/network/network_cert_migrator_unittest.cc index 1235747b..415d3af 100644 --- a/chromeos/network/network_cert_migrator_unittest.cc +++ b/chromeos/ash/components/network/network_cert_migrator_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_cert_migrator.h" +#include "chromeos/ash/components/network/network_cert_migrator.h" #include <cert.h> #include <pk11pub.h> @@ -11,10 +11,10 @@ #include "base/files/file_path.h" #include "base/strings/string_number_conversions.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/network/network_cert_loader.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/system_token_cert_db_storage.h" #include "crypto/scoped_nss_types.h"
diff --git a/chromeos/network/network_certificate_handler.cc b/chromeos/ash/components/network/network_certificate_handler.cc similarity index 97% rename from chromeos/network/network_certificate_handler.cc rename to chromeos/ash/components/network/network_certificate_handler.cc index f069e8a..73609d2 100644 --- a/chromeos/network/network_certificate_handler.cc +++ b/chromeos/ash/components/network/network_certificate_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" #include "base/logging.h" #include "base/strings/stringprintf.h"
diff --git a/chromeos/network/network_certificate_handler.h b/chromeos/ash/components/network/network_certificate_handler.h similarity index 91% rename from chromeos/network/network_certificate_handler.h rename to chromeos/ash/components/network/network_certificate_handler.h index d4137ef0..481025a 100644 --- a/chromeos/network/network_certificate_handler.h +++ b/chromeos/ash/components/network/network_certificate_handler.h
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_ -#define CHROMEOS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_ #include <string> #include <vector> #include "base/component_export.h" -#include "chromeos/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_loader.h" namespace chromeos { @@ -107,4 +107,4 @@ } // namespace chromeos -#endif // CHROMEOS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERTIFICATE_HANDLER_H_
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/ash/components/network/network_configuration_handler.cc similarity index 99% rename from chromeos/network/network_configuration_handler.cc rename to chromeos/ash/components/network/network_configuration_handler.cc index a6279fa..ba144ed 100644 --- a/chromeos/network/network_configuration_handler.cc +++ b/chromeos/ash/components/network/network_configuration_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include <stddef.h>
diff --git a/chromeos/network/network_configuration_handler.h b/chromeos/ash/components/network/network_configuration_handler.h similarity index 97% rename from chromeos/network/network_configuration_handler.h rename to chromeos/ash/components/network/network_configuration_handler.h index d079253..099447e8 100644 --- a/chromeos/network/network_configuration_handler.h +++ b/chromeos/ash/components/network/network_configuration_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ -#define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ #include <map> #include <memory> @@ -17,8 +17,8 @@ #include "base/observer_list.h" #include "base/scoped_observation.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" #include "chromeos/dbus/common/dbus_method_call_status.h" -#include "chromeos/network/network_configuration_observer.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_state_handler.h" @@ -255,4 +255,4 @@ using ::chromeos::NetworkConfigurationHandler; } // namespace ash -#endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/ash/components/network/network_configuration_handler_unittest.cc similarity index 99% rename from chromeos/network/network_configuration_handler_unittest.cc rename to chromeos/ash/components/network/network_configuration_handler_unittest.cc index de2b644..5b19e98d 100644 --- a/chromeos/network/network_configuration_handler_unittest.cc +++ b/chromeos/ash/components/network/network_configuration_handler_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include <stddef.h> @@ -17,11 +17,11 @@ #include "base/task/single_thread_task_runner.h" #include "base/test/task_environment.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_observer.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/network/network_configuration_observer.cc b/chromeos/ash/components/network/network_configuration_observer.cc similarity index 92% rename from chromeos/network/network_configuration_observer.cc rename to chromeos/ash/components/network/network_configuration_observer.cc index b9cb306..8b40539 100644 --- a/chromeos/network/network_configuration_observer.cc +++ b/chromeos/ash/components/network/network_configuration_observer.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_configuration_observer.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" namespace chromeos {
diff --git a/chromeos/network/network_configuration_observer.h b/chromeos/ash/components/network/network_configuration_observer.h similarity index 88% rename from chromeos/network/network_configuration_observer.h rename to chromeos/ash/components/network/network_configuration_observer.h index 2df8f5a..461b5c58 100644 --- a/chromeos/network/network_configuration_observer.h +++ b/chromeos/ash/components/network/network_configuration_observer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_ -#define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_ #include <string> @@ -51,4 +51,4 @@ } // namespace chromeos -#endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_
diff --git a/chromeos/network/network_connect.cc b/chromeos/ash/components/network/network_connect.cc similarity index 98% rename from chromeos/network/network_connect.cc rename to chromeos/ash/components/network/network_connect.cc index 6561249e..1af348f9 100644 --- a/chromeos/network/network_connect.cc +++ b/chromeos/ash/components/network/network_connect.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include <memory> #include <utility> @@ -12,10 +12,10 @@ #include "base/strings/stringprintf.h" #include "base/values.h" #include "chromeos/ash/components/network/device_state.h" +#include "chromeos/ash/components/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_activation_handler.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_profile.h"
diff --git a/chromeos/network/network_connect.h b/chromeos/ash/components/network/network_connect.h similarity index 96% rename from chromeos/network/network_connect.h rename to chromeos/ash/components/network/network_connect.h index 211cc6b..b654162 100644 --- a/chromeos/network/network_connect.h +++ b/chromeos/ash/components/network/network_connect.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONNECT_H_ -#define CHROMEOS_NETWORK_NETWORK_CONNECT_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECT_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECT_H_ #include <string> @@ -122,4 +122,4 @@ using ::chromeos::NetworkConnect; } -#endif // CHROMEOS_NETWORK_NETWORK_CONNECT_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECT_H_
diff --git a/chromeos/network/network_connect_unittest.cc b/chromeos/ash/components/network/network_connect_unittest.cc similarity index 98% rename from chromeos/network/network_connect_unittest.cc rename to chromeos/ash/components/network/network_connect_unittest.cc index da520578..c92f123e 100644 --- a/chromeos/network/network_connect_unittest.cc +++ b/chromeos/ash/components/network/network_connect_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connect.h" +#include "chromeos/ash/components/network/network_connect.h" #include <memory> @@ -10,12 +10,12 @@ #include "base/run_loop.h" #include "base/test/task_environment.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_connect.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connect.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/ash/components/network/network_connection_handler.cc similarity index 96% rename from chromeos/network/network_connection_handler.cc rename to chromeos/ash/components/network/network_connection_handler.cc index 0e0348e..39147c9b 100644 --- a/chromeos/network/network_connection_handler.cc +++ b/chromeos/ash/components/network/network_connection_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -16,10 +16,10 @@ #include "chromeos/ash/components/network/client_cert_resolver.h" #include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler_impl.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler_impl.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state.h"
diff --git a/chromeos/network/network_connection_handler.h b/chromeos/ash/components/network/network_connection_handler.h similarity index 96% rename from chromeos/network/network_connection_handler.h rename to chromeos/ash/components/network/network_connection_handler.h index aa3c791..c598f09 100644 --- a/chromeos/network/network_connection_handler.h +++ b/chromeos/ash/components/network/network_connection_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ -#define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ #include <map> #include <set> @@ -18,8 +18,8 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/ash/components/network/managed_network_configuration_handler.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h" // TODO(https://crbug.com/1164001): move to forward declaration @@ -263,4 +263,4 @@ using ::chromeos::NetworkConnectionHandler; } -#endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_H_
diff --git a/chromeos/network/network_connection_handler_impl.cc b/chromeos/ash/components/network/network_connection_handler_impl.cc similarity index 99% rename from chromeos/network/network_connection_handler_impl.cc rename to chromeos/ash/components/network/network_connection_handler_impl.cc index 733b2ad7..006f75f7 100644 --- a/chromeos/network/network_connection_handler_impl.cc +++ b/chromeos/ash/components/network/network_connection_handler_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connection_handler_impl.h" +#include "chromeos/ash/components/network/network_connection_handler_impl.h" #include <memory> #include <ostream> @@ -24,10 +24,10 @@ #include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/chromeos/network/network_connection_handler_impl.h b/chromeos/ash/components/network/network_connection_handler_impl.h similarity index 95% rename from chromeos/network/network_connection_handler_impl.h rename to chromeos/ash/components/network/network_connection_handler_impl.h index bda32f3..3ecebc78 100644 --- a/chromeos/network/network_connection_handler_impl.h +++ b/chromeos/ash/components/network/network_connection_handler_impl.h
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_ -#define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_ #include "base/component_export.h" #include "base/scoped_observation.h" #include "base/timer/timer.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/dbus/common/dbus_method_call_status.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h" @@ -197,4 +197,4 @@ } // namespace chromeos -#endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_HANDLER_IMPL_H_
diff --git a/chromeos/network/network_connection_handler_impl_unittest.cc b/chromeos/ash/components/network/network_connection_handler_impl_unittest.cc similarity index 98% rename from chromeos/network/network_connection_handler_impl_unittest.cc rename to chromeos/ash/components/network/network_connection_handler_impl_unittest.cc index f97e4a7..96a3921c 100644 --- a/chromeos/network/network_connection_handler_impl_unittest.cc +++ b/chromeos/ash/components/network/network_connection_handler_impl_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connection_handler_impl.h" +#include "chromeos/ash/components/network/network_connection_handler_impl.h" #include <map> #include <memory> @@ -18,13 +18,13 @@ #include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/cellular_utils.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" -#include "chromeos/network/network_connection_observer.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/network/network_connection_observer.cc b/chromeos/ash/components/network/network_connection_observer.cc similarity index 91% rename from chromeos/network/network_connection_observer.cc rename to chromeos/ash/components/network/network_connection_observer.cc index 0884986..0246dd5 100644 --- a/chromeos/network/network_connection_observer.cc +++ b/chromeos/ash/components/network/network_connection_observer.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/network_connection_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" namespace chromeos {
diff --git a/chromeos/network/network_connection_observer.h b/chromeos/ash/components/network/network_connection_observer.h similarity index 88% rename from chromeos/network/network_connection_observer.h rename to chromeos/ash/components/network/network_connection_observer.h index 2dee940a3..d14537d9 100644 --- a/chromeos/network/network_connection_observer.h +++ b/chromeos/ash/components/network/network_connection_observer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_ -#define CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_ +#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_ #include <string> @@ -50,4 +50,4 @@ using ::chromeos::NetworkConnectionObserver; } -#endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_ +#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_
diff --git a/chromeos/ash/components/network/onc/network_onc_utils.cc b/chromeos/ash/components/network/onc/network_onc_utils.cc index f2aaf59..72a0e7d 100644 --- a/chromeos/ash/components/network/onc/network_onc_utils.cc +++ b/chromeos/ash/components/network/onc/network_onc_utils.cc
@@ -21,6 +21,7 @@ #include "base/strings/string_util.h" #include "base/values.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/onc/onc_normalizer.h" #include "chromeos/ash/components/network/onc/onc_translator.h" @@ -28,7 +29,6 @@ #include "chromeos/components/onc/onc_signature.h" #include "chromeos/components/onc/onc_utils.h" #include "chromeos/components/onc/onc_validator.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_profile.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/chromeos/components/sync_wifi/network_test_helper.h b/chromeos/components/sync_wifi/network_test_helper.h index 307130e..af11612 100644 --- a/chromeos/components/sync_wifi/network_test_helper.h +++ b/chromeos/components/sync_wifi/network_test_helper.h
@@ -6,10 +6,10 @@ #define CHROMEOS_COMPONENTS_SYNC_WIFI_NETWORK_TEST_HELPER_H_ #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/components/sync_wifi/synced_network_metrics_logger.cc b/chromeos/components/sync_wifi/synced_network_metrics_logger.cc index e8058ae..bf7d03d 100644 --- a/chromeos/components/sync_wifi/synced_network_metrics_logger.cc +++ b/chromeos/components/sync_wifi/synced_network_metrics_logger.cc
@@ -6,9 +6,9 @@ #include "base/bind.h" #include "base/metrics/histogram_functions.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/components/sync_wifi/network_eligibility_checker.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/components/sync_wifi/synced_network_metrics_logger.h b/chromeos/components/sync_wifi/synced_network_metrics_logger.h index c7afc9e..13b63df6 100644 --- a/chromeos/components/sync_wifi/synced_network_metrics_logger.h +++ b/chromeos/components/sync_wifi/synced_network_metrics_logger.h
@@ -9,8 +9,8 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/components/sync_wifi/network_eligibility_checker.h" -#include "chromeos/network/network_connection_observer.h" #include "chromeos/network/network_state_handler_observer.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chromeos/components/sync_wifi/synced_network_updater_impl.cc b/chromeos/components/sync_wifi/synced_network_updater_impl.cc index 9c7fce9..d8ce8e9d 100644 --- a/chromeos/components/sync_wifi/synced_network_updater_impl.cc +++ b/chromeos/components/sync_wifi/synced_network_updater_impl.cc
@@ -7,9 +7,9 @@ #include "base/bind.h" #include "base/guid.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/components/sync_wifi/network_type_conversions.h" #include "chromeos/components/sync_wifi/timer_factory.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_metadata_store.h"
diff --git a/chromeos/components/sync_wifi/wifi_configuration_bridge.cc b/chromeos/components/sync_wifi/wifi_configuration_bridge.cc index 3fa1a69..44a1840 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_bridge.cc +++ b/chromeos/components/sync_wifi/wifi_configuration_bridge.cc
@@ -15,13 +15,13 @@ #include "base/strings/stringprintf.h" #include "base/time/clock.h" #include "base/time/time.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/components/sync_wifi/local_network_collector.h" #include "chromeos/components/sync_wifi/network_identifier.h" #include "chromeos/components/sync_wifi/network_type_conversions.h" #include "chromeos/components/sync_wifi/synced_network_metrics_logger.h" #include "chromeos/components/sync_wifi/synced_network_updater.h" #include "chromeos/components/sync_wifi/timer_factory.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_metadata_store.h" #include "components/device_event_log/device_event_log.h"
diff --git a/chromeos/components/sync_wifi/wifi_configuration_bridge.h b/chromeos/components/sync_wifi/wifi_configuration_bridge.h index 18b300e..6a946c0 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_bridge.h +++ b/chromeos/components/sync_wifi/wifi_configuration_bridge.h
@@ -13,8 +13,8 @@ #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" #include "chromeos/components/sync_wifi/network_identifier.h" -#include "chromeos/network/network_configuration_observer.h" #include "chromeos/network/network_metadata_observer.h" #include "components/sync/base/model_type.h" #include "components/sync/model/model_type_store.h"
diff --git a/chromeos/dbus/BUILD.gn b/chromeos/dbus/BUILD.gn index 47ade84d..7d37ef6 100644 --- a/chromeos/dbus/BUILD.gn +++ b/chromeos/dbus/BUILD.gn
@@ -29,8 +29,6 @@ ":vm_sk_forwarding_proto", "//base", "//chromeos/dbus/cec_service", - "//chromeos/dbus/chunneld", - "//chromeos/dbus/chunneld:proto", "//chromeos/dbus/cros_disks", "//chromeos/dbus/easy_unlock", "//chromeos/dbus/fwupd", @@ -43,8 +41,6 @@ "//chromeos/dbus/runtime_probe:proto", "//chromeos/dbus/smbprovider", "//chromeos/dbus/smbprovider:proto", - "//chromeos/dbus/update_engine", - "//chromeos/dbus/update_engine:proto", "//chromeos/dbus/util", "//components/account_id", "//components/device_event_log", @@ -101,7 +97,6 @@ "//chromeos/dbus/tpm_manager:tpm_manager_proto", "//chromeos/dbus/u2f", "//chromeos/dbus/u2f:u2f_proto", - "//chromeos/dbus/update_engine:unit_tests", "//chromeos/dbus/util:unit_tests", "//dbus", "//dbus:test_support",
diff --git a/chromeos/network/BUILD.gn b/chromeos/network/BUILD.gn index cc699fb3..684458b 100644 --- a/chromeos/network/BUILD.gn +++ b/chromeos/network/BUILD.gn
@@ -53,27 +53,6 @@ "//chromeos/ash/components/network/proxy", ] sources = [ - "network_activation_handler.h", - "network_activation_handler_impl.cc", - "network_activation_handler_impl.h", - "network_cert_loader.cc", - "network_cert_loader.h", - "network_cert_migrator.cc", - "network_cert_migrator.h", - "network_certificate_handler.cc", - "network_certificate_handler.h", - "network_configuration_handler.cc", - "network_configuration_handler.h", - "network_configuration_observer.cc", - "network_configuration_observer.h", - "network_connect.cc", - "network_connect.h", - "network_connection_handler.cc", - "network_connection_handler.h", - "network_connection_handler_impl.cc", - "network_connection_handler_impl.h", - "network_connection_observer.cc", - "network_connection_observer.h", "network_device_handler.cc", "network_device_handler.h", "network_device_handler_impl.cc", @@ -167,11 +146,6 @@ "//testing/gtest", ] sources = [ - "network_cert_loader_unittest.cc", - "network_cert_migrator_unittest.cc", - "network_configuration_handler_unittest.cc", - "network_connect_unittest.cc", - "network_connection_handler_impl_unittest.cc", "network_device_handler_unittest.cc", "network_event_log_unittest.cc", "network_metadata_store_unittest.cc",
diff --git a/chromeos/network/network_handler.cc b/chromeos/network/network_handler.cc index 0ad2750..1a91460 100644 --- a/chromeos/network/network_handler.cc +++ b/chromeos/network/network_handler.cc
@@ -21,13 +21,13 @@ #include "chromeos/ash/components/network/metrics/connection_info_metrics_logger.h" #include "chromeos/ash/components/network/metrics/esim_policy_login_metrics_logger.h" #include "chromeos/ash/components/network/metrics/vpn_network_metrics_helper.h" +#include "chromeos/ash/components/network/network_activation_handler_impl.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_cert_migrator.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler_impl.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" -#include "chromeos/network/network_activation_handler_impl.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_cert_migrator.h" -#include "chromeos/network/network_certificate_handler.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler_impl.h" #include "chromeos/network/network_device_handler_impl.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/chromeos/network/network_metadata_store.cc b/chromeos/network/network_metadata_store.cc index faaefcc..44df9ff 100644 --- a/chromeos/network/network_metadata_store.cc +++ b/chromeos/network/network_metadata_store.cc
@@ -10,8 +10,8 @@ #include "base/metrics/histogram_functions.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h"
diff --git a/chromeos/network/network_metadata_store.h b/chromeos/network/network_metadata_store.h index 1c361d0..54bd894 100644 --- a/chromeos/network/network_metadata_store.h +++ b/chromeos/network/network_metadata_store.h
@@ -11,9 +11,9 @@ #include "base/observer_list.h" #include "base/scoped_observation.h" #include "base/values.h" +#include "chromeos/ash/components/network/network_configuration_observer.h" +#include "chromeos/ash/components/network/network_connection_observer.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_observer.h" -#include "chromeos/network/network_connection_observer.h" #include "chromeos/network/network_metadata_observer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler_observer.h"
diff --git a/chromeos/network/network_metadata_store_unittest.cc b/chromeos/network/network_metadata_store_unittest.cc index 5f5b301..0e679a5 100644 --- a/chromeos/network/network_metadata_store_unittest.cc +++ b/chromeos/network/network_metadata_store_unittest.cc
@@ -7,12 +7,12 @@ #include "base/callback_helpers.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler_impl.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" -#include "chromeos/network/network_connection_handler_impl.h" #include "chromeos/network/network_metadata_observer.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_state_handler.h"
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index 3d3d624..11a12d28 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc
@@ -24,7 +24,7 @@ #include "base/strings/stringprintf.h" #include "base/values.h" #include "chromeos/ash/components/network/device_state.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_state_handler_observer.h"
diff --git a/chromeos/network/prohibited_technologies_handler_unittest.cc b/chromeos/network/prohibited_technologies_handler_unittest.cc index d65f8ff..1915f71 100644 --- a/chromeos/network/prohibited_technologies_handler_unittest.cc +++ b/chromeos/network/prohibited_technologies_handler_unittest.cc
@@ -15,9 +15,9 @@ #include "base/run_loop.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/network/managed_network_configuration_handler_impl.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_state_test_helper.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/services/network_config/cros_network_config.cc b/chromeos/services/network_config/cros_network_config.cc index fb7f26ca..796585d 100644 --- a/chromeos/services/network_config/cros_network_config.cc +++ b/chromeos/services/network_config/cros_network_config.cc
@@ -20,6 +20,7 @@ #include "chromeos/ash/components/network/cellular_utils.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/onc/onc_translation_tables.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" #include "chromeos/components/sync_wifi/network_eligibility_checker.h" @@ -27,7 +28,6 @@ #include "chromeos/dbus/hermes/hermes_manager_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_handler.h"
diff --git a/chromeos/services/network_config/cros_network_config.h b/chromeos/services/network_config/cros_network_config.h index 77435ca..6687ba4 100644 --- a/chromeos/services/network_config/cros_network_config.h +++ b/chromeos/services/network_config/cros_network_config.h
@@ -8,7 +8,7 @@ #include "base/containers/flat_map.h" #include "base/memory/weak_ptr.h" #include "chromeos/ash/components/network/cellular_inhibitor.h" -#include "chromeos/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" #include "chromeos/network/network_policy_observer.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler_observer.h"
diff --git a/chromeos/services/network_config/cros_network_config_unittest.cc b/chromeos/services/network_config/cros_network_config_unittest.cc index 907463dd..b33296d2 100644 --- a/chromeos/services/network_config/cros_network_config_unittest.cc +++ b/chromeos/services/network_config/cros_network_config_unittest.cc
@@ -19,15 +19,15 @@ #include "chromeos/ash/components/network/cellular_metrics_logger.h" #include "chromeos/ash/components/network/fake_stub_cellular_networks_provider.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_cert_loader.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h" #include "chromeos/components/onc/onc_utils.h" #include "chromeos/dbus/shill/fake_shill_device_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_cert_loader.h" -#include "chromeos/network/network_certificate_handler.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_profile_handler.h"
diff --git a/chromeos/strings/chromeos_strings_km.xtb b/chromeos/strings/chromeos_strings_km.xtb index c7ec51f..d97a457 100644 --- a/chromeos/strings/chromeos_strings_km.xtb +++ b/chromeos/strings/chromeos_strings_km.xtb
@@ -123,6 +123,7 @@ <translation id="188114911237521550">បិទមុខងារងងឹត</translation> <translation id="1881188606372070653">ចូលទៅកាន់<ph name="BEGIN_LINK1" />ទំព័រជំនួយផ្នែកច្បាប់<ph name="END_LINK1" /> ដើម្បីស្នើសុំធ្វើការផ្លាស់ប្ដូរខ្លឹមសារដោយសារហេតុផលផ្លូវច្បាប់។ ព័ត៌មានមួយចំនួនអំពីគណនី និងប្រព័ន្ធអាចត្រូវបានផ្ញើទៅ Google។ យើងនឹងប្រើប្រាស់ព័ត៌មានដែលអ្នកផ្ដល់ឱ្យយើង ដើម្បីជួយដោះស្រាយបញ្ហាបច្ចេកទេស និងដើម្បីកែលម្អសេវាកម្មរបស់យើង ដោយអនុលោមតាម<ph name="BEGIN_LINK2" />គោលការណ៍ឯកជនភាព<ph name="END_LINK2" /> និង<ph name="BEGIN_LINK3" />លក្ខខណ្ឌប្រើប្រាស់<ph name="END_LINK3" />របស់យើង។</translation> <translation id="1887850431809612466">ការផ្លាស់ប្តូរផ្នែករឹង</translation> +<translation id="1904932688895783618">ទាំងនេះគឺជាធនធានដែលមានប្រយោជន៍ផ្សេងៗមួយចំនួនទៀត៖</translation> <translation id="1905710495812624430">បានលើសការព្យាយាមចូូលអតិបរមាដែលបានអនុញ្ញាតហើយ។</translation> <translation id="1908234395526491708">សំណើ UDP មិនបានសម្រេច</translation> <translation id="1932611479324127242">ផ្ដាច់ថ្ម</translation> @@ -137,6 +138,7 @@ <translation id="2016697457005847575">សាកល្បងអនុវត្តតាមជំហានដោះស្រាយបញ្ហា</translation> <translation id="2016848882344942759">--មិនមានស្លាកពណ៌ស--</translation> <translation id="202500043506723828">EID</translation> +<translation id="2047316797244836561">សូមភ្ជាប់ទៅបណ្ដាញ រួចផ្ទុកទំព័រឡើងវិញ ដើម្បីមើលធាតុរក្សាអេក្រង់។</translation> <translation id="2080070583977670716">ការកំណត់ច្រើនទៀត</translation> <translation id="2085089206770112532">គ្រាប់ចុចព្រួញចុះក្រោមសម្រាប់បន្ថយពន្លឺផ្ទាំងអេក្រង់</translation> <translation id="2105810540595158374">ឧបករណ៍គឺជាឧបករណ៍បញ្ជាហ្គេម។</translation> @@ -772,6 +774,7 @@ <translation id="7763470514545477072">ភាពត្រូវគ្នានៃកន្ទុយដែន</translation> <translation id="7769672763586021400">លេខសម្គាល់ម៉ូដែល</translation> <translation id="7784116172884276937">មិនបានរៀបចំម៉ាស៊ីនមេ DNS ទេ</translation> +<translation id="779591286616261875">ផ្ញើរបាយការណ៍ថ្មី</translation> <translation id="7799817062559422778">មុខងារភ្លឺ</translation> <translation id="780301667611848630">ទេ អរគុណ</translation> <translation id="7805768142964895445">ស្ថានភាព</translation> @@ -924,6 +927,7 @@ <translation id="9082718469794970195">ប្រើវីដេអូនេះ</translation> <translation id="9087578468327036362">រាយការណ៍អំពីសំណួរនេះ</translation> <translation id="9088306295921699330">ការប្រើប្រាស់បច្ចុប្បន្ន</translation> +<translation id="9092255287806472980">មតិកែលម្អរបស់អ្នកជួយធ្វើឱ្យ Chrome OS ប្រសើរឡើង ហើយនឹងត្រូវបានពិនិត្យមើលដោយក្រុមការងាររបស់យើង។ ដោយសារតែមានចំនួននៃរបាយការណ៍ច្រើន យើងនឹងមិនអាចផ្ញើការឆ្លើយតបបានទេ។</translation> <translation id="9095775724867566971">Pluginvm</translation> <translation id="90977145661420967">អ្នកនឹងត្រូវដោះបំបែកឧបករណ៍</translation> <translation id="9098156406873149060">រក្សាទិន្នន័យរបស់អ្នកប្រើប្រាស់</translation>
diff --git a/chromeos/strings/chromeos_strings_uz.xtb b/chromeos/strings/chromeos_strings_uz.xtb index e096e3d..199402d 100644 --- a/chromeos/strings/chromeos_strings_uz.xtb +++ b/chromeos/strings/chromeos_strings_uz.xtb
@@ -123,6 +123,7 @@ <translation id="188114911237521550">Tungi rejimdan chiqish</translation> <translation id="1881188606372070653">Agar bu kontent biror qonunni buzsa, shikoyat yuborish uchun <ph name="BEGIN_LINK1" />Huquqiy yordam sahifasiga<ph name="END_LINK1" /> kiring. Hisob va tizimga oid ayrim axborotlar Google kompaniyasiga yuborilishi mumkin. Bizga taqdim etilgan maʼlumotlardan texnik muammolarni hal qilish va xizmatlarimizni yaxshilashda foydalanamiz. Bunda <ph name="BEGIN_LINK2" />Maxfiylik siyosati<ph name="END_LINK2" /> va <ph name="BEGIN_LINK3" />Xizmat shartlariga<ph name="END_LINK3" /> rioya qilinadi.</translation> <translation id="1887850431809612466">Qurilma versiyasi</translation> +<translation id="1904932688895783618">Quyidagi manbalar foydali boʻlishi mumkin:</translation> <translation id="1905710495812624430">Urinishlar soni cheklovdan oshib ketdi.</translation> <translation id="1908234395526491708">Bajarilmagan UDP soʻrovlari</translation> <translation id="1932611479324127242">Batareyani uzish</translation> @@ -137,6 +138,7 @@ <translation id="2016697457005847575">Muammoni hal qilishga urining</translation> <translation id="2016848882344942759">--oq yorliqsiz--</translation> <translation id="202500043506723828">EID</translation> +<translation id="2047316797244836561">Ekran lavhasini koʻrish uchun tarmoqqa ulaning va sahifani yangilang.</translation> <translation id="2080070583977670716">Kengaytirilgan sozlamalar</translation> <translation id="2085089206770112532">Displey yorlinligini pasaytirish</translation> <translation id="2105810540595158374">Qurilma — geympad</translation> @@ -773,6 +775,7 @@ <translation id="7763470514545477072">Domen kengaytmasi topildi</translation> <translation id="7769672763586021400">Model identifikatori</translation> <translation id="7784116172884276937">DNS serverlar sozlanmagan</translation> +<translation id="779591286616261875">Yangi hisobot yuborish</translation> <translation id="7799817062559422778">Kunduzgi rejim</translation> <translation id="780301667611848630">Kerak emas</translation> <translation id="7805768142964895445">Holat</translation> @@ -925,6 +928,7 @@ <translation id="9082718469794970195">Bu videodan foydalanish</translation> <translation id="9087578468327036362">Bu soʻrov haqida xabar berish</translation> <translation id="9088306295921699330">Joriy faollik</translation> +<translation id="9092255287806472980">Fikr-mulohazangiz Chrome OS tizimini yaxshilashimizga yordam beradi va jamoamiz tomonidan koʻrib chiqiladi. Murojaatlar soni juda koʻpligi uchun har biriga javob qaytara olmaymiz.</translation> <translation id="9095775724867566971">Pluginvm</translation> <translation id="90977145661420967">Qurilma ichini ochish talab etiladi</translation> <translation id="9098156406873149060">Foydalanuvchi maʼlumotlari qolsin</translation>
diff --git a/chromeos/strings/chromeos_strings_zh-HK.xtb b/chromeos/strings/chromeos_strings_zh-HK.xtb index 2600d669..7724fb0 100644 --- a/chromeos/strings/chromeos_strings_zh-HK.xtb +++ b/chromeos/strings/chromeos_strings_zh-HK.xtb
@@ -647,7 +647,7 @@ <translation id="6516990319416533844">如要測試充電速率,請讓電池耗電一小段時間</translation> <translation id="6517239166834772319">探索</translation> <translation id="6527081081771465939">未知的 Wi-Fi 安全通訊協定</translation> -<translation id="6535178685492749208">你已經離線,系統稍後才會傳送意見回饋。</translation> +<translation id="6535178685492749208">您已離線。意見將會在稍後傳送。</translation> <translation id="65587193855025101">平台式</translation> <translation id="6564646048574748301">失敗 - 無法連接打印機</translation> <translation id="6566314079205407217">多頁掃瞄</translation>
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index 3a8dc386..5974dae 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -259,11 +259,6 @@ # b/235279574 "wmp.DragAndDropWindow", - # http://crbug.com/1336853 - "arc.StandardizedKeyboardTyping", - "arc.StandardizedKeyboardTyping.tablet_mode", - "arc.StandardizedKeyboardKeys.tablet_mode", - # http://b/236312054 "crostini.AppGeditFilesharing", "crostini.AppGeditFilesharing.stable", @@ -282,9 +277,6 @@ "crostini.RestartApp", "crostini.RestartApp.stable", - # http://crbug.com/1338038 - "arc.IMEBlockingVK", - # http://crbug.com/1335213 "arc.WindowState.clamshell", @@ -300,6 +292,12 @@ # https://crbug.com/1341288 "launcher.Smoke", "launcher.BubbleSmoke", + + # https://crbug.com/1341074 + "launcher.BubbleLaunchApp.enable_launcher_app_sort", + + # https://crbug.com/1341076 + "launcher.BubbleLaunchApp.disable_launcher_app_sort", ] # To create filters to be used on specific builders add them like this:
diff --git a/components/autofill/ios/browser/autofill_util.h b/components/autofill/ios/browser/autofill_util.h index d4aa8f7..c65ac04 100644 --- a/components/autofill/ios/browser/autofill_util.h +++ b/components/autofill/ios/browser/autofill_util.h
@@ -7,13 +7,12 @@ #include <vector> +#include "base/values.h" + #import "ios/web/public/js_messaging/web_frame.h" class GURL; -namespace base { -class DictionaryValue; -} namespace web { class WebState; } @@ -59,7 +58,7 @@ // Extracts a single form field from the JSON dictionary into a FormFieldData // object. // Returns false if the field could not be extracted. -bool ExtractFormFieldData(const base::DictionaryValue& field, +bool ExtractFormFieldData(const base::Value::Dict& field, FormFieldData* field_data); typedef base::OnceCallback<void(const base::Value*)> JavaScriptResultCallback;
diff --git a/components/autofill/ios/browser/autofill_util.mm b/components/autofill/ios/browser/autofill_util.mm index 9cde0ac..a4d0e58 100644 --- a/components/autofill/ios/browser/autofill_util.mm +++ b/components/autofill/ios/browser/autofill_util.mm
@@ -118,20 +118,24 @@ autofill::FormData* form_data) { DCHECK(form_data); // Each form should be a JSON dictionary. - const base::DictionaryValue* form_dictionary = nullptr; - if (!form_value.GetAsDictionary(&form_dictionary)) + if (!form_value.is_dict()) return false; + const base::Value::Dict& form_dictionary = form_value.GetDict(); + // Form data is copied into a FormData object field-by-field. - if (!form_dictionary->GetString("name", &form_data->name)) + const std::string* name = form_dictionary.FindString("name"); + if (!name) return false; + form_data->name = base::UTF8ToUTF16(*name); if (filtered && form_name != form_data->name) return false; // Origin is mandatory. - std::u16string origin; - if (!form_dictionary->GetString("origin", &origin)) + const std::string* origin_ptr = form_dictionary.FindString("origin"); + if (!origin_ptr) return false; + std::u16string origin = base::UTF8ToUTF16(*origin_ptr); // Use GURL object to verify origin of host frame URL. form_data->url = GURL(origin); @@ -141,35 +145,44 @@ // main_frame_origin is used for logging UKM. form_data->main_frame_origin = url::Origin::Create(main_frame_url); - std::string unique_renderer_id; - form_dictionary->GetString("unique_renderer_id", &unique_renderer_id); - if (!unique_renderer_id.empty()) { - StringToUint(unique_renderer_id, &form_data->unique_renderer_id.value()); + const std::string* unique_renderer_id = + form_dictionary.FindString("unique_renderer_id"); + if (unique_renderer_id && !unique_renderer_id->empty()) { + StringToUint(*unique_renderer_id, &form_data->unique_renderer_id.value()); } else { form_data->unique_renderer_id = FormRendererId(); } // Action is optional. std::u16string action; - form_dictionary->GetString("action", &action); + if (const std::string* action_ptr = form_dictionary.FindString("action")) { + action = base::UTF8ToUTF16(*action_ptr); + } form_data->action = GURL(action); // Optional fields. - form_dictionary->GetString("name_attribute", &form_data->name_attribute); - form_dictionary->GetString("id_attribute", &form_data->id_attribute); - form_data->is_form_tag = form_dictionary->FindBoolKey("is_form_tag") - .value_or(form_data->is_form_tag); - form_dictionary->GetString("frame_id", &form_data->frame_id); + if (const std::string* name_attribute = + form_dictionary.FindString("name_attribute")) { + form_data->name_attribute = base::UTF8ToUTF16(*name_attribute); + } + if (const std::string* id_attribute = + form_dictionary.FindString("id_attribute")) { + form_data->id_attribute = base::UTF8ToUTF16(*id_attribute); + } + form_data->is_form_tag = + form_dictionary.FindBool("is_form_tag").value_or(form_data->is_form_tag); + if (const std::string* frame_id = form_dictionary.FindString("frame_id")) { + form_data->frame_id = *frame_id; + } // Field list (mandatory) is extracted. - const base::ListValue* fields_list = nullptr; - if (!form_dictionary->GetList("fields", &fields_list)) + const base::Value::List* fields_list = form_dictionary.FindList("fields"); + if (!fields_list) return false; - for (const auto& field_dict : fields_list->GetListDeprecated()) { - const base::DictionaryValue* field; + for (const auto& field_dict : *fields_list) { autofill::FormFieldData field_data; - if (field_dict.GetAsDictionary(&field) && - ExtractFormFieldData(*field, &field_data)) { + if (field_dict.is_dict() && + ExtractFormFieldData(field_dict.GetDict(), &field_data)) { form_data->fields.push_back(std::move(field_data)); } else { return false; @@ -178,68 +191,81 @@ return true; } -bool ExtractFormFieldData(const base::DictionaryValue& field, +bool ExtractFormFieldData(const base::Value::Dict& field, autofill::FormFieldData* field_data) { - if (!field.GetString("name", &field_data->name) || - !field.GetString("identifier", &field_data->unique_id) || - !field.GetString("form_control_type", &field_data->form_control_type)) { + const std::string *name, *identifier, *form_control_type; + if (!(name = field.FindString("name")) || + !(identifier = field.FindString("identifier")) || + !(form_control_type = field.FindString("form_control_type"))) { return false; } - std::string unique_renderer_id; - field.GetString("unique_renderer_id", &unique_renderer_id); - if (!unique_renderer_id.empty()) { - StringToUint(unique_renderer_id, &field_data->unique_renderer_id.value()); + field_data->name = base::UTF8ToUTF16(*name); + field_data->unique_id = base::UTF8ToUTF16(*identifier); + field_data->form_control_type = *form_control_type; + + const std::string* unique_renderer_id = + field.FindString("unique_renderer_id"); + if (unique_renderer_id && !unique_renderer_id->empty()) { + StringToUint(*unique_renderer_id, &field_data->unique_renderer_id.value()); } else { field_data->unique_renderer_id = FieldRendererId(); } // Optional fields. - field.GetString("name_attribute", &field_data->name_attribute); - field.GetString("id_attribute", &field_data->id_attribute); - field.GetString("label", &field_data->label); - field.GetString("value", &field_data->value); - field.GetString("autocomplete_attribute", - &field_data->autocomplete_attribute); + if (const std::string* name_attribute = field.FindString("name_attribute")) { + field_data->name_attribute = base::UTF8ToUTF16(*name_attribute); + } + if (const std::string* id_attribute = field.FindString("id_attribute")) { + field_data->id_attribute = base::UTF8ToUTF16(*id_attribute); + } + if (const std::string* label = field.FindString("label")) { + field_data->label = base::UTF8ToUTF16(*label); + } + if (const std::string* value = field.FindString("value")) { + field_data->value = base::UTF8ToUTF16(*value); + } + if (const std::string* autocomplete_attribute = + field.FindString("autocomplete_attribute")) { + field_data->autocomplete_attribute = *autocomplete_attribute; + } field_data->is_autofilled = - field.FindBoolKey("is_autofilled").value_or(field_data->is_autofilled); + field.FindBool("is_autofilled").value_or(field_data->is_autofilled); - int max_length = 0; - if (field.GetInteger("max_length", &max_length)) - field_data->max_length = max_length; + if (absl::optional<int> max_length = field.FindInt("max_length")) { + field_data->max_length = *max_length; + } // TODO(crbug.com/427614): Extract |is_checked|. - bool is_checkable = field.FindBoolKey("is_checkable").value_or(false); + bool is_checkable = field.FindBool("is_checkable").value_or(false); autofill::SetCheckStatus(field_data, is_checkable, false); field_data->is_focusable = - field.FindBoolKey("is_focusable").value_or(field_data->is_focusable); + field.FindBool("is_focusable").value_or(field_data->is_focusable); field_data->should_autocomplete = - field.FindBoolKey("should_autocomplete") + field.FindBool("should_autocomplete") .value_or(field_data->should_autocomplete); // RoleAttribute::kOther is the default value. The only other value as of this // writing is RoleAttribute::kPresentation. - int role = 0; - if (field.GetInteger("role", &role) && - role == static_cast<int>(FormFieldData::RoleAttribute::kPresentation)) { + absl::optional<int> role = field.FindInt("role"); + if (role && + *role == static_cast<int>(FormFieldData::RoleAttribute::kPresentation)) { field_data->role = FormFieldData::RoleAttribute::kPresentation; } // TODO(crbug.com/427614): Extract |text_direction|. // Load option values where present. - const base::ListValue* option_values; - const base::ListValue* option_contents; - if (field.GetList("option_values", &option_values) && - field.GetList("option_contents", &option_contents)) { - auto value_list = option_values->GetListDeprecated(); - auto content_list = option_contents->GetListDeprecated(); - if (value_list.size() != content_list.size()) + const base::Value::List* option_values = field.FindList("option_values"); + const base::Value::List* option_contents = field.FindList("option_contents"); + if (option_values && option_contents) { + if (option_values->size() != option_contents->size()) return false; - auto value_it = value_list.begin(); - auto content_it = content_list.begin(); - while (value_it != value_list.end() && content_it != content_list.end()) { + auto value_it = option_values->begin(); + auto content_it = option_contents->begin(); + while (value_it != option_values->end() && + content_it != option_contents->end()) { if (value_it->is_string() && content_it->is_string()) { field_data->options.push_back( {.value = base::UTF8ToUTF16(value_it->GetString()),
diff --git a/components/captive_portal/core/DEPS b/components/captive_portal/core/DEPS index 7b5f1e0..d6896f0 100644 --- a/components/captive_portal/core/DEPS +++ b/components/captive_portal/core/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+chromeos/ash/components/network", "+chromeos/network", "+services/network/public/cpp", "+services/network/public/mojom",
diff --git a/components/captive_portal/core/captive_portal_detector.cc b/components/captive_portal/core/captive_portal_detector.cc index fde9c78..40d1201 100644 --- a/components/captive_portal/core/captive_portal_detector.cc +++ b/components/captive_portal/core/captive_portal_detector.cc
@@ -19,7 +19,7 @@ #include "url/gurl.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #endif
diff --git a/components/services/app_service/public/cpp/BUILD.gn b/components/services/app_service/public/cpp/BUILD.gn index b510282..745556c 100644 --- a/components/services/app_service/public/cpp/BUILD.gn +++ b/components/services/app_service/public/cpp/BUILD.gn
@@ -319,7 +319,6 @@ sources = [ "app_capability_access_cache_unittest.cc", "app_capability_access_cache_wrapper_unittest.cc", - "app_registry_cache_mojom_unittest.cc", "app_registry_cache_unittest.cc", "app_registry_cache_wrapper_unittest.cc", "app_update_mojom_unittest.cc",
diff --git a/components/services/app_service/public/cpp/app_registry_cache.cc b/components/services/app_service/public/cpp/app_registry_cache.cc index 24f1537..58e42f5c 100644 --- a/components/services/app_service/public/cpp/app_registry_cache.cc +++ b/components/services/app_service/public/cpp/app_registry_cache.cc
@@ -109,10 +109,7 @@ DoOnApps(std::move(pending)); } - if (base::FeatureList::IsEnabled( - kAppServiceOnAppTypeInitializedWithoutMojom)) { - OnAppTypeInitialized(); - } + OnAppTypeInitialized(); } void AppRegistryCache::DoOnApps(std::vector<apps::mojom::AppPtr> deltas) { @@ -333,30 +330,7 @@ return base::Contains(initialized_app_types_, app_type); } -void AppRegistryCache::OnMojomAppTypeInitialized() { - if (in_progress_initialized_mojom_app_types_.empty()) { - return; - } - - auto in_progress_initialized_app_types = - in_progress_initialized_mojom_app_types_; - in_progress_initialized_mojom_app_types_.clear(); - - for (auto app_type : in_progress_initialized_app_types) { - for (auto& obs : observers_) { - obs.OnAppTypeInitialized(ConvertMojomAppTypToAppType(app_type)); - } - initialized_app_types_.insert(ConvertMojomAppTypToAppType(app_type)); - } -} - void AppRegistryCache::OnAppTypeInitialized() { - if (!base::FeatureList::IsEnabled( - kAppServiceOnAppTypeInitializedWithoutMojom)) { - OnMojomAppTypeInitialized(); - return; - } - // Check both the non mojom and mojom initialized status. Only when they are // not initialized, call OnAppTypeInitialized to notify observers, because // observers might use the non mojom or mojom App struct.
diff --git a/components/services/app_service/public/cpp/app_registry_cache.h b/components/services/app_service/public/cpp/app_registry_cache.h index 3010da4..f0e84427 100644 --- a/components/services/app_service/public/cpp/app_registry_cache.h +++ b/components/services/app_service/public/cpp/app_registry_cache.h
@@ -258,8 +258,6 @@ void DoOnApps(std::vector<apps::mojom::AppPtr> deltas); void DoOnApps(std::vector<AppPtr> deltas); - void OnMojomAppTypeInitialized(); - void OnAppTypeInitialized(); base::ObserverList<Observer> observers_;
diff --git a/components/services/app_service/public/cpp/app_registry_cache_mojom_unittest.cc b/components/services/app_service/public/cpp/app_registry_cache_mojom_unittest.cc deleted file mode 100644 index efbbdcd2..0000000 --- a/components/services/app_service/public/cpp/app_registry_cache_mojom_unittest.cc +++ /dev/null
@@ -1,567 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <map> - -#include "base/memory/raw_ptr.h" -#include "base/test/scoped_feature_list.h" -#include "components/services/app_service/public/cpp/app_registry_cache.h" -#include "components/services/app_service/public/cpp/app_types.h" -#include "components/services/app_service/public/cpp/features.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace { - -class MockRegistryObserver : public apps::AppRegistryCache::Observer { - public: - MOCK_METHOD(void, OnAppUpdate, (const apps::AppUpdate& update), ()); - - MOCK_METHOD(void, - OnAppRegistryCacheWillBeDestroyed, - (apps::AppRegistryCache * cache), - ()); -}; - -MATCHER_P(HasAppId, app_id, "Has the correct app id") { - return arg.AppId() == app_id; -} - -} // namespace - -class AppRegistryCacheMojomTest : public testing::Test, - public apps::AppRegistryCache::Observer { - protected: - AppRegistryCacheMojomTest() { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{}, - /*disabled_features=*/{ - apps::kAppServiceOnAppTypeInitializedWithoutMojom, - apps::kAppServiceOnAppUpdateWithoutMojom}); - } - - static apps::mojom::AppPtr MakeApp( - const char* app_id, - const char* name, - apps::mojom::Readiness readiness = apps::mojom::Readiness::kUnknown) { - apps::mojom::AppPtr app = apps::mojom::App::New(); - app->app_type = apps::mojom::AppType::kArc; - app->app_id = app_id; - app->readiness = readiness; - app->name = name; - return app; - } - - void CallForEachApp(apps::AppRegistryCache& cache) { - cache.ForEachApp( - [this](const apps::AppUpdate& update) { OnAppUpdate(update); }); - } - - std::string GetName(apps::AppRegistryCache& cache, - const std::string& app_id) { - std::string name; - cache.ForOneApp(app_id, [&name](const apps::AppUpdate& update) { - name = update.Name(); - }); - return name; - } - - // apps::AppRegistryCache::Observer overrides. - void OnAppUpdate(const apps::AppUpdate& update) override { - EXPECT_EQ(account_id_, update.AccountId()); - EXPECT_NE("", update.Name()); - if (update.ReadinessChanged() && - (update.Readiness() == apps::Readiness::kReady)) { - num_freshly_installed_++; - } - updated_ids_.insert(update.AppId()); - updated_names_.insert(update.Name()); - } - - void OnAppTypeInitialized(apps::AppType app_type) override { - app_type_ = app_type; - } - - void OnAppRegistryCacheWillBeDestroyed( - apps::AppRegistryCache* cache) override { - // The test code explicitly calls both AddObserver and RemoveObserver. - NOTREACHED(); - } - - void SetAppType(apps::AppType app_type) { app_type_ = app_type; } - - const AccountId& account_id() const { return account_id_; } - - apps::AppType app_type() const { return app_type_; } - - int num_freshly_installed_ = 0; - std::set<std::string> updated_ids_; - std::set<std::string> updated_names_; - AccountId account_id_ = AccountId::FromUserEmail("test@gmail.com"); - apps::AppType app_type_ = apps::AppType::kUnknown; - base::test::ScopedFeatureList scoped_feature_list_; -}; - -// Responds to a cache's OnAppUpdate to call back into the cache, checking that -// the cache presents a self-consistent snapshot. For example, the app names -// should match for the outer and inner AppUpdate. -// -// In the tests below, just "recursive" means that cache.OnApps calls -// observer.OnAppsUpdate which calls cache.ForEachApp and cache.ForOneApp. -// "Super-recursive" means that cache.OnApps calls observer.OnAppsUpdate calls -// cache.OnApps which calls observer.OnAppsUpdate. -class RecursiveObserver : public apps::AppRegistryCache::Observer { - public: - explicit RecursiveObserver(apps::AppRegistryCache* cache) : cache_(cache) { - Observe(cache); - } - - ~RecursiveObserver() override = default; - - void PrepareForOnApps( - int expected_num_apps, - const std::string& expected_name_for_p, - std::vector<apps::mojom::AppPtr>* super_recursive_apps = nullptr) { - expected_name_for_p_ = expected_name_for_p; - expected_num_apps_ = expected_num_apps; - num_apps_seen_on_app_update_ = 0; - old_names_.clear(); - - names_snapshot_.clear(); - check_names_snapshot_ = true; - if (super_recursive_apps) { - check_names_snapshot_ = false; - super_recursive_apps_.swap(*super_recursive_apps); - } - } - - int NumAppsSeenOnAppUpdate() { return num_apps_seen_on_app_update_; } - - apps::AppType app_type() const { return app_type_; } - - protected: - // apps::AppRegistryCache::Observer overrides. - void OnAppUpdate(const apps::AppUpdate& outer) override { - EXPECT_EQ(account_id_, outer.AccountId()); - int num_apps = 0; - cache_->ForEachApp([this, &outer, &num_apps](const apps::AppUpdate& inner) { - if (check_names_snapshot_) { - if (num_apps_seen_on_app_update_ == 0) { - // If this is the first time that OnAppUpdate is called, after a - // PrepareForOnApps call, then just populate the names_snapshot_ map. - names_snapshot_[inner.AppId()] = inner.Name(); - } else { - // Otherwise, check that the names found during this OnAppUpdate call - // match those during the first OnAppUpdate call. - auto iter = names_snapshot_.find(inner.AppId()); - EXPECT_EQ(inner.Name(), - (iter != names_snapshot_.end()) ? iter->second : ""); - } - } - - if (outer.AppId() == inner.AppId()) { - ExpectEq(outer, inner); - } - - if (inner.AppId() == "p") { - EXPECT_EQ(expected_name_for_p_, inner.Name()); - } - - num_apps++; - }); - EXPECT_EQ(expected_num_apps_, num_apps); - - EXPECT_FALSE(cache_->ForOneApp( - "no_such_app_id", - [&outer](const apps::AppUpdate& inner) { ExpectEq(outer, inner); })); - - EXPECT_TRUE(cache_->ForOneApp( - outer.AppId(), - [&outer](const apps::AppUpdate& inner) { ExpectEq(outer, inner); })); - - if (outer.NameChanged()) { - std::string old_name; - auto iter = old_names_.find(outer.AppId()); - if (iter != old_names_.end()) { - old_name = iter->second; - } - // The way the tests are configured, if an app's name changes, it should - // increase (in string comparison order): e.g. from "" to "mango" or from - // "mango" to "mulberry" and never from "mulberry" to "melon". - EXPECT_LT(old_name, outer.Name()); - } - old_names_[outer.AppId()] = outer.Name(); - - std::vector<apps::mojom::AppPtr> super_recursive; - while (!super_recursive_apps_.empty()) { - apps::mojom::AppPtr app = std::move(super_recursive_apps_.back()); - super_recursive_apps_.pop_back(); - if (app.get() == nullptr) { - // This is the placeholder 'punctuation'. - break; - } - super_recursive.push_back(std::move(app)); - } - if (!super_recursive.empty()) { - cache_->OnApps(std::move(super_recursive), apps::mojom::AppType::kArc, - false /* should_notify_initialized */); - } - - num_apps_seen_on_app_update_++; - } - - void OnAppTypeInitialized(apps::AppType app_type) override { - app_type_ = app_type; - } - - void OnAppRegistryCacheWillBeDestroyed( - apps::AppRegistryCache* cache) override { - Observe(nullptr); - } - - static void ExpectEq(const apps::AppUpdate& outer, - const apps::AppUpdate& inner) { - EXPECT_EQ(outer.AppType(), inner.AppType()); - EXPECT_EQ(outer.AppId(), inner.AppId()); - EXPECT_EQ(outer.StateIsNull(), inner.StateIsNull()); - EXPECT_EQ(outer.Readiness(), inner.Readiness()); - EXPECT_EQ(outer.Name(), inner.Name()); - } - - raw_ptr<apps::AppRegistryCache> cache_; - std::string expected_name_for_p_; - int expected_num_apps_; - int num_apps_seen_on_app_update_; - AccountId account_id_ = AccountId::FromUserEmail("test@gmail.com"); - apps::AppType app_type_ = apps::AppType::kUnknown; - - // Records previously seen app names, keyed by app_id's, so we can check - // that, for these tests, a given app's name is always increasing (in string - // comparison order). - std::map<std::string, std::string> old_names_; - - // Non-empty when this.OnAppsUpdate should trigger more cache_.OnApps calls. - // - // During OnAppsUpdate, this vector (a stack) is popped from the back until a - // nullptr 'punctuation' element (a group terminator) is seen. If that group - // of popped elements (in LIFO order) is non-empty, that group forms the - // vector of App's passed to cache_.OnApps. - std::vector<apps::mojom::AppPtr> super_recursive_apps_; - - // For non-super-recursive tests (i.e. for check_names_snapshot_ == true), we - // check that the "app_id to name" mapping is consistent across every - // OnAppsUpdate call to this observer. For super-recursive tests, that - // mapping can change as updates are processed, so the names_snapshot_ check - // is skipped. - bool check_names_snapshot_ = false; - std::map<std::string, std::string> names_snapshot_; -}; - -// InitializedObserver is used to test the OnAppTypeInitialized interface for -// AppRegistryCache::Observer. -class InitializedObserver : public apps::AppRegistryCache::Observer { - public: - explicit InitializedObserver(apps::AppRegistryCache* cache) { - Observe(cache); - } - - ~InitializedObserver() override = default; - - // apps::AppRegistryCache::Observer overrides. - void OnAppUpdate(const apps::AppUpdate& update) override { - updated_ids_.insert(update.AppId()); - } - - void OnAppTypeInitialized(apps::AppType app_type) override { - app_type_ = app_type; - ++count_; - app_count_ = updated_ids_.size(); - } - - void OnAppRegistryCacheWillBeDestroyed( - apps::AppRegistryCache* cache) override { - Observe(nullptr); - } - - void SetAppType(apps::AppType app_type) { app_type_ = app_type; } - - apps::AppType app_type() const { return app_type_; } - - int count() const { return count_; } - - int app_count() const { return app_count_; } - - private: - std::set<std::string> updated_ids_; - apps::AppType app_type_ = apps::AppType::kUnknown; - int count_ = 0; - int app_count_ = 0; -}; - -TEST_F(AppRegistryCacheMojomTest, ForEachApp) { - std::vector<apps::mojom::AppPtr> deltas; - apps::AppRegistryCache cache; - cache.SetAccountId(account_id()); - - updated_names_.clear(); - CallForEachApp(cache); - - EXPECT_EQ(0u, updated_names_.size()); - - deltas.clear(); - deltas.push_back(MakeApp("a", "apple")); - deltas.push_back(MakeApp("b", "banana")); - deltas.push_back(MakeApp("c", "cherry")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - - updated_names_.clear(); - CallForEachApp(cache); - - EXPECT_EQ(3u, updated_names_.size()); - EXPECT_NE(updated_names_.end(), updated_names_.find("apple")); - EXPECT_NE(updated_names_.end(), updated_names_.find("banana")); - EXPECT_NE(updated_names_.end(), updated_names_.find("cherry")); - - deltas.clear(); - deltas.push_back(MakeApp("a", "apricot")); - deltas.push_back(MakeApp("d", "durian")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - - updated_names_.clear(); - CallForEachApp(cache); - - EXPECT_EQ(4u, updated_names_.size()); - EXPECT_NE(updated_names_.end(), updated_names_.find("apricot")); - EXPECT_NE(updated_names_.end(), updated_names_.find("banana")); - EXPECT_NE(updated_names_.end(), updated_names_.find("cherry")); - EXPECT_NE(updated_names_.end(), updated_names_.find("durian")); - - // Test that ForOneApp succeeds for "c" and fails for "e". - - bool found_c = false; - EXPECT_TRUE(cache.ForOneApp("c", [&found_c](const apps::AppUpdate& update) { - found_c = true; - EXPECT_EQ("c", update.AppId()); - })); - EXPECT_TRUE(found_c); - - bool found_e = false; - EXPECT_FALSE(cache.ForOneApp("e", [&found_e](const apps::AppUpdate& update) { - found_e = true; - EXPECT_EQ("e", update.AppId()); - })); - EXPECT_FALSE(found_e); -} - -TEST_F(AppRegistryCacheMojomTest, Removed) { - apps::AppRegistryCache cache; - testing::StrictMock<MockRegistryObserver> observer; - cache.SetAccountId(account_id()); - cache.AddObserver(&observer); - - // Starting with an empty cache. - cache.ForEachApp([&observer](const apps::AppUpdate& update) { - observer.OnAppUpdate(update); - }); - - // We add the app, and expect to be notified. - EXPECT_CALL(observer, OnAppUpdate(HasAppId("app"))); - std::vector<apps::mojom::AppPtr> apps; - apps.push_back(MakeApp("app", "app", apps::mojom::Readiness::kReady)); - cache.OnApps(std::move(apps), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - - // We first say the app is uninstalled, then remove it. - apps.clear(); - apps.push_back( - MakeApp("app", "app", apps::mojom::Readiness::kUninstalledByUser)); - apps.push_back(MakeApp("app", "app", apps::mojom::Readiness::kRemoved)); - - // We should see one call informing us that the app was uninstalled. - EXPECT_CALL(observer, OnAppUpdate(HasAppId("app"))) - .WillOnce( - testing::Invoke([&observer, &cache](const apps::AppUpdate& update) { - EXPECT_EQ(apps::Readiness::kUninstalledByUser, update.Readiness()); - // Even though we have queued the removal, checking the cache now - // shows the app is still present. - EXPECT_CALL(observer, OnAppUpdate(HasAppId("app"))); - cache.ForEachApp([&observer](const apps::AppUpdate& update) { - observer.OnAppUpdate(update); - }); - })); - cache.OnApps(std::move(apps), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - - // The cache is now empty. - cache.ForEachApp([](const apps::AppUpdate& update) { NOTREACHED(); }); - cache.RemoveObserver(&observer); -} - -TEST_F(AppRegistryCacheMojomTest, Observer) { - std::vector<apps::mojom::AppPtr> deltas; - apps::AppRegistryCache cache; - cache.SetAccountId(account_id()); - - cache.AddObserver(this); - - num_freshly_installed_ = 0; - updated_ids_.clear(); - deltas.clear(); - deltas.push_back(MakeApp("a", "avocado")); - deltas.push_back(MakeApp("c", "cucumber")); - deltas.push_back(MakeApp("e", "eggfruit")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - EXPECT_EQ(0, num_freshly_installed_); - EXPECT_EQ(3u, updated_ids_.size()); - EXPECT_NE(updated_ids_.end(), updated_ids_.find("a")); - EXPECT_NE(updated_ids_.end(), updated_ids_.find("c")); - EXPECT_NE(updated_ids_.end(), updated_ids_.find("e")); - EXPECT_EQ(apps::AppType::kArc, app_type()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); - - SetAppType(apps::AppType::kUnknown); - num_freshly_installed_ = 0; - updated_ids_.clear(); - deltas.clear(); - deltas.push_back(MakeApp("b", "blueberry")); - deltas.push_back(MakeApp("c", "cucumber", apps::mojom::Readiness::kReady)); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - false /* should_notify_initialized */); - - EXPECT_EQ(1, num_freshly_installed_); - EXPECT_EQ(2u, updated_ids_.size()); - EXPECT_NE(updated_ids_.end(), updated_ids_.find("b")); - EXPECT_NE(updated_ids_.end(), updated_ids_.find("c")); - EXPECT_EQ(apps::AppType::kUnknown, app_type()); - - cache.RemoveObserver(this); - - num_freshly_installed_ = 0; - updated_ids_.clear(); - deltas.clear(); - deltas.push_back(MakeApp("f", "fig")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - - EXPECT_EQ(0, num_freshly_installed_); - EXPECT_EQ(0u, updated_ids_.size()); - EXPECT_EQ(apps::AppType::kUnknown, app_type()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); -} - -TEST_F(AppRegistryCacheMojomTest, Recursive) { - std::vector<apps::mojom::AppPtr> deltas; - apps::AppRegistryCache cache; - cache.SetAccountId(account_id()); - RecursiveObserver observer(&cache); - - observer.PrepareForOnApps(2, "peach"); - deltas.clear(); - deltas.push_back(MakeApp("o", "orange")); - deltas.push_back(MakeApp("p", "peach")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - EXPECT_EQ(2, observer.NumAppsSeenOnAppUpdate()); - - observer.PrepareForOnApps(3, "pear"); - deltas.clear(); - deltas.push_back(MakeApp("p", "pear", apps::mojom::Readiness::kReady)); - deltas.push_back(MakeApp("q", "quince")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - EXPECT_EQ(2, observer.NumAppsSeenOnAppUpdate()); - - observer.PrepareForOnApps(3, "plum"); - deltas.clear(); - deltas.push_back(MakeApp("p", "pear")); - deltas.push_back(MakeApp("p", "pear")); - deltas.push_back(MakeApp("p", "plum")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kUnknown, - false /* should_notify_initialized */); - EXPECT_EQ(1, observer.NumAppsSeenOnAppUpdate()); - EXPECT_EQ(apps::AppType::kArc, observer.app_type()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); -} - -TEST_F(AppRegistryCacheMojomTest, SuperRecursive) { - std::vector<apps::mojom::AppPtr> deltas; - apps::AppRegistryCache cache; - cache.SetAccountId(account_id()); - RecursiveObserver observer(&cache); - - // Set up a series of OnApps to be called during observer.OnAppUpdate: - // - the 1st update is {"blackberry, "coconut"}. - // - the 2nd update is {}. - // - the 3rd update is {"blackcurrant", "apricot", "blueberry"}. - // - the 4th update is {"avocado"}. - // - the 5th update is {}. - // - the 6th update is {"boysenberry"}. - // - // The vector is processed in LIFO order with nullptr punctuation to - // terminate each group. See the comment on the - // RecursiveObserver::super_recursive_apps_ field. - std::vector<apps::mojom::AppPtr> super_recursive_apps; - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(MakeApp("b", "boysenberry")); - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(MakeApp("a", "avocado")); - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(MakeApp("b", "blueberry")); - super_recursive_apps.push_back(MakeApp("a", "apricot")); - super_recursive_apps.push_back(MakeApp("b", "blackcurrant")); - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(nullptr); - super_recursive_apps.push_back(MakeApp("c", "coconut")); - super_recursive_apps.push_back(MakeApp("b", "blackberry")); - - observer.PrepareForOnApps(3, "", &super_recursive_apps); - deltas.clear(); - deltas.push_back(MakeApp("a", "apple")); - deltas.push_back(MakeApp("b", "banana")); - deltas.push_back(MakeApp("c", "cherry")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - // After all of that, check that for each app_id, the last delta won. - EXPECT_EQ("avocado", GetName(cache, "a")); - EXPECT_EQ("boysenberry", GetName(cache, "b")); - EXPECT_EQ("coconut", GetName(cache, "c")); - EXPECT_EQ(apps::AppType::kArc, observer.app_type()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); -} - -TEST_F(AppRegistryCacheMojomTest, OnAppTypeInitialized) { - std::vector<apps::mojom::AppPtr> deltas; - apps::AppRegistryCache cache; - InitializedObserver observer1(&cache); - - deltas.push_back(MakeApp("a", "avocado")); - deltas.push_back(MakeApp("c", "cucumber")); - deltas.push_back(MakeApp("e", "eggfruit")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - deltas.clear(); - deltas.push_back(MakeApp("d", "durian")); - cache.OnApps(std::move(deltas), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - EXPECT_EQ(apps::AppType::kArc, observer1.app_type()); - EXPECT_EQ(1, observer1.count()); - EXPECT_EQ(3, observer1.app_count()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); - - // New observers should not have OnAppTypeInitialized called. - InitializedObserver observer2(&cache); - EXPECT_EQ(apps::AppType::kUnknown, observer2.app_type()); - EXPECT_EQ(0, observer2.count()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(apps::AppType::kArc)); -}
diff --git a/components/services/app_service/public/cpp/app_registry_cache_unittest.cc b/components/services/app_service/public/cpp/app_registry_cache_unittest.cc index 4798bfc1..81047f7 100644 --- a/components/services/app_service/public/cpp/app_registry_cache_unittest.cc +++ b/components/services/app_service/public/cpp/app_registry_cache_unittest.cc
@@ -391,30 +391,15 @@ updated_names_.clear(); } - void DisableOnAppTypeInitializedFlag() { - scoped_feature_list_.Reset(); - if (IsOnAppUpdateWithoutMojomEnabled()) { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{kAppServiceOnAppUpdateWithoutMojom}, - /*disabled_features=*/{kAppServiceOnAppTypeInitializedWithoutMojom}); - } else { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{}, - /*disabled_features=*/{kAppServiceOnAppTypeInitializedWithoutMojom, - kAppServiceOnAppUpdateWithoutMojom}); - } - } - void EnableOnAppTypeInitializedFlag() { scoped_feature_list_.Reset(); if (IsOnAppUpdateWithoutMojomEnabled()) scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{kAppServiceOnAppUpdateWithoutMojom, - kAppServiceOnAppTypeInitializedWithoutMojom}, + /*enabled_features=*/{kAppServiceOnAppUpdateWithoutMojom}, /*disabled_features=*/{}); else { scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{kAppServiceOnAppTypeInitializedWithoutMojom}, + /*enabled_features=*/{}, /*disabled_features=*/{kAppServiceOnAppUpdateWithoutMojom}); } } @@ -1034,286 +1019,6 @@ } // Verify the OnAppTypeInitialized callback when OnApps is called for the non -// mojom App type first, with the disabled flag. -TEST_P(AppRegistryCacheTest, - OnAppTypeInitializedWithDisableFlagNonMojomUpdateFirst) { - DisableOnAppTypeInitializedFlag(); - - AppRegistryCache cache; - InitializedObserver observer1(&cache); - - std::vector<AppPtr> deltas1; - deltas1.push_back(MakeApp("a", "avocado")); - deltas1.push_back(MakeApp("c", "cucumber")); - cache.OnApps(std::move(deltas1), AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // added. - EXPECT_TRUE(observer1.app_types().empty()); - EXPECT_EQ(0, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_TRUE(cache.InitializedAppTypes().empty()); - EXPECT_FALSE(cache.IsAppTypeInitialized(AppType::kArc)); - - std::vector<apps::mojom::AppPtr> mojom_deltas1; - mojom_deltas1.push_back(MakeMojomApp("a", "avocado")); - mojom_deltas1.push_back(MakeMojomApp("c", "cucumber")); - cache.OnApps(std::move(mojom_deltas1), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is called when the mojom Apps are added. - EXPECT_TRUE(base::Contains(observer1.app_types(), apps::AppType::kArc)); - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(2, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kArc)); - - std::vector<AppPtr> deltas2; - deltas2.push_back(MakeApp("d", "durian")); - cache.OnApps(std::move(deltas2), AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // added. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(2, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - - std::vector<apps::mojom::AppPtr> mojom_deltas2; - mojom_deltas2.push_back(MakeMojomApp("d", "durian")); - cache.OnApps(std::move(mojom_deltas2), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the mojom Apps are - // initialized again. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(2, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - - // Verify the new observers should not have OnAppTypeInitialized called. - InitializedObserver observer2(&cache); - EXPECT_TRUE(observer2.app_types().empty()); - EXPECT_EQ(0, observer2.initialized_app_type_count()); - EXPECT_EQ(0, observer2.app_count_at_initialization()); -} - -// Verify the OnAppTypeInitialized callback when OnApps is called for the mojom -// App type first, with the disabled flag. -TEST_P(AppRegistryCacheTest, - OnAppTypeInitializedWithDisableFlagMojomUpdateFirst) { - DisableOnAppTypeInitializedFlag(); - - AppRegistryCache cache; - InitializedObserver observer1(&cache); - - std::vector<apps::mojom::AppPtr> mojom_deltas1; - mojom_deltas1.push_back(MakeMojomApp("a", "avocado")); - mojom_deltas1.push_back(MakeMojomApp("c", "cucumber")); - cache.OnApps(std::move(mojom_deltas1), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - // When OnAppUpdate is called for mojom App, "a" and "c" are updated. - // When OnAppUpdate is called for non mojom App, no app is updated. - int app_count = IsOnAppUpdateWithoutMojomEnabled() ? 0 : 2; - - // Verify OnAppTypeInitialized is called when the mojom Apps are added. - EXPECT_TRUE(base::Contains(observer1.app_types(), apps::AppType::kArc)); - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(app_count, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kArc)); - - std::vector<AppPtr> deltas1; - deltas1.push_back(MakeApp("a", "avocado")); - deltas1.push_back(MakeApp("c", "cucumber")); - cache.OnApps(std::move(deltas1), AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // added. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(app_count, observer1.app_count_at_initialization()); - - std::vector<apps::mojom::AppPtr> mojom_deltas2; - mojom_deltas2.push_back(MakeMojomApp("d", "durian")); - cache.OnApps(std::move(mojom_deltas2), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - std::vector<AppPtr> deltas2; - deltas2.push_back(MakeApp("d", "durian")); - cache.OnApps(std::move(deltas2), AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the Apps are added. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(app_count, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - - // Verify the new observers should not have OnAppTypeInitialized called. - InitializedObserver observer2(&cache); - EXPECT_TRUE(observer2.app_types().empty()); - EXPECT_EQ(0, observer2.initialized_app_type_count()); - EXPECT_EQ(0, observer2.app_count_at_initialization()); -} - -// Verify the OnAppTypeInitialized callback when OnApps is called for multiple -// App types, with the disabled flag. -TEST_P(AppRegistryCacheTest, - OnAppTypeInitializedWithDisableFlagMultipleAppTypes) { - DisableOnAppTypeInitializedFlag(); - - AppRegistryCache cache; - InitializedObserver observer1(&cache); - - std::vector<AppPtr> deltas1; - deltas1.push_back(MakeApp("a", "avocado")); - deltas1.push_back(MakeApp("c", "cucumber")); - cache.OnApps(std::move(deltas1), AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // added. - EXPECT_TRUE(observer1.app_types().empty()); - EXPECT_EQ(0, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_TRUE(cache.InitializedAppTypes().empty()); - - std::vector<apps::mojom::AppPtr> mojom_deltas1; - mojom_deltas1.push_back(MakeMojomApp("a", "avocado")); - mojom_deltas1.push_back(MakeMojomApp("c", "cucumber")); - cache.OnApps(std::move(mojom_deltas1), apps::mojom::AppType::kArc, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is called when the mojom Apps are added. - EXPECT_TRUE(base::Contains(observer1.app_types(), apps::AppType::kArc)); - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(2, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kArc)); - - std::vector<apps::mojom::AppPtr> mojom_deltas2; - mojom_deltas2.push_back( - MakeMojomApp("d", "durian", apps::mojom::AppType::kChromeApp)); - cache.OnApps(std::move(mojom_deltas2), apps::mojom::AppType::kChromeApp, - true /* should_notify_initialized */); - - // When OnAppUpdate is called for mojom App, "a", "c", "d", "n", "s" are - // updated. When OnAppUpdate is called for non mojom App, "a", "c", "n", "s" - // is updated. - int app_count = IsOnAppUpdateWithoutMojomEnabled() ? 4 : 5; - - // Verify OnAppTypeInitialized is called when the mojom Apps are added. - EXPECT_EQ(2u, observer1.app_types().size()); - EXPECT_TRUE(base::Contains(observer1.app_types(), apps::AppType::kChromeApp)); - EXPECT_EQ(2, observer1.initialized_app_type_count()); - EXPECT_EQ(app_count, observer1.app_count_at_initialization()); - EXPECT_EQ(2u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kChromeApp)); - - std::vector<AppPtr> deltas2; - deltas2.push_back(MakeApp("d", "durian", AppType::kChromeApp)); - cache.OnApps(std::move(deltas2), AppType::kChromeApp, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // added. - EXPECT_EQ(2, observer1.initialized_app_type_count()); - EXPECT_EQ(app_count, observer1.app_count_at_initialization()); - EXPECT_EQ(2u, cache.InitializedAppTypes().size()); - - // Verify the new observers should not have OnAppTypeInitialized called. - InitializedObserver observer2(&cache); - EXPECT_TRUE(observer2.app_types().empty()); - EXPECT_EQ(0, observer2.initialized_app_type_count()); - EXPECT_EQ(0, observer2.app_count_at_initialization()); -} - -// Verify the OnAppTypeInitialized callback when OnApps is called for empty apps -// vector, with the disabled flag. -TEST_P(AppRegistryCacheTest, OnAppTypeInitializedWithDisableFlagEmptyUpdate) { - DisableOnAppTypeInitializedFlag(); - - AppRegistryCache cache; - InitializedObserver observer1(&cache); - - std::vector<AppPtr> deltas1; - cache.OnApps(std::move(deltas1), AppType::kStandaloneBrowserChromeApp, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // initialized. - EXPECT_TRUE(observer1.app_types().empty()); - EXPECT_EQ(0, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_TRUE(cache.InitializedAppTypes().empty()); - EXPECT_FALSE( - cache.IsAppTypeInitialized(AppType::kStandaloneBrowserChromeApp)); - - std::vector<apps::mojom::AppPtr> mojom_deltas1; - cache.OnApps(std::move(mojom_deltas1), - apps::mojom::AppType::kStandaloneBrowserChromeApp, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is called when the mojom Apps are initialized. - EXPECT_TRUE(base::Contains(observer1.app_types(), - apps::AppType::kStandaloneBrowserChromeApp)); - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kStandaloneBrowserChromeApp)); - - std::vector<AppPtr> deltas2; - deltas2.push_back(MakeApp("d", "durian")); - cache.OnApps(std::move(deltas2), AppType::kStandaloneBrowserChromeApp, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // initialized again. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - - std::vector<apps::mojom::AppPtr> mojom_deltas2; - mojom_deltas2.push_back(MakeMojomApp("d", "durian")); - cache.OnApps(std::move(mojom_deltas2), - apps::mojom::AppType::kStandaloneBrowserChromeApp, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the mojom Apps are - // initialized again. - EXPECT_EQ(1, observer1.initialized_app_type_count()); - EXPECT_EQ(0, observer1.app_count_at_initialization()); - EXPECT_EQ(1u, cache.InitializedAppTypes().size()); - - std::vector<apps::mojom::AppPtr> mojom_deltas3; - cache.OnApps(std::move(mojom_deltas3), apps::mojom::AppType::kRemote, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is called when the mojom Apps are initialized. - EXPECT_EQ(2u, observer1.app_types().size()); - EXPECT_TRUE(base::Contains(observer1.app_types(), apps::AppType::kRemote)); - EXPECT_EQ(2, observer1.initialized_app_type_count()); - EXPECT_EQ(2u, cache.InitializedAppTypes().size()); - EXPECT_TRUE(cache.IsAppTypeInitialized(AppType::kRemote)); - - std::vector<AppPtr> deltas3; - cache.OnApps(std::move(deltas3), AppType::kRemote, - true /* should_notify_initialized */); - - // Verify OnAppTypeInitialized is not called when the non mojom Apps are - // initialized. - EXPECT_EQ(2, observer1.initialized_app_type_count()); - EXPECT_EQ(2u, cache.InitializedAppTypes().size()); - - // Verify the new observers should not have OnAppTypeInitialized called. - InitializedObserver observer2(&cache); - EXPECT_TRUE(observer2.app_types().empty()); - EXPECT_EQ(0, observer2.initialized_app_type_count()); - EXPECT_EQ(0, observer2.app_count_at_initialization()); -} - -// Verify the OnAppTypeInitialized callback when OnApps is called for the non // mojom App type first, with the enabled flag. TEST_P(AppRegistryCacheTest, OnAppTypeInitializedWithEnableFlagNonMojomUpdateFirst) {
diff --git a/components/services/app_service/public/cpp/features.cc b/components/services/app_service/public/cpp/features.cc index b003aa0..78cec8e4 100644 --- a/components/services/app_service/public/cpp/features.cc +++ b/components/services/app_service/public/cpp/features.cc
@@ -6,10 +6,6 @@ namespace apps { -const base::Feature kAppServiceOnAppTypeInitializedWithoutMojom{ - "AppServiceOnAppTypeInitializedWithoutMojom", - base::FEATURE_ENABLED_BY_DEFAULT}; - const base::Feature kAppServiceOnAppUpdateWithoutMojom{ "AppServiceOnAppUpdateWithoutMojom", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/components/services/app_service/public/cpp/features.h b/components/services/app_service/public/cpp/features.h index 9bd5d29..5f65e4c 100644 --- a/components/services/app_service/public/cpp/features.h +++ b/components/services/app_service/public/cpp/features.h
@@ -11,8 +11,6 @@ namespace apps { COMPONENT_EXPORT(APP_TYPES) -extern const base::Feature kAppServiceOnAppTypeInitializedWithoutMojom; -COMPONENT_EXPORT(APP_TYPES) extern const base::Feature kAppServiceOnAppUpdateWithoutMojom; COMPONENT_EXPORT(APP_TYPES) extern const base::Feature kAppServiceCrosApiOnAppsWithoutMojom;
diff --git a/components/services/screen_ai/proto/proto_convertor.cc b/components/services/screen_ai/proto/proto_convertor.cc index 740d6b1b..f1c31a2 100644 --- a/components/services/screen_ai/proto/proto_convertor.cc +++ b/components/services/screen_ai/proto/proto_convertor.cc
@@ -16,6 +16,7 @@ #include <vector> #include "base/check_op.h" +#include "base/containers/flat_map.h" #include "base/notreached.h" #include "base/numerics/checked_math.h" #include "base/numerics/clamped_math.h" @@ -395,6 +396,31 @@ AddSubTree(nodes, id_to_position, nodes_order, id_to_position[child_id]); } +// Converts a Chrome role to a Screen2x role as text. +// TODO(https://crbug.com/1278249): Remove after Screen2x proto generation +// for training is done directly by Chrome. +std::string GetScreen2xRoleFromChromeRole(ax::mojom::Role role) { + // Some roles have different texts in Screen2x. + static base::flat_map<ax::mojom::Role, std::string> exceptions_map = { + {ax::mojom::Role::kComboBoxGrouping, "combobox"}, + {ax::mojom::Role::kContentInfo, "contentinfo"}, + {ax::mojom::Role::kDescriptionList, "DescriptionList"}, + {ax::mojom::Role::kDescriptionListDetail, "DescriptionListDetail"}, + {ax::mojom::Role::kDescriptionListTerm, "DescriptionListTerm"}, + {ax::mojom::Role::kGenericContainer, "generic"}, + {ax::mojom::Role::kHeaderAsNonLandmark, "HeaderAsNonLandmark"}, + {ax::mojom::Role::kImage, "img"}, + {ax::mojom::Role::kLineBreak, "LineBreak"}, + {ax::mojom::Role::kListItem, "listitem"}, + {ax::mojom::Role::kListMarker, "ListMarker"}, + {ax::mojom::Role::kRootWebArea, "RootWebArea"}, + {ax::mojom::Role::kSection, "Section"}, + {ax::mojom::Role::kStaticText, "StaticText"}}; + + const auto& item = exceptions_map.find(role); + return item == exceptions_map.end() ? ui::ToString(role) : item->second; +} + } // namespace namespace screen_ai { @@ -579,7 +605,7 @@ // Role. attrib = uie->add_attributes(); attrib->set_name("chrome_role"); - attrib->set_string_value(ui::ToString(node.role)); + attrib->set_string_value(GetScreen2xRoleFromChromeRole(node.role)); // AXNode ID. attrib = uie->add_attributes(); @@ -587,10 +613,10 @@ attrib->set_int_value(ax_node_id); // Child IDs. + attrib = uie->add_attributes(); + attrib->set_name("/axnode/child_ids"); for (const ui::AXNodeID& id : node.child_ids) { - attrib = uie->add_attributes(); - attrib->set_name("/axnode/child_ids"); - attrib->set_int_value(id); + attrib->mutable_int_list_value()->add_value(id); uie->add_child_ids(new_id[id]); }
diff --git a/components/services/screen_ai/proto/proto_convertor_unittest.cc b/components/services/screen_ai/proto/proto_convertor_unittest.cc index 7472923a..593db060 100644 --- a/components/services/screen_ai/proto/proto_convertor_unittest.cc +++ b/components/services/screen_ai/proto/proto_convertor_unittest.cc
@@ -4,6 +4,7 @@ #include "components/services/screen_ai/proto/proto_convertor.h" +#include <algorithm> #include <string> #include "base/files/file_path.h" @@ -19,6 +20,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_tree_update.h" #include "ui/accessibility/test_ax_tree_update_json_reader.h" +#include "ui/gfx/geometry/point_f.h" namespace { @@ -93,25 +95,132 @@ return std::string(); } -void CompareViewHierarchyProtos(screenai::ViewHierarchy& generated, - screenai::ViewHierarchy& expected) { +template <class T> +void ExpectBoundingBoxes(const T& box1, + const T& box2, + const gfx::PointF& max_diff) { + EXPECT_NEAR(box1.top(), box2.top(), max_diff.y()); + EXPECT_NEAR(box1.left(), box2.left(), max_diff.x()); + EXPECT_NEAR(box1.bottom(), box2.bottom(), max_diff.y()); + EXPECT_NEAR(box1.right(), box2.right(), max_diff.x()); +} + +// TODO(https://crbug.com/1278249): Consider making the comparison not sensitive +// to order. +template <class T> +void ExpectLists(const T& list1, const T& list2) { + EXPECT_EQ(list1.value_size(), list2.value_size()); + int min_length = std::min(list1.value_size(), list2.value_size()); + for (int i = 0; i < min_length; i++) + EXPECT_EQ(list1.value(i), list2.value(i)); +} + +void ExpectAttributes(const ::screenai::UiElementAttribute& attrib1, + const ::screenai::UiElementAttribute& attrib2) { + SCOPED_TRACE( + base::StringPrintf("Comparing attribute: %s", attrib1.name().c_str())); + EXPECT_EQ(attrib1.value_case(), attrib2.value_case()); + + switch (attrib1.value_case()) { + case screenai::UiElementAttribute::ValueCase::kBoolValue: + EXPECT_EQ(attrib1.bool_value(), attrib2.bool_value()); + break; + case screenai::UiElementAttribute::kIntValue: + EXPECT_EQ(attrib1.int_value(), attrib2.int_value()); + break; + case screenai::UiElementAttribute::kStringValue: + EXPECT_EQ(attrib1.string_value(), attrib2.string_value()); + break; + case screenai::UiElementAttribute::kFloatValue: + EXPECT_EQ(attrib1.float_value(), attrib2.float_value()); + break; + case screenai::UiElementAttribute::kIntListValue: { + ExpectLists(attrib1.int_list_value(), attrib2.int_list_value()); + break; + } + case screenai::UiElementAttribute::kStringListValue: { + ExpectLists(attrib1.int_list_value(), attrib2.int_list_value()); + break; + } + case screenai::UiElementAttribute::kFloatListValue: { + NOTREACHED() << "Chrome has no float list."; + break; + } + case screenai::UiElementAttribute::VALUE_NOT_SET: + break; + } +} + +void ExpectViewHierarchyProtos(screenai::ViewHierarchy& generated, + screenai::ViewHierarchy& expected) { EXPECT_EQ(generated.ui_elements_size(), expected.ui_elements_size()); + // Bounding boxes can have a one pixel difference threshold as there might be + // different approaches in rounding floats to integers. + // To compare |bounding_box_pixels| values which represent bounding boxes in + // pixels, we use |kPixelDifferenceThreshold|. + const gfx::PointF kPixelDifferenceThreshold(1, 1); + + // |bounding_box| values represent the relative position of a bounding box to + // the tree, and as each of them (the element and the tree) can have a one + // pixel error, the total error can be up to two pixels. To get the tree size + // to compute |kRelativeDifferenceThreshold|, we use the 0th element which + // should be the root and cover the entire tree. + const auto& root = expected.ui_elements(0); + const gfx::PointF kRelativeDifferenceThreshold( + 2.0 / root.bounding_box_pixels().right(), + 2.0 / root.bounding_box_pixels().bottom()); + EXPECT_EQ(root.bounding_box_pixels().top(), 0); + EXPECT_EQ(root.bounding_box_pixels().left(), 0); + for (int i = 0; i < generated.ui_elements_size(); i++) { SCOPED_TRACE(base::StringPrintf("Comparing ui_elements at index: %i", i)); - const screenai::UiElement& gen_uie = generated.ui_elements(i); - const screenai::UiElement& exp_uie = expected.ui_elements(i); + const screenai::UiElement& generated_uie = generated.ui_elements(i); + const screenai::UiElement& expected_uie = expected.ui_elements(i); - // TODO(https://crbug.com/1278249): Consider adding a comparison approach - // that iterates all values for lite protos. - EXPECT_EQ(gen_uie.id(), exp_uie.id()); - EXPECT_EQ(gen_uie.type(), exp_uie.type()); - EXPECT_EQ(gen_uie.parent_id(), exp_uie.parent_id()); - EXPECT_EQ(GetStringAttribute(gen_uie, "text"), - GetStringAttribute(exp_uie, "text")); + EXPECT_EQ(generated_uie.id(), expected_uie.id()); + EXPECT_EQ(generated_uie.type(), expected_uie.type()); + EXPECT_EQ(generated_uie.parent_id(), expected_uie.parent_id()); + EXPECT_EQ(GetStringAttribute(generated_uie, "text"), + GetStringAttribute(expected_uie, "text")); - // TODO(https://crbug.com/1278249): Compare child_ids, attributes, - // bounding_box, and bounding_box_pixels. + EXPECT_EQ(generated_uie.child_ids_size(), expected_uie.child_ids_size()); + int min_length = + std::min(generated_uie.child_ids_size(), expected_uie.child_ids_size()); + for (int child_index = 0; child_index < min_length; child_index++) + EXPECT_EQ(generated_uie.child_ids(child_index), + expected_uie.child_ids(child_index)); + + ExpectBoundingBoxes(generated_uie.bounding_box(), + expected_uie.bounding_box(), + kRelativeDifferenceThreshold); + ExpectBoundingBoxes(generated_uie.bounding_box_pixels(), + expected_uie.bounding_box_pixels(), + kPixelDifferenceThreshold); + + // Attributes may have different orders in the two protos. + std::map<std::string, int> attribute_index; + for (int j = 0; j < expected_uie.attributes_size(); j++) + attribute_index[expected_uie.attributes(j).name()] = j; + + for (int j = 0; j < generated_uie.attributes_size(); j++) { + const ::screenai::UiElementAttribute& generated_attrib = + generated_uie.attributes(j); + + const auto& expected_attrib_index = + attribute_index.find(generated_attrib.name()); + EXPECT_NE(expected_attrib_index, attribute_index.end()) + << "Could not find attribute: " << generated_attrib.name(); + if (expected_attrib_index != attribute_index.end()) { + ExpectAttributes(generated_attrib, expected_uie.attributes( + expected_attrib_index->second)); + } + } + + // TODO(https://crbug.com/1278249): Ensure all expected attributes are + // generated. + // EXPECT_EQ(generated_uie.attributes().size(), + // expected_uie.attributes().size()); } } @@ -218,7 +327,8 @@ const std::string expected_update( "id=4 dialog (0, 0)-(800, 900) child_ids=5,6\n" - " id=5 button offset_container_id=4 (0, 1)-(2, 3) transform=[ +0.0000 " + " id=5 button offset_container_id=4 (0, 1)-(2, 3) transform=[ " + "+0.0000 " "-1.0000 +0.0000 +0.0000 \n" " +1.0000 +0.0000 +0.0000 +0.0000 \n" " +0.0000 +0.0000 +1.0000 +0.0000 \n" @@ -284,15 +394,15 @@ TEST_F(ProtoConvertorTest, ViewHierarchyProtoGenerationTest) { // TODO(https://crbug.com/1278249): Add more tests. - const base::FilePath input_json_path = + const base::FilePath kInputJsonPath = GetTestFilePath("sample_01_ax_tree.json"); - const base::FilePath expected_proto_path = + const base::FilePath kExpectedProtoPath = GetTestFilePath("sample_01_expected_proto.pbtxt"); // Load JSON file. std::string file_content; - ASSERT_TRUE(base::ReadFileToString(input_json_path, &file_content)) - << "Failed to load input AX tree: " << input_json_path; + ASSERT_TRUE(base::ReadFileToString(kInputJsonPath, &file_content)) + << "Failed to load input AX tree: " << kInputJsonPath; absl::optional<base::Value> json = base::JSONReader::Read(file_content); ASSERT_TRUE(json.has_value()); @@ -310,15 +420,15 @@ WriteDebugProto(serialized_proto, "proto_convertor_output.pbtxt"); // Load expected Proto. - ASSERT_TRUE(base::ReadFileToString(expected_proto_path, &file_content)) - << "Failed to read expected proto from " << expected_proto_path; + ASSERT_TRUE(base::ReadFileToString(kExpectedProtoPath, &file_content)) + << "Failed to read expected proto from " << kExpectedProtoPath; screenai::ViewHierarchy expected_view_hierarchy; ASSERT_TRUE(expected_view_hierarchy.ParseFromString(file_content)) << "Failed to parse expected proto."; // Compare protos. - ASSERT_NO_FATAL_FAILURE(CompareViewHierarchyProtos(generated_view_hierarchy, - expected_view_hierarchy)); + ASSERT_NO_FATAL_FAILURE(ExpectViewHierarchyProtos(generated_view_hierarchy, + expected_view_hierarchy)); } } // namespace screen_ai
diff --git a/components/signin/core/browser/account_reconcilor_unittest.cc b/components/signin/core/browser/account_reconcilor_unittest.cc index 7be43cb..b18054ff 100644 --- a/components/signin/core/browser/account_reconcilor_unittest.cc +++ b/components/signin/core/browser/account_reconcilor_unittest.cc
@@ -37,6 +37,7 @@ #include "components/signin/public/identity_manager/primary_account_mutator.h" #include "components/signin/public/identity_manager/set_accounts_in_cookie_result.h" #include "components/sync_preferences/testing_pref_service_syncable.h" +#include "google_apis/gaia/core_account_id.h" #include "google_apis/gaia/gaia_constants.h" #include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/google_service_auth_error.h" @@ -413,8 +414,6 @@ const char* gaia_api_calls; const char* tokens_after_reconcile; const char* cookies_after_reconcile; - // Int represents AccountReconcilorDelegate::InconsistencyReason. - const int inconsistency_reason; }; std::vector<AccountReconcilorTestTableParam> GenerateTestCasesFromParams( @@ -466,6 +465,8 @@ bool has_error; }; + virtual void CreateReconclior() { GetMockReconcilor(); } + // Build Tokens from string. std::vector<Token> ParseTokenString(const char* token_string) { std::vector<Token> parsed_tokens; @@ -580,8 +581,134 @@ identity_test_env()->SetFreshnessOfAccountsInGaiaCookie(false); } - std::string GaiaIdForAccountKey(char account_key) { - return accounts_[account_key].gaia_id; + Account GetAccount(const CoreAccountId& account_id) { + for (const auto& pair : accounts_) { + const Account& account = pair.second; + if (PickAccountIdForAccount(account.gaia_id, account.email) == account_id) + return account; + } + NOTREACHED(); + return Account(); + } + + // Simulates the effect of a Multilogin call on the cookies. + std::vector<Cookie> FakeSetAccountsInCookie( + const signin::MultiloginParameters& parameters, + const std::vector<Cookie>& cookies_before_reconcile) { + std::vector<Cookie> cookies_after_reconcile; + if (parameters.mode == + gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER) { + for (const CoreAccountId& account_id : parameters.accounts_to_send) { + cookies_after_reconcile.push_back( + {GetAccount(account_id).gaia_id, true}); + } + } else { + std::vector<std::string> gaia_ids; + for (const auto& account_id : parameters.accounts_to_send) + gaia_ids.push_back(GetAccount(account_id).gaia_id); + cookies_after_reconcile = cookies_before_reconcile; + for (Cookie& cookie : cookies_after_reconcile) { + if (base::Contains(gaia_ids, cookie.gaia_id)) { + cookie.is_valid = true; + gaia_ids.erase( + std::find(gaia_ids.begin(), gaia_ids.end(), cookie.gaia_id)); + } else { + DCHECK(!cookie.is_valid); + } + } + for (const std::string& gaia_id : gaia_ids) + cookies_after_reconcile.push_back({gaia_id, true}); + } + return cookies_after_reconcile; + } + + // Runs the test corresponding to one row of the table. + void RunRowTest(const AccountReconcilorTestTableParam& param) { + // Setup cookies. + std::vector<Cookie> cookies = ParseCookieString(param.cookies); + ConfigureCookieManagerService(cookies); + std::vector<Cookie> cookies_after_reconcile = cookies; + + // Call list accounts now so that the next call completes synchronously. + identity_test_env()->identity_manager()->GetAccountsInCookieJar(); + base::RunLoop().RunUntilIdle(); + + // Setup tokens. This triggers listing cookies so we need to setup cookies + // before that. + SetupTokens(param.tokens); + + CreateReconclior(); + + // Setup expectations. + testing::InSequence mock_sequence; + bool should_logout = false; + if (param.gaia_api_calls[0] != '\0') { + if (param.gaia_api_calls[0] == 'X') { + should_logout = true; + EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) + .Times(1); + cookies_after_reconcile.clear(); + } else { + gaia::MultiloginMode mode = + param.gaia_api_calls[0] == 'U' + ? gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER + : gaia::MultiloginMode:: + MULTILOGIN_PRESERVE_COOKIE_ACCOUNTS_ORDER; + // Generate expected array of accounts in cookies and set fake gaia + // response. + std::vector<CoreAccountId> accounts_to_send; + for (int i = 1; param.gaia_api_calls[i] != '\0'; ++i) { + const Account& account = accounts_[param.gaia_api_calls[i]]; + accounts_to_send.push_back( + PickAccountIdForAccount(account.gaia_id, account.email)); + } + DCHECK(!accounts_to_send.empty()); + const signin::MultiloginParameters params(mode, accounts_to_send); + cookies_after_reconcile = FakeSetAccountsInCookie(params, cookies); + EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(params)) + .Times(1); + } + } + // Reconcile. + AccountReconcilor* reconcilor = GetMockReconcilor(); + ASSERT_TRUE(reconcilor); + ASSERT_TRUE(reconcilor->first_execution_); + reconcilor->first_execution_ = + param.is_first_reconcile == IsFirstReconcile::kFirst ? true : false; + reconcilor->StartReconcile(AccountReconcilor::Trigger::kCookieChange); + if (param.gaia_api_calls[0] != '\0') { + if (should_logout) { + SimulateLogOutFromCookieCompleted( + reconcilor, GoogleServiceAuthError::AuthErrorNone()); + } else { + SimulateSetAccountsInCookieCompleted( + reconcilor, signin::SetAccountsInCookieResult::kSuccess); + } + } + + ASSERT_FALSE(reconcilor->is_reconcile_started_); + if (param.tokens == param.tokens_after_reconcile) { + EXPECT_EQ(signin_metrics::ACCOUNT_RECONCILOR_OK, reconcilor->GetState()); + } else { + // If the tokens were changed by the reconcile, a new reconcile should be + // scheduled. + EXPECT_EQ(signin_metrics::ACCOUNT_RECONCILOR_SCHEDULED, + reconcilor->GetState()); + } + VerifyCurrentTokens(ParseTokenString(param.tokens_after_reconcile)); + + std::vector<Cookie> cookies_after = + ParseCookieString(param.cookies_after_reconcile); + EXPECT_EQ(cookies_after, cookies_after_reconcile); + + testing::Mock::VerifyAndClearExpectations(GetMockReconcilor()); + + // Another reconcile is sometimes triggered if Chrome accounts have + // changed. Allow it to finish. + EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(testing::_)) + .WillRepeatedly(testing::Return()); + ConfigureCookieManagerService({}); + base::RunLoop().RunUntilIdle(); } std::map<char, Account> accounts_; @@ -665,37 +792,6 @@ #if BUILDFLAG(ENABLE_DICE_SUPPORT) -namespace { -std::vector<Cookie> FakeSetAccountsInCookie( - const signin::MultiloginParameters& parameters, - const std::vector<Cookie>& cookies_before_reconcile) { - std::vector<Cookie> cookies_after_reconcile; - if (parameters.mode == - gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER) { - for (const CoreAccountId& account : parameters.accounts_to_send) { - cookies_after_reconcile.push_back({account.ToString(), true}); - } - } else { - std::vector<CoreAccountId> accounts(parameters.accounts_to_send.begin(), - parameters.accounts_to_send.end()); - cookies_after_reconcile = cookies_before_reconcile; - for (Cookie& param : cookies_after_reconcile) { - CoreAccountId account = CoreAccountId(param.gaia_id); - if (base::Contains(accounts, account)) { - param.is_valid = true; - accounts.erase(std::find(accounts.begin(), accounts.end(), account)); - } else { - DCHECK(!param.is_valid); - } - } - for (const CoreAccountId& account : accounts) { - cookies_after_reconcile.push_back({account.ToString(), true}); - } - } - return cookies_after_reconcile; -} -} // namespace - // clang-format off const std::vector<AccountReconcilorTestTableParam> kDiceParams = { // This table encodes the initial state and expectations of a reconcile. @@ -716,162 +812,163 @@ // x: The next cookie is marked "invalid". // - First Run: true if this is the first reconcile (i.e. Chrome startup). // ------------------------------------------------------------------------- - // Tokens|Cookies|First Run|Gaia calls|Tokens aft.|Cookies aft.|AccountReconcilorDelegate::InconsistencyReason | + // Tokens|Cookies| First Run |Gaia calls|Tokens aft.|Cookies aft. // ------------------------------------------------------------------------- // First reconcile (Chrome restart): Rebuild the Gaia cookie to match the // tokens. Make the Sync account the default account in the Gaia cookie. // Sync enabled. - { "", "A", IsFirstReconcile::kBoth, "U", "", "", 3}, - { "*AB", "AB", IsFirstReconcile::kBoth, "", "*AB", "AB", 0}, - { "*A", "A", IsFirstReconcile::kBoth, "", "*A" , "A", 0}, - { "*A", "", IsFirstReconcile::kBoth, "PA", "*A" , "A", 1}, - { "*A", "B", IsFirstReconcile::kBoth, "UA", "*A" , "A", 1}, - { "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A" , "A", 5}, - { "*AB", "BA", IsFirstReconcile::kFirst, "UAB", "*AB", "AB", 7}, - { "*AB", "BA", IsFirstReconcile::kNotFirst,"", "*AB", "BA", 0}, + { "", "A", IsFirstReconcile::kBoth, "X", "", "" }, + { "*AB", "AB", IsFirstReconcile::kBoth, "", "*AB", "AB" }, + { "*A", "A", IsFirstReconcile::kBoth, "", "*A" , "A" }, + { "*A", "", IsFirstReconcile::kBoth, "PA", "*A" , "A" }, + { "*A", "B", IsFirstReconcile::kBoth, "UA", "*A" , "A" }, + { "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A" , "A" }, + { "*AB", "BA", IsFirstReconcile::kFirst, "UAB", "*AB", "AB" }, + { "*AB", "BA", IsFirstReconcile::kNotFirst, "", "*AB", "BA" }, - { "*AB", "A", IsFirstReconcile::kBoth, "PAB", "*AB", "AB", 4}, + { "*AB", "A", IsFirstReconcile::kBoth, "PAB", "*AB", "AB" }, - { "*AB", "B", IsFirstReconcile::kFirst, "UAB", "*AB", "AB", 1}, - { "*AB", "B", IsFirstReconcile::kNotFirst,"PBA", "*AB", "BA", 1}, + { "*AB", "B", IsFirstReconcile::kFirst, "UAB", "*AB", "AB" }, + { "*AB", "B", IsFirstReconcile::kNotFirst, "PBA", "*AB", "BA" }, - { "*AB", "", IsFirstReconcile::kBoth, "PAB", "*AB", "AB", 1}, + { "*AB", "", IsFirstReconcile::kBoth, "PAB", "*AB", "AB" }, // Sync enabled, token error on primary. - { "*xAB", "AB", IsFirstReconcile::kBoth, "U", "*xA", "", 2}, - { "*xAB", "BA", IsFirstReconcile::kBoth, "UB", "*xAB", "B", 2}, - { "*xAB", "A", IsFirstReconcile::kBoth, "U", "*xA", "", 2}, - { "*xAB", "B", IsFirstReconcile::kBoth, "", "*xAB", "B", 0}, - { "*xAB", "", IsFirstReconcile::kBoth, "PB", "*xAB", "B", 0}, + { "*xAB", "AB", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAB", "BA", IsFirstReconcile::kBoth, "UB", "*xAB", "B" }, + { "*xAB", "A", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAB", "B", IsFirstReconcile::kBoth, "", "*xAB", "B" }, + { "*xAB", "", IsFirstReconcile::kBoth, "PB", "*xAB", "B" }, // Sync enabled, token error on secondary. - { "*AxB", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A", 5}, - { "*AxB", "A", IsFirstReconcile::kBoth, "", "*A", "A", 0}, - { "*AxB", "", IsFirstReconcile::kBoth, "PA", "*A", "A", 1}, + { "*AxB", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A" }, + { "*AxB", "A", IsFirstReconcile::kBoth, "", "*A", "A" }, + { "*AxB", "", IsFirstReconcile::kBoth, "PA", "*A", "A" }, // The first account in cookies is swapped even when Chrome is running. - // The swap would happen at next startup anyway and doing it earlier avoids signing the user out. - { "*AxB", "BA", IsFirstReconcile::kBoth, "UA", "*A", "A", 5}, - { "*AxB", "B", IsFirstReconcile::kBoth, "UA", "*A", "A", 1}, + // The swap would happen at next startup anyway and doing it earlier avoids + // signing the user out. + { "*AxB", "BA", IsFirstReconcile::kBoth, "UA", "*A", "A" }, + { "*AxB", "B", IsFirstReconcile::kBoth, "UA", "*A", "A" }, // Sync enabled, token error on both accounts. - { "*xAxB", "AB", IsFirstReconcile::kBoth, "U", "*xA", "", 2}, - { "*xAxB", "BA", IsFirstReconcile::kBoth, "U", "*xA", "", 2}, - { "*xAxB", "A", IsFirstReconcile::kBoth, "U", "*xA", "", 2}, - { "*xAxB", "B", IsFirstReconcile::kBoth, "U", "*xA", "", 5}, - { "*xAxB", "", IsFirstReconcile::kBoth, "", "*xA", "", 0}, + { "*xAxB", "AB", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAxB", "BA", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAxB", "A", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAxB", "B", IsFirstReconcile::kBoth, "X", "*xA", "" }, + { "*xAxB", "", IsFirstReconcile::kBoth, "", "*xA", "" }, // Sync disabled. - { "AB", "AB", IsFirstReconcile::kBoth, "", "AB", "AB", 0}, - { "AB", "BA", IsFirstReconcile::kBoth, "", "AB", "BA", 0}, - { "AB", "A", IsFirstReconcile::kBoth, "PAB", "AB", "AB", 4}, - { "AB", "B", IsFirstReconcile::kBoth, "PBA", "AB", "BA", 4}, - { "AB", "", IsFirstReconcile::kBoth, "PAB", "AB", "AB", 0}, + { "AB", "AB", IsFirstReconcile::kBoth, "", "AB", "AB" }, + { "AB", "BA", IsFirstReconcile::kBoth, "", "AB", "BA" }, + { "AB", "A", IsFirstReconcile::kBoth, "PAB", "AB", "AB" }, + { "AB", "B", IsFirstReconcile::kBoth, "PBA", "AB", "BA" }, + { "AB", "", IsFirstReconcile::kBoth, "PAB", "AB", "AB" }, // Sync disabled, token error on first account. - { "xAB", "AB", IsFirstReconcile::kFirst, "UB", "B", "B", 3}, - { "xAB", "AB", IsFirstReconcile::kNotFirst, "U", "", "", 3}, + { "xAB", "AB", IsFirstReconcile::kFirst, "UB", "B", "B" }, + { "xAB", "AB", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "xAB", "BA", IsFirstReconcile::kBoth, "UB", "B", "B", 5}, + { "xAB", "BA", IsFirstReconcile::kBoth, "UB", "B", "B" }, - { "xAB", "A", IsFirstReconcile::kFirst, "UB", "B", "B", 3}, - { "xAB", "A", IsFirstReconcile::kNotFirst, "U", "", "", 3}, + { "xAB", "A", IsFirstReconcile::kFirst, "UB", "B", "B" }, + { "xAB", "A", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "xAB", "B", IsFirstReconcile::kBoth, "", "B", "B", 0}, + { "xAB", "B", IsFirstReconcile::kBoth, "", "B", "B" }, - { "xAB", "", IsFirstReconcile::kBoth, "PB", "B", "B", 0}, + { "xAB", "", IsFirstReconcile::kBoth, "PB", "B", "B" }, // Sync disabled, token error on second account - { "AxB", "AB", IsFirstReconcile::kBoth, "UA", "A", "A", 5}, + { "AxB", "AB", IsFirstReconcile::kBoth, "UA", "A", "A" }, - { "AxB", "BA", IsFirstReconcile::kFirst, "UA", "A", "A", 3}, - { "AxB", "BA", IsFirstReconcile::kNotFirst, "U", "", "", 3}, + { "AxB", "BA", IsFirstReconcile::kFirst, "UA", "A", "A" }, + { "AxB", "BA", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "AxB", "A", IsFirstReconcile::kBoth, "", "A", "A", 0}, + { "AxB", "A", IsFirstReconcile::kBoth, "", "A", "A" }, - { "AxB", "B", IsFirstReconcile::kFirst, "UA", "A", "A", 3}, - { "AxB", "B", IsFirstReconcile::kNotFirst, "U", "", "", 3}, + { "AxB", "B", IsFirstReconcile::kFirst, "UA", "A", "A" }, + { "AxB", "B", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "AxB", "", IsFirstReconcile::kBoth, "PA", "A", "A", 0}, + { "AxB", "", IsFirstReconcile::kBoth, "PA", "A", "A" }, // Sync disabled, token error on both accounts. - { "xAxB", "AB", IsFirstReconcile::kBoth, "U", "", "", 3}, - { "xAxB", "BA", IsFirstReconcile::kBoth, "U", "", "", 3}, - { "xAxB", "A", IsFirstReconcile::kBoth, "U", "", "", 3}, - { "xAxB", "B", IsFirstReconcile::kBoth, "U", "", "", 3}, - { "xAxB", "", IsFirstReconcile::kBoth, "", "", "", 0}, + { "xAxB", "AB", IsFirstReconcile::kBoth, "X", "", "" }, + { "xAxB", "BA", IsFirstReconcile::kBoth, "X", "", "" }, + { "xAxB", "A", IsFirstReconcile::kBoth, "X", "", "" }, + { "xAxB", "B", IsFirstReconcile::kBoth, "X", "", "" }, + { "xAxB", "", IsFirstReconcile::kBoth, "", "", "" }, // Account marked as invalid in cookies. // No difference between cookies and tokens, do not do do anything. // Do not logout. Regression tests for http://crbug.com/854799 - { "", "xA", IsFirstReconcile::kBoth, "", "", "xA", 0}, - { "", "xAxB", IsFirstReconcile::kBoth, "", "", "xAxB", 0}, - { "xA", "xA", IsFirstReconcile::kBoth, "", "", "xA", 0}, - { "xAB", "xAB", IsFirstReconcile::kBoth, "", "B", "xAB", 0}, - { "AxB", "AxC", IsFirstReconcile::kBoth, "", "A", "AxC", 0}, - { "B", "xAB", IsFirstReconcile::kBoth, "", "B", "xAB", 0}, - { "*xA", "xA", IsFirstReconcile::kBoth, "", "*xA", "xA", 0}, - { "*xA", "xB", IsFirstReconcile::kBoth, "", "*xA", "xB", 0}, - { "*xAB", "xAB", IsFirstReconcile::kBoth, "", "*xAB", "xAB", 0}, - { "*AxB", "xBA", IsFirstReconcile::kNotFirst, "", "*A", "xBA", 0}, + { "", "xA", IsFirstReconcile::kBoth, "", "", "xA" }, + { "", "xAxB", IsFirstReconcile::kBoth, "", "", "xAxB" }, + { "xA", "xA", IsFirstReconcile::kBoth, "", "", "xA" }, + { "xAB", "xAB", IsFirstReconcile::kBoth, "", "B", "xAB" }, + { "AxB", "AxC", IsFirstReconcile::kBoth, "", "A", "AxC" }, + { "B", "xAB", IsFirstReconcile::kBoth, "", "B", "xAB" }, + { "*xA", "xA", IsFirstReconcile::kBoth, "", "*xA", "xA" }, + { "*xA", "xB", IsFirstReconcile::kBoth, "", "*xA", "xB" }, + { "*xAB", "xAB", IsFirstReconcile::kBoth, "", "*xAB", "xAB" }, + { "*AxB", "xBA", IsFirstReconcile::kNotFirst, "", "*A", "xBA" }, // Appending a new cookie after the invalid one. - { "B", "xA", IsFirstReconcile::kBoth, "PB", "B", "xAB", 4}, - { "xAB", "xA", IsFirstReconcile::kBoth, "PB", "B", "xAB", 4}, + { "B", "xA", IsFirstReconcile::kBoth, "PB", "B", "xAB" }, + { "xAB", "xA", IsFirstReconcile::kBoth, "PB", "B", "xAB" }, // Refresh existing cookies. - { "AB", "xAB", IsFirstReconcile::kBoth, "PAB", "AB", "AB", 4}, - { "*AB", "xBxA", IsFirstReconcile::kNotFirst, "PBA", "*AB", "BA", 1}, + { "AB", "xAB", IsFirstReconcile::kBoth, "PAB", "AB", "AB" }, + { "*AB", "xBxA", IsFirstReconcile::kNotFirst, "PBA", "*AB", "BA" }, // Appending and invalidating cookies at the same time. - { "xAB", "xAC", IsFirstReconcile::kFirst, "UB", "B", "B", 6}, - { "xAB", "xAC", IsFirstReconcile::kNotFirst, "U", "", "", 6}, + { "xAB", "xAC", IsFirstReconcile::kFirst, "UB", "B", "B" }, + { "xAB", "xAC", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "xAB", "AxC", IsFirstReconcile::kFirst, "UB", "B", "B", 3}, - { "xAB", "AxC", IsFirstReconcile::kNotFirst, "U", "", "", 3}, + { "xAB", "AxC", IsFirstReconcile::kFirst, "UB", "B", "B" }, + { "xAB", "AxC", IsFirstReconcile::kNotFirst, "X", "", "" }, - { "*xAB", "xABC", IsFirstReconcile::kFirst, "UB", "*xAB", "B", 5}, - { "*xAB", "xABC", IsFirstReconcile::kNotFirst, "U", "*xA", "", 5}, + { "*xAB", "xABC", IsFirstReconcile::kFirst, "UB", "*xAB", "B" }, + { "*xAB", "xABC", IsFirstReconcile::kNotFirst, "X", "*xA", "" }, - { "xAB", "xABC", IsFirstReconcile::kFirst, "UB", "B", "B", 5}, - { "xAB", "xABC", IsFirstReconcile::kNotFirst, "U", "", "", 5}, + { "xAB", "xABC", IsFirstReconcile::kFirst, "UB", "B", "B" }, + { "xAB", "xABC", IsFirstReconcile::kNotFirst, "X", "", "" }, // Miscellaneous cases. // Check that unknown Gaia accounts are signed o. - { "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A", 5}, + { "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A" }, // Check that Gaia default account is kept in first position. - { "AB", "BC", IsFirstReconcile::kBoth, "UBA", "AB", "BA", 6}, + { "AB", "BC", IsFirstReconcile::kBoth, "UBA", "AB", "BA" }, // Check that Gaia cookie order is preserved for B. - { "*ABC", "CB", IsFirstReconcile::kFirst, "UABC", "*ABC", "ABC", 1}, + { "*ABC", "CB", IsFirstReconcile::kFirst, "UABC", "*ABC", "ABC" }, // TODO(https://crbug.com/1129931): Merge session should do XCB instead. - { "xABC", "ABC", IsFirstReconcile::kFirst, "UCB", "BC", "CB", 1}, + { "xABC", "ABC", IsFirstReconcile::kFirst, "UCB", "BC", "CB" }, // Check that order in the chrome_accounts is not important. - { "A*B", "", IsFirstReconcile::kBoth, "PBA", "A*B", "BA", 7}, - { "*xBA", "BA", IsFirstReconcile::kFirst, "U", "*xB", "", 2}, + { "A*B", "", IsFirstReconcile::kBoth, "PBA", "A*B", "BA" }, + { "*xBA", "BA", IsFirstReconcile::kFirst, "X", "*xB", "" }, // Required for idempotency check. - { "", "", IsFirstReconcile::kNotFirst, "", "", "", 0}, - { "", "xA", IsFirstReconcile::kNotFirst, "", "", "xA", 0}, - { "", "xB", IsFirstReconcile::kNotFirst, "", "", "xB", 0}, - { "", "xAxB", IsFirstReconcile::kNotFirst, "", "", "xAxB", 0}, - { "", "xBxA", IsFirstReconcile::kNotFirst, "", "", "xBxA", 0}, - { "*A", "A", IsFirstReconcile::kNotFirst, "", "*A", "A", 0}, - { "*A", "xBA", IsFirstReconcile::kNotFirst, "", "*A", "xBA", 0}, - { "*A", "AxB", IsFirstReconcile::kNotFirst, "", "*A", "AxB", 0}, - { "A", "A", IsFirstReconcile::kNotFirst, "", "A", "A", 0}, - { "A", "xBA", IsFirstReconcile::kNotFirst, "", "A", "xBA", 0}, - { "A", "AxB", IsFirstReconcile::kNotFirst, "", "A", "AxB", 0}, - { "B", "B", IsFirstReconcile::kNotFirst, "", "B", "B", 0}, - { "B", "xAB", IsFirstReconcile::kNotFirst, "", "B", "xAB", 0}, - { "B", "BxA", IsFirstReconcile::kNotFirst, "", "B", "BxA", 0}, - { "*xA", "", IsFirstReconcile::kNotFirst, "", "*xA", "", 0}, - { "*xA", "xAxB", IsFirstReconcile::kNotFirst, "", "*xA", "xAxB", 0}, - { "*xA", "xBxA", IsFirstReconcile::kNotFirst, "", "*xA", "xBxA", 0}, - { "*xA", "xA", IsFirstReconcile::kNotFirst, "", "*xA", "xA", 0}, - { "*xA", "xB", IsFirstReconcile::kNotFirst, "", "*xA", "xB", 0}, - { "*xAB", "B", IsFirstReconcile::kNotFirst, "", "*xAB", "B", 0}, - { "*xAB", "BxA", IsFirstReconcile::kNotFirst, "", "*xAB", "BxA", 0}, - { "*xAB", "xAB", IsFirstReconcile::kNotFirst, "", "*xAB", "xAB", 0}, - { "*xAB", "xABxC",IsFirstReconcile::kNotFirst, "", "*xAB", "xABxC", 0}, - { "*xB", "", IsFirstReconcile::kNotFirst, "", "*xB", "", 0}, - { "A*B", "BA", IsFirstReconcile::kNotFirst, "", "A*B", "BA", 0}, - { "A*B", "AB", IsFirstReconcile::kNotFirst, "", "A*B", "AB", 0}, - { "A", "AxC", IsFirstReconcile::kNotFirst, "", "A", "AxC", 0}, - { "AB", "BxCA", IsFirstReconcile::kNotFirst, "", "AB", "BxCA", 0}, - { "B", "xABxC",IsFirstReconcile::kNotFirst, "", "B", "xABxC", 0}, - { "B", "xAxCB",IsFirstReconcile::kNotFirst, "", "B", "xAxCB", 0}, - { "*ABC", "ACB", IsFirstReconcile::kNotFirst, "", "*ABC", "ACB", 0}, - { "*ABC", "ABC", IsFirstReconcile::kNotFirst, "", "*ABC", "ABC", 0}, - { "BC", "BC", IsFirstReconcile::kNotFirst, "", "BC", "BC", 0}, - { "BC", "CB", IsFirstReconcile::kNotFirst, "", "BC", "CB", 0}, + { "", "", IsFirstReconcile::kNotFirst, "", "", "" }, + { "", "xA", IsFirstReconcile::kNotFirst, "", "", "xA" }, + { "", "xB", IsFirstReconcile::kNotFirst, "", "", "xB" }, + { "", "xAxB", IsFirstReconcile::kNotFirst, "", "", "xAxB" }, + { "", "xBxA", IsFirstReconcile::kNotFirst, "", "", "xBxA" }, + { "*A", "A", IsFirstReconcile::kNotFirst, "", "*A", "A" }, + { "*A", "xBA", IsFirstReconcile::kNotFirst, "", "*A", "xBA" }, + { "*A", "AxB", IsFirstReconcile::kNotFirst, "", "*A", "AxB" }, + { "A", "A", IsFirstReconcile::kNotFirst, "", "A", "A" }, + { "A", "xBA", IsFirstReconcile::kNotFirst, "", "A", "xBA" }, + { "A", "AxB", IsFirstReconcile::kNotFirst, "", "A", "AxB" }, + { "B", "B", IsFirstReconcile::kNotFirst, "", "B", "B" }, + { "B", "xAB", IsFirstReconcile::kNotFirst, "", "B", "xAB" }, + { "B", "BxA", IsFirstReconcile::kNotFirst, "", "B", "BxA" }, + { "*xA", "", IsFirstReconcile::kNotFirst, "", "*xA", "" }, + { "*xA", "xAxB", IsFirstReconcile::kNotFirst, "", "*xA", "xAxB" }, + { "*xA", "xBxA", IsFirstReconcile::kNotFirst, "", "*xA", "xBxA" }, + { "*xA", "xA", IsFirstReconcile::kNotFirst, "", "*xA", "xA" }, + { "*xA", "xB", IsFirstReconcile::kNotFirst, "", "*xA", "xB" }, + { "*xAB", "B", IsFirstReconcile::kNotFirst, "", "*xAB", "B" }, + { "*xAB", "BxA", IsFirstReconcile::kNotFirst, "", "*xAB", "BxA" }, + { "*xAB", "xAB", IsFirstReconcile::kNotFirst, "", "*xAB", "xAB" }, + { "*xAB", "xABxC",IsFirstReconcile::kNotFirst, "", "*xAB", "xABxC" }, + { "*xB", "", IsFirstReconcile::kNotFirst, "", "*xB", "" }, + { "A*B", "BA", IsFirstReconcile::kNotFirst, "", "A*B", "BA" }, + { "A*B", "AB", IsFirstReconcile::kNotFirst, "", "A*B", "AB" }, + { "A", "AxC", IsFirstReconcile::kNotFirst, "", "A", "AxC" }, + { "AB", "BxCA", IsFirstReconcile::kNotFirst, "", "AB", "BxCA" }, + { "B", "xABxC",IsFirstReconcile::kNotFirst, "", "B", "xABxC" }, + { "B", "xAxCB",IsFirstReconcile::kNotFirst, "", "B", "xAxCB" }, + { "*ABC", "ACB", IsFirstReconcile::kNotFirst, "", "*ABC", "ACB" }, + { "*ABC", "ABC", IsFirstReconcile::kNotFirst, "", "*ABC", "ABC" }, + { "BC", "BC", IsFirstReconcile::kNotFirst, "", "BC", "BC" }, + { "BC", "CB", IsFirstReconcile::kNotFirst, "", "BC", "CB" }, }; // clang-format on @@ -890,90 +987,8 @@ // Checks one row of the kDiceParams table above. TEST_P(AccountReconcilorTestDiceMultilogin, TableRowTest) { SetAccountConsistency(signin::AccountConsistencyMethod::kDice); - CheckReconcileIdempotent(kDiceParams, GetParam()); - - // Setup cookies. - std::vector<Cookie> cookies = ParseCookieString(GetParam().cookies); - ConfigureCookieManagerService(cookies); - std::vector<Cookie> cookies_after_reconcile = cookies; - - // Call list accounts now so that the next call completes synchronously. - identity_test_env()->identity_manager()->GetAccountsInCookieJar(); - base::RunLoop().RunUntilIdle(); - - // Setup tokens. This triggers listing cookies so we need to setup cookies - // before that. - SetupTokens(GetParam().tokens); - - // Setup expectations. - testing::InSequence mock_sequence; - bool should_logout = false; - if (GetParam().gaia_api_calls[0] != '\0') { - gaia::MultiloginMode mode = - GetParam().gaia_api_calls[0] == 'U' - ? gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER - : gaia::MultiloginMode::MULTILOGIN_PRESERVE_COOKIE_ACCOUNTS_ORDER; - // Generate expected array of accounts in cookies and set fake gaia - // response. - std::vector<CoreAccountId> accounts_to_send; - for (int i = 1; GetParam().gaia_api_calls[i] != '\0'; ++i) { - accounts_to_send.push_back( - CoreAccountId(accounts_[GetParam().gaia_api_calls[i]].gaia_id)); - } - const signin::MultiloginParameters params(mode, accounts_to_send); - cookies_after_reconcile = FakeSetAccountsInCookie(params, cookies); - should_logout = - accounts_to_send.empty() && - (mode == gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER); - if (should_logout) { - EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) - .Times(1); - } else { - EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(params)) - .Times(1); - } - } - // Reconcile. - AccountReconcilor* reconcilor = GetMockReconcilor(); - ASSERT_TRUE(reconcilor); - ASSERT_TRUE(reconcilor->first_execution_); - reconcilor->first_execution_ = - GetParam().is_first_reconcile == IsFirstReconcile::kFirst ? true : false; - reconcilor->StartReconcile(AccountReconcilor::Trigger::kCookieChange); - if (GetParam().gaia_api_calls[0] != '\0') { - if (should_logout) { - SimulateLogOutFromCookieCompleted( - reconcilor, GoogleServiceAuthError::AuthErrorNone()); - } else { - SimulateSetAccountsInCookieCompleted( - reconcilor, signin::SetAccountsInCookieResult::kSuccess); - } - } - - ASSERT_FALSE(reconcilor->is_reconcile_started_); - if (GetParam().tokens == GetParam().tokens_after_reconcile) { - EXPECT_EQ(signin_metrics::ACCOUNT_RECONCILOR_OK, reconcilor->GetState()); - } else { - // If the tokens were changed by the reconcile, a new reconcile should be - // scheduled. - EXPECT_EQ(signin_metrics::ACCOUNT_RECONCILOR_SCHEDULED, - reconcilor->GetState()); - } - VerifyCurrentTokens(ParseTokenString(GetParam().tokens_after_reconcile)); - - std::vector<Cookie> cookies_after = - ParseCookieString(GetParam().cookies_after_reconcile); - EXPECT_EQ(cookies_after, cookies_after_reconcile); - - testing::Mock::VerifyAndClearExpectations(GetMockReconcilor()); - - // Another reconcile is sometimes triggered if Chrome accounts have - // changed. Allow it to finish. - EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(testing::_)) - .WillRepeatedly(testing::Return()); - ConfigureCookieManagerService({}); - base::RunLoop().RunUntilIdle(); + RunRowTest(GetParam()); } INSTANTIATE_TEST_SUITE_P( @@ -1291,39 +1306,40 @@ const std::vector<AccountReconcilorTestTableParam> kMirrorParams = { // This table encodes the initial state and expectations of a reconcile. // See kDiceParams for documentation of the syntax. -// ------------------------------------------------------------------------- -// Tokens | Cookies | First Run | Gaia calls | Tokens after | Cookies after -// ------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Tokens | Cookies | First Run |Gaia calls|Tokens after| Cookies after +// ----------------------------------------------------------------------------- // First reconcile (Chrome restart): Rebuild the Gaia cookie to match the // tokens. Make the Sync account the default account in the Gaia cookie. // Sync enabled. { "*AB", "AB", IsFirstReconcile::kBoth, "", "*AB", "AB"}, -{ "*AB", "BA", IsFirstReconcile::kBoth, "U", "*AB", "AB"}, -{ "*AB", "A", IsFirstReconcile::kBoth, "U", "*AB", "AB"}, -{ "*AB", "B", IsFirstReconcile::kBoth, "U", "*AB", "AB"}, -{ "*AB", "", IsFirstReconcile::kBoth, "U", "*AB", "AB"}, +{ "*AB", "BA", IsFirstReconcile::kBoth, "UAB", "*AB", "AB"}, +{ "*AB", "A", IsFirstReconcile::kBoth, "UAB", "*AB", "AB"}, +{ "*AB", "B", IsFirstReconcile::kBoth, "UAB", "*AB", "AB"}, +{ "*AB", "", IsFirstReconcile::kBoth, "UAB", "*AB", "AB"}, // Sync enabled, token error on primary. // Sync enabled, token error on secondary. -{ "*AxB", "AB", IsFirstReconcile::kBoth, "U", "*AxB", "A"}, -{ "*AxB", "BA", IsFirstReconcile::kBoth, "U", "*AxB", "A"}, -{ "*AxB", "A", IsFirstReconcile::kBoth, "", "*AxB", ""}, -{ "*AxB", "B", IsFirstReconcile::kBoth, "U", "*AxB", "A"}, -{ "*AxB", "", IsFirstReconcile::kBoth, "U", "*AxB", "A"}, +{ "*AxB", "AB", IsFirstReconcile::kBoth, "UA", "*AxB", "A"}, +{ "*AxB", "BA", IsFirstReconcile::kBoth, "UA", "*AxB", "A"}, +{ "*AxB", "A", IsFirstReconcile::kBoth, "", "*AxB", "A"}, +{ "*AxB", "B", IsFirstReconcile::kBoth, "UA", "*AxB", "A"}, +{ "*AxB", "", IsFirstReconcile::kBoth, "UA", "*AxB", "A"}, // Cookies can be refreshed in pace, without logout. -{ "*AB", "xBxA", IsFirstReconcile::kBoth, "U", "*AB", "AB"}, +{ "*AB", "xBxA", IsFirstReconcile::kBoth, "UAB", "*AB", "AB"}, // Check that unknown Gaia accounts are signed out. -{ "*A", "AB", IsFirstReconcile::kBoth, "U", "*A", "A"}, +{ "*A", "AB", IsFirstReconcile::kBoth, "UA", "*A", "A"}, // Check that the previous case is idempotent. -{ "*A", "A", IsFirstReconcile::kBoth, "", "*A", ""}, +{ "*A", "A", IsFirstReconcile::kBoth, "", "*A", "A"}, // On Lacros, the reconcilor is enabled even if there is no account, or if the // primary account is in error. #if BUILDFLAG(IS_CHROMEOS_LACROS) { "", "", IsFirstReconcile::kBoth, "", "", ""}, { "*xA", "", IsFirstReconcile::kBoth, "", "*xA", ""}, +{ "*xAB", "", IsFirstReconcile::kBoth, "", "*xAB", ""}, { "", "A", IsFirstReconcile::kBoth, "X", "", ""}, { "*xA", "A", IsFirstReconcile::kBoth, "X", "*xA", ""}, { "*xAB", "AB", IsFirstReconcile::kBoth, "X", "*xAB", ""}, @@ -1344,86 +1360,12 @@ const AccountReconcilorTestMirrorMultilogin&) = delete; }; -// Checks one row of the kDiceParams table above. +// Checks one row of the kMirrorParams table above. TEST_P(AccountReconcilorTestMirrorMultilogin, TableRowTest) { // Enable Mirror. SetAccountConsistency(signin::AccountConsistencyMethod::kMirror); - - // Setup cookies. - std::vector<Cookie> cookies = ParseCookieString(GetParam().cookies); - ConfigureCookieManagerService(cookies); - - // Call list accounts now so that the next call completes synchronously. - identity_test_env()->identity_manager()->GetAccountsInCookieJar(); - base::RunLoop().RunUntilIdle(); - - // Setup tokens. - SetupTokens(GetParam().tokens); - - // Setup expectations. - testing::InSequence mock_sequence; - bool logout_action = false; - for (int i = 0; GetParam().gaia_api_calls[i] != '\0'; ++i) { - if (GetParam().gaia_api_calls[i] == 'X') { - logout_action = true; - EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) - .Times(1); - cookies.clear(); - continue; - } - if (GetParam().gaia_api_calls[i] == 'U') { - std::vector<CoreAccountId> accounts_to_send; - for (int j = 0; GetParam().cookies_after_reconcile[j] != '\0'; ++j) { - char cookie = GetParam().cookies_after_reconcile[j]; - std::string account_to_send = GaiaIdForAccountKey(cookie); - accounts_to_send.push_back(PickAccountIdForAccount( - account_to_send, - accounts_[GetParam().cookies_after_reconcile[j]].email)); - } - const signin::MultiloginParameters ml_params( - gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER, - accounts_to_send); - EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(ml_params)) - .Times(1); - } - } - if (!logout_action) { - EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) - .Times(0); - } - - // Reconcile. - AccountReconcilor* reconcilor = GetMockReconcilor(); - ASSERT_TRUE(reconcilor); - ASSERT_TRUE(reconcilor->first_execution_); - reconcilor->first_execution_ = - GetParam().is_first_reconcile == IsFirstReconcile::kFirst ? true : false; - reconcilor->StartReconcile(AccountReconcilor::Trigger::kCookieChange); - - if (GetParam().gaia_api_calls[0] != '\0') { - if (logout_action) { - SimulateLogOutFromCookieCompleted( - reconcilor, GoogleServiceAuthError::AuthErrorNone()); - } else { - SimulateSetAccountsInCookieCompleted( - reconcilor, signin::SetAccountsInCookieResult::kSuccess); - } - } - - ASSERT_FALSE(reconcilor->is_reconcile_started_); - ASSERT_EQ(signin_metrics::ACCOUNT_RECONCILOR_OK, reconcilor->GetState()); - VerifyCurrentTokens(ParseTokenString(GetParam().tokens_after_reconcile)); - - testing::Mock::VerifyAndClearExpectations(GetMockReconcilor()); - - // Another reconcile is sometimes triggered if Chrome accounts have - // changed. Allow it to finish. - EXPECT_CALL(*GetMockReconcilor(), PerformSetCookiesAction(testing::_)) - .WillRepeatedly(testing::Return()); - EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()) - .WillRepeatedly(testing::Return()); - ConfigureCookieManagerService({}); - base::RunLoop().RunUntilIdle(); + CheckReconcileIdempotent(kMirrorParams, GetParam()); + RunRowTest(GetParam()); } INSTANTIATE_TEST_SUITE_P( @@ -1445,6 +1387,12 @@ SetAccountConsistency(signin::AccountConsistencyMethod::kMirror); } + void CreateReconclior() override { + DeleteReconcilor(); + CreateMockReconcilor( + std::make_unique<signin::ActiveDirectoryAccountReconcilorDelegate>()); + } + private: ash::ScopedStubInstallAttributes install_attributes_{ ash::StubInstallAttributes::CreateActiveDirectoryManaged("realm.com", @@ -1455,103 +1403,37 @@ const std::vector<AccountReconcilorTestTableParam> kActiveDirectoryParams = { // This table encodes the initial state and expectations of a reconcile. // See kDiceParams for documentation of the syntax. -// ------------------------------------------------------------------------- -// Tokens |Cookies |First Run |Gaia calls|Tokens aft.|Cookies aft | -// ------------------------------------------------------------------------- -{ "ABC", "ABC", IsFirstReconcile::kBoth, "" , "ABC", "ABC" }, -{ "ABC", "", IsFirstReconcile::kBoth, "U", "ABC", "ABC" }, -{ "", "ABC", IsFirstReconcile::kBoth, "X", "", "", }, +// ----------------------------------------------------------------------------- +// Tokens |Cookies |First Run |Gaia calls|Tokens aft.|Cookies aft | +// ----------------------------------------------------------------------------- +{ "ABC", "ABC", IsFirstReconcile::kBoth, "" , "ABC", "ABC" }, +{ "ABC", "", IsFirstReconcile::kBoth, "UABC", "ABC", "ABC" }, +{ "", "ABC", IsFirstReconcile::kBoth, "X", "", "" }, +{ "", "", IsFirstReconcile::kBoth, "", "", "" }, // Order of Gaia accounts can be different from chrome accounts. -{ "ABC", "CBA", IsFirstReconcile::kBoth, "" , "ABC", "CBA" }, -{ "ABC", "CB", IsFirstReconcile::kBoth, "U", "ABC", "CBA" }, +{ "ABC", "CBA", IsFirstReconcile::kBoth, "" , "ABC", "CBA" }, +{ "ABC", "CB", IsFirstReconcile::kBoth, "UCBA", "ABC", "CBA" }, // Gaia accounts which are not present in chrome accounts should be removed. In // this case Gaia accounts are going to be in the same order as chrome accounts. -// this case Gaia accounts are going to be in thcousame order as chromcnts. -{ "A", "AB", IsFirstReconcile::kBoth, "U", "A", "A" }, -{ "AB", "CBA", IsFirstReconcile::kBoth, "U", "AB", "AB" }, -{ "AB", "C", IsFirstReconcile::kBoth, "U", "AB", "AB" }, +{ "A", "AB", IsFirstReconcile::kBoth, "UA", "A", "A" }, +{ "AB", "CBA", IsFirstReconcile::kBoth, "UAB", "AB", "AB" }, +{ "AB", "C", IsFirstReconcile::kBoth, "UAB", "AB", "AB" }, // Cookies can be refreshed in pace, without logout. -{ "AB", "xAxB", IsFirstReconcile::kBoth, "U", "AB", "AB" }, +{ "AB", "xAxB", IsFirstReconcile::kBoth, "UAB", "AB", "AB" }, // Token error on the account - remove it from cookies -{ "AxB", "AB", IsFirstReconcile::kBoth, "U", "AxB", "A" }, -{ "xAxB", "AB", IsFirstReconcile::kBoth, "X", "xAxB", "" }, +{ "AxB", "AB", IsFirstReconcile::kBoth, "UA", "AxB", "A" }, +{ "xAxB", "AB", IsFirstReconcile::kBoth, "X", "xAxB", "" }, +// For idempotency checks. +{ "A", "A", IsFirstReconcile::kBoth, "", "A", "A" }, +{ "AB", "AB", IsFirstReconcile::kBoth, "", "AB", "AB" }, +{ "AxB", "A", IsFirstReconcile::kBoth, "", "AxB", "A" }, +{ "xAxB", "", IsFirstReconcile::kBoth, "", "xAxB", "" }, }; // clang-format on TEST_P(AccountReconcilorTestActiveDirectory, TableRowTestMultilogin) { - // Setup cookies. - std::vector<Cookie> cookies = ParseCookieString(GetParam().cookies); - ConfigureCookieManagerService(cookies); - - // Call list accounts now so that the next call completes synchronously. - identity_test_env()->identity_manager()->GetAccountsInCookieJar(); - base::RunLoop().RunUntilIdle(); - - // Setup tokens. - std::vector<Token> tokens = ParseTokenString(GetParam().tokens); - SetupTokens(GetParam().tokens); - - testing::InSequence mock_sequence; - DeleteReconcilor(); - MockAccountReconcilor* reconcilor = CreateMockReconcilor( - std::make_unique<signin::ActiveDirectoryAccountReconcilorDelegate>()); - - // Setup expectations. - bool should_logout; - if (GetParam().gaia_api_calls[0] != '\0') { - if (GetParam().gaia_api_calls[0] == 'X') { - should_logout = true; - EXPECT_CALL(*reconcilor, PerformLogoutAllAccountsAction()).Times(1); - EXPECT_CALL(*reconcilor, PerformSetCookiesAction(_)).Times(0); - cookies.clear(); - } else if (GetParam().gaia_api_calls[0] == 'U') { - should_logout = false; - std::vector<CoreAccountId> accounts_to_send; - for (int i = 0; GetParam().cookies_after_reconcile[i] != '\0'; ++i) { - char cookie = GetParam().cookies_after_reconcile[i]; - std::string account_to_send = GaiaIdForAccountKey(cookie); - accounts_to_send.push_back(PickAccountIdForAccount( - account_to_send, - accounts_[GetParam().cookies_after_reconcile[i]].email)); - } - const signin::MultiloginParameters params( - gaia::MultiloginMode::MULTILOGIN_UPDATE_COOKIE_ACCOUNTS_ORDER, - accounts_to_send); - EXPECT_CALL(*reconcilor, PerformSetCookiesAction(params)).Times(1); - EXPECT_CALL(*reconcilor, PerformLogoutAllAccountsAction()).Times(0); - } - } - - // Reconcile. - ASSERT_TRUE(reconcilor); - ASSERT_TRUE(reconcilor->first_execution_); - reconcilor->first_execution_ = - GetParam().is_first_reconcile == IsFirstReconcile::kFirst ? true : false; - reconcilor->StartReconcile(AccountReconcilor::Trigger::kCookieChange); - if (GetParam().gaia_api_calls[0] != '\0') { - if (should_logout) { - SimulateLogOutFromCookieCompleted( - reconcilor, GoogleServiceAuthError::AuthErrorNone()); - } else { - SimulateSetAccountsInCookieCompleted( - reconcilor, signin::SetAccountsInCookieResult::kSuccess); - } - } - - ASSERT_FALSE(reconcilor->is_reconcile_started_); - ASSERT_EQ(signin_metrics::ACCOUNT_RECONCILOR_OK, reconcilor->GetState()); - VerifyCurrentTokens(ParseTokenString(GetParam().tokens_after_reconcile)); - - testing::Mock::VerifyAndClearExpectations(reconcilor); - - // Another reconcile is sometimes triggered if Chrome accounts have - // changed. Allow it to finish. - EXPECT_CALL(*reconcilor, PerformSetCookiesAction(testing::_)) - .WillRepeatedly(testing::Return()); - EXPECT_CALL(*reconcilor, PerformLogoutAllAccountsAction()) - .WillRepeatedly(testing::Return()); - ConfigureCookieManagerService({}); - base::RunLoop().RunUntilIdle(); + CheckReconcileIdempotent(kActiveDirectoryParams, GetParam()); + RunRowTest(GetParam()); } INSTANTIATE_TEST_SUITE_P(
diff --git a/components/strings/components_strings_fa.xtb b/components/strings/components_strings_fa.xtb index c6194bd..199613a9 100644 --- a/components/strings/components_strings_fa.xtb +++ b/components/strings/components_strings_fa.xtb
@@ -1482,7 +1482,7 @@ <translation id="5029568752722684782">پاک کردن نسخه کپی</translation> <translation id="5030338702439866405">صدور توسط</translation> <translation id="503069730517007720">برای «<ph name="SOFTWARE_NAME" />» گواهینامه ریشه لازم است اما نصب نشده است. برای رفع این مشکل، سرپرست فناوری اطلاعات شما باید دستورالعملهای پیکربندی مربوط به «<ph name="SOFTWARE_NAME" />» را بررسی کند. <ph name="FURTHER_EXPLANATION" /></translation> -<translation id="5031870354684148875">درباره ترجمه Google</translation> +<translation id="5031870354684148875">درباره «ترجمه Google»</translation> <translation id="503498442187459473"><ph name="HOST" /> میخواهد از دوربین و میکروفن شما استفاده کند</translation> <translation id="5035135400558156732">باغبانی</translation> <translation id="5039762155821394373">اندازه قلم</translation>
diff --git a/components/strings/components_strings_km.xtb b/components/strings/components_strings_km.xtb index fed2589..6db5586 100644 --- a/components/strings/components_strings_km.xtb +++ b/components/strings/components_strings_km.xtb
@@ -834,6 +834,7 @@ <translation id="3226387218769101247">រូបភាពតូចៗ</translation> <translation id="3227137524299004712">ម៉ៃក្រូហ្វូន</translation> <translation id="3229041911291329567">ព័ត៌មានកំណែអំពីឧបករណ៍ និងកម្មវិធីរុករកតាមអ៊ីនធឺណិតរបស់អ្នក</translation> +<translation id="3229277193950731405">ចម្លងជួរអក្សរកំណែ</translation> <translation id="323107829343500871">បញ្ចូល CVC សម្រាប់ <ph name="CREDIT_CARD" /></translation> <translation id="3234666976984236645">តែងតែចាប់យកមាតិកាសំខាន់ជានិច្ចនៅលើគេហទំព័រនេះ</translation> <translation id="3240683217920639535"><ph name="MANAGE_CHROME_THEMES_FOCUSED_FRIENDLY_MATCH_TEXT" />, ចុច tab រួចចុច Enter ដើម្បីប្ដូររូបរាងនៃកម្មវិធីរុករកតាមអ៊ីនធឺណិតរបស់អ្នកតាមបំណង</translation>
diff --git a/components/strings/components_strings_uz.xtb b/components/strings/components_strings_uz.xtb index 6b6e3ea..bb19f92 100644 --- a/components/strings/components_strings_uz.xtb +++ b/components/strings/components_strings_uz.xtb
@@ -828,6 +828,7 @@ <translation id="3226387218769101247">Eskizlar</translation> <translation id="3227137524299004712">Mikrofon</translation> <translation id="3229041911291329567">Qurilma va brauzer versiyalari axboroti</translation> +<translation id="3229277193950731405">Versiya qatorini nusxalash</translation> <translation id="323107829343500871"><ph name="CREDIT_CARD" /> kartasining CVC kodini kiriting</translation> <translation id="3234666976984236645">Bu saytda har doim muhim kontent aniqlansin</translation> <translation id="3240683217920639535"><ph name="MANAGE_CHROME_THEMES_FOCUSED_FRIENDLY_MATCH_TEXT" />, Brauzeringiz koʻrinishini moslash uchun avval Tab, keyin Enter tugmasini bosing</translation>
diff --git a/components/sync/engine/nigori/nigori_unittest.cc b/components/sync/engine/nigori/nigori_unittest.cc index 7222a68..ec9caa5 100644 --- a/components/sync/engine/nigori/nigori_unittest.cc +++ b/components/sync/engine/nigori/nigori_unittest.cc
@@ -51,11 +51,11 @@ ASSERT_THAT(nigori, NotNull()); std::string permuted; - EXPECT_TRUE(nigori->Permute(Nigori::Password, "test name", &permuted)); + EXPECT_TRUE(nigori->Permute(Nigori::Password, kNigoriKeyName, &permuted)); std::string expected = - "evpwwPT726JS/mhxv1UwPVLDz5ha/GrMA8HfA3sQGJr5" - "5zFtrFep7DXu9FIyGbBEdlHNWtwVlPVE5FEgyoV++w=="; + "ibGL7ymU0Si+eYCXGS6SBHPFT+JCYiB6GDOYqj6vIwEi" + "WJ7RENSHxmIQ8Q3rXd/UnZUmFHYB+jSIbthQADXvrQ=="; EXPECT_EQ(expected, permuted); } @@ -65,14 +65,14 @@ ASSERT_THAT(nigori1, NotNull()); std::string permuted1; - EXPECT_TRUE(nigori1->Permute(Nigori::Password, "name", &permuted1)); + EXPECT_TRUE(nigori1->Permute(Nigori::Password, kNigoriKeyName, &permuted1)); std::unique_ptr<Nigori> nigori2 = Nigori::CreateByDerivation( KeyDerivationParams::CreateForPbkdf2(), "password"); ASSERT_THAT(nigori2, NotNull()); std::string permuted2; - EXPECT_TRUE(nigori2->Permute(Nigori::Password, "name", &permuted2)); + EXPECT_TRUE(nigori2->Permute(Nigori::Password, kNigoriKeyName, &permuted2)); EXPECT_LT(0U, permuted1.size()); EXPECT_EQ(permuted1, permuted2); @@ -208,8 +208,8 @@ EXPECT_EQ(original, plaintext); std::string permuted1, permuted2; - EXPECT_TRUE(nigori1->Permute(Nigori::Password, original, &permuted1)); - EXPECT_TRUE(nigori2->Permute(Nigori::Password, original, &permuted2)); + EXPECT_TRUE(nigori1->Permute(Nigori::Password, kNigoriKeyName, &permuted1)); + EXPECT_TRUE(nigori2->Permute(Nigori::Password, kNigoriKeyName, &permuted2)); EXPECT_EQ(permuted1, permuted2); }
diff --git a/components/test/data/screen_ai/sample_01_ax_tree.json b/components/test/data/screen_ai/sample_01_ax_tree.json index 0c86506..7e10126 100644 --- a/components/test/data/screen_ai/sample_01_ax_tree.json +++ b/components/test/data/screen_ai/sample_01_ax_tree.json
@@ -64,7 +64,14 @@ }, "name": "UK government sets out plans to rein in Big Tech - BBC News", "interesting": true, - "extras": {}, + "extras": { + "bounds": [ + 0, + 0, + 1440, + 10380 + ] + }, "backendDomId": 2, "children": [ {
diff --git a/content/test/data/gpu/vc/README.md b/content/test/data/gpu/vc/README.md index 6a0e594..f005a7d 100644 --- a/content/test/data/gpu/vc/README.md +++ b/content/test/data/gpu/vc/README.md
@@ -67,6 +67,17 @@ webgpu_videos_mxn.html?fps=none ``` +To use largest video only. Use `use_large_size_video=1` +``` +webgpu_videos_mxn.html?use_large_size_video=1 +``` + +To disable the 30fps cap in the sample. Use `cap_ui_fps=0` +``` + +webgpu_videos_mxn.html?cap_ui_fps=0 +``` + For webgpu_videos_mxn.html only: To disable Import Texture API and force the video texture copy through createImageBitmap() and then copyExternalImageToTexture(), @@ -75,6 +86,13 @@ webgpu_videos_mxn.html?import_texture_api=0 ``` +To disable using onSubmittedWorkDone to workaround webgpu +backpressure issue(may hurt performance). Use `back_pressure_workaround=0` +``` + +webgpu_videos_mxn.html?back_pressure_workaround=0 +``` + ## Video Files
diff --git a/content/test/data/gpu/vc/video_utils.js b/content/test/data/gpu/vc/video_utils.js index d526ae1d..af5e9f7a 100644 --- a/content/test/data/gpu/vc/video_utils.js +++ b/content/test/data/gpu/vc/video_utils.js
@@ -14,10 +14,10 @@ return pairs; })(window.location.search.substr(1).split('&')); -function GetVideoSource(videoCount, index, codec) { +function GetVideoSource(videoCount, index, codec, useLargeSizeVideo = false) { switch (codec) { case 'vp8': - if (videoCount <= 4) { + if (videoCount <= 4 || useLargeSizeVideo) { return './teddy1_vp8_640x360_30fps.webm'; } else { if (index < 4) @@ -31,7 +31,7 @@ case 'vp9': default: - if (videoCount <= 4) { + if (videoCount <= 4 || useLargeSizeVideo) { return './teddy1_vp9_640x360_30fps.webm'; } else { if (index < 4) @@ -185,7 +185,7 @@ const bar_count = 10; for (let i = 0; i < bar_count; ++i) { const array_index = i * 12; - const hBar = (i+1) * delta; + const hBar = (i + 1) * delta; const yBar = y - hIcon * 2 + hBar; rectVerts.set([
diff --git a/content/test/data/gpu/vc/webgl_video.js b/content/test/data/gpu/vc/webgl_video.js index 3a4c9327..e6d111d6 100644 --- a/content/test/data/gpu/vc/webgl_video.js +++ b/content/test/data/gpu/vc/webgl_video.js
@@ -158,8 +158,7 @@ gl.enableVertexAttribArray(pos); } -function createVertexBufferForAnimation( - gl, videos, videoRows, videoColumns) { +function createVertexBufferForAnimation(gl, videos, videoRows, videoColumns) { const rectVerts = getArrayForAnimationVertexBuffer(videos, videoRows, videoColumns); const verticesBuffer = gl.createBuffer(); @@ -248,8 +247,8 @@ } } -function webglDrawVideoFrames(gl, videos, videoRows, videoColumns, - addUI, addFPS) { +function webglDrawVideoFrames( + gl, videos, videoRows, videoColumns, addUI, addFPS, capUIFPS) { initializePrograms(gl); initializeVideoTextures(gl, videos.length); if (addFPS) { @@ -283,12 +282,14 @@ const oneFrame = () => { const timestamp = performance.now(); - const elapsed = timestamp - lastTimestamp; - if (elapsed < kFrameTime30Fps) { - window.requestAnimationFrame(oneFrame); - return; + if (capUIFPS) { + const elapsed = timestamp - lastTimestamp; + if (elapsed < kFrameTime30Fps) { + window.requestAnimationFrame(oneFrame); + return; + } + lastTimestamp = timestamp; } - lastTimestamp = timestamp; uiFrames++;
diff --git a/content/test/data/gpu/vc/webgl_videos_mxn.html b/content/test/data/gpu/vc/webgl_videos_mxn.html index 38c0b7d5..ca4c4d9 100644 --- a/content/test/data/gpu/vc/webgl_videos_mxn.html +++ b/content/test/data/gpu/vc/webgl_videos_mxn.html
@@ -4,6 +4,7 @@ found in the LICENSE file. --> <html> + <head> <title>WebGL MxN Video playbacks</title> <style> @@ -25,6 +26,8 @@ const _totalVideoHeight = 900; var hasUIOnTop = true; var hasFPSOnTop = true; + var capUIFPS = true; + var useLargeSizeVideo = false; var codec = 'vp9'; async function startMxNVideos() { @@ -54,6 +57,18 @@ else if (codecString != 'vp9' && codecString != undefined) console.warn('Unsupported video codec format! Switch to default VP9.'); + const capFPSOption = parsedString['cap_ui_fps'] + if (capFPSOption == '0') + capUIFPS = false; + else if (capFPSOption == '1') + capUIFPS = true; + + const useLargeSizeVideoOption = parsedString['use_large_size_video'] + if (useLargeSizeVideoOption == '0') + useLargeSizeVideo = false; + else if (useLargeSizeVideoOption == '1') + useLargeSizeVideo = true; + // Get the number of video rows and columns from the string. var videoRows = parsedString['rows']; var videoColumns = parsedString['columns']; @@ -87,7 +102,7 @@ video.autoplay = true; video.muted = true; video.display = "none"; - video.src = GetVideoSource(videoCount, i, codec); + video.src = GetVideoSource(videoCount, i, codec, useLargeSizeVideo); video.width = videoWidth; video.height = videoHeight; video.crossorigin = "anonymous"; @@ -104,14 +119,16 @@ // Simulate video playback by WebGL rendering. webglDrawVideoFrames(gl, videos, videoRows, videoColumns, - hasUIOnTop , hasFPSOnTop); + hasUIOnTop, hasFPSOnTop, capUIFPS); } </script> </head> + <body onload="startMxNVideos()"> <div id="container" style="position:absolute; top:0px; left:0px"> <p id="message"></p> </div> </body> -</html> + +</html> \ No newline at end of file
diff --git a/content/test/data/gpu/vc/webgpu_video.js b/content/test/data/gpu/vc/webgpu_video.js index 0a7b35c9..dea2407 100644 --- a/content/test/data/gpu/vc/webgpu_video.js +++ b/content/test/data/gpu/vc/webgpu_video.js
@@ -127,7 +127,7 @@ } function createVertexBufferForAnimation( - device, videos, videoRows, videoColumns) { + device, videos, videoRows, videoColumns) { const rectVerts = getArrayForAnimationVertexBuffer(videos, videoRows, videoColumns); const verticesBuffer = device.createBuffer({ @@ -156,8 +156,9 @@ return verticesBuffer; } -function webGpuDrawVideoFrames(gpuSetting, videos, videoRows, videoColumns, - addUI, addFPS, useImportTextureApi) { +function webGpuDrawVideoFrames( + gpuSetting, videos, videoRows, videoColumns, addUI, addFPS, + useImportTextureApi, capUIFPS, enableBackPressureWorkaround) { initializeFPSPanels(); const {adapter, device, context, canvas} = gpuSetting; @@ -316,8 +317,7 @@ // For rendering the voice bar animation const vertexBufferForAnimation = - createVertexBufferForAnimation( - device, videos, videoRows, videoColumns); + createVertexBufferForAnimation(device, videos, videoRows, videoColumns); renderPipelineDescriptorForIcon.fragment.module = device.createShaderModule({ code: wgslShaders.fragment_output_white, @@ -429,25 +429,25 @@ passEncoder.draw(/*vertexCount=*/ 8, 1, /*firstVertex=*/ 60); } - function addFPSCommands(device, passEncoder) { + function addFPSCommands(device, passEncoder) { // FPS Panels - passEncoder.setPipeline(pipelineForFPS); - passEncoder.setVertexBuffer(0, vertexBufferForFPS); - for (let i = 0; i < fpsPanels.length; ++i) { - device.queue.copyExternalImageToTexture( - { source: fpsPanels[i].dom, origin: { x: 0, y: 0 }}, - { texture: fpsTextures[i] }, - { - width: fpsPanels[i].dom.width, - height: fpsPanels[i].dom.height, - depthOrArrayLayers: 1 - }, - ); - const firstVertex = i * 6; - passEncoder.setBindGroup(0, fpsBindGroups[i]); - passEncoder.draw(6, 1, firstVertex, 0); - } - } + passEncoder.setPipeline(pipelineForFPS); + passEncoder.setVertexBuffer(0, vertexBufferForFPS); + for (let i = 0; i < fpsPanels.length; ++i) { + device.queue.copyExternalImageToTexture( + {source: fpsPanels[i].dom, origin: {x: 0, y: 0}}, + {texture: fpsTextures[i]}, + { + width: fpsPanels[i].dom.width, + height: fpsPanels[i].dom.height, + depthOrArrayLayers: 1 + }, + ); + const firstVertex = i * 6; + passEncoder.setBindGroup(0, fpsBindGroups[i]); + passEncoder.draw(6, 1, firstVertex, 0); + } + } // videos #0-#3 : 30 fps. // videos #3-#15: 15 fps. @@ -472,13 +472,15 @@ let lastTimestamp = performance.now(); const oneFrame = () => { - const timestamp = performance.now(); - const elapsed = timestamp - lastTimestamp; - if (elapsed < kFrameTime30Fps) { - window.requestAnimationFrame(oneFrame); - return; + if (capUIFPS) { + const timestamp = performance.now(); + const elapsed = timestamp - lastTimestamp; + if (elapsed < kFrameTime30Fps) { + window.requestAnimationFrame(oneFrame); + return; + } + lastTimestamp = timestamp; } - lastTimestamp = timestamp; uiFrames++; @@ -532,21 +534,27 @@ // TODO(crbug.com/1289482): Workaround for backpressure mechanism // not working properly. - device.queue.onSubmittedWorkDone().then(() => { + if (enableBackPressureWorkaround) { + device.queue.onSubmittedWorkDone().then(() => { + window.requestAnimationFrame(oneFrame); + }); + } else { window.requestAnimationFrame(oneFrame); - }); + } }); }; const oneFrameWithImportTextureApi = () => { - // Target frame rate: 30 fps. rAF might run at 60 fps. + // Target frame rate: 30 fps when capUIFPS is true. rAF might run at 60 fps. const timestamp = performance.now(); - const elapsed = timestamp - lastTimestamp; - if (elapsed < kFrameTime30Fps) { - window.requestAnimationFrame(oneFrameWithImportTextureApi); - return; + if (capUIFPS) { + const elapsed = timestamp - lastTimestamp; + if (elapsed < kFrameTime30Fps) { + window.requestAnimationFrame(oneFrameWithImportTextureApi); + return; + } + lastTimestamp = timestamp; } - lastTimestamp = timestamp; uiFrames++; @@ -609,9 +617,13 @@ // TODO(crbug.com/1289482): Workaround for backpressure mechanism // not working properly. - device.queue.onSubmittedWorkDone().then(() => { + if (enableBackPressureWorkaround) { + device.queue.onSubmittedWorkDone().then(() => { + window.requestAnimationFrame(oneFrameWithImportTextureApi); + }); + } else { window.requestAnimationFrame(oneFrameWithImportTextureApi); - }); + } }; if (useImportTextureApi) {
diff --git a/content/test/data/gpu/vc/webgpu_videos_mxn.html b/content/test/data/gpu/vc/webgpu_videos_mxn.html index ba7b0a0..6d18cef 100644 --- a/content/test/data/gpu/vc/webgpu_videos_mxn.html +++ b/content/test/data/gpu/vc/webgpu_videos_mxn.html
@@ -4,6 +4,7 @@ found in the LICENSE file. --> <html> + <head> <title>WebGpu MxN Video playbacks</title> <style> @@ -26,6 +27,9 @@ var hasUIOnTop = true; var hasFPSOnTop = true; var useImportTextureApi = true; + var capUIFPS = true; + var useLargeSizeVideo = false; + var enableBackPressureWorkaround = true; var codec = 'vp9'; async function startMxNVideos() { @@ -63,6 +67,24 @@ else if (codecString != 'vp9' && codecString != undefined) console.warn('Unsupported video codec format! Switch to default VP9.'); + const capFPSOption = parsedString['cap_ui_fps'] + if (capFPSOption == '0') + capUIFPS = false; + else if (capFPSOption == '1') + capUIFPS = true; + + const useLargeSizeVideoOption = parsedString['use_large_size_video'] + if (useLargeSizeVideoOption == '0') + useLargeSizeVideo = false; + else if (useLargeSizeVideoOption == '1') + useLargeSizeVideo = true; + + const backPressureWorkaroundOption = parsedString['back_pressure_workaround'] + if (backPressureWorkaroundOption == '0') + enableBackPressureWorkaround = false; + else if (backPressureWorkaroundOption == '1') + enableBackPressureWorkaround = true; + // Get the number of video rows and columns from the string. var videoRows = parsedString['rows']; var videoColumns = parsedString['columns']; @@ -96,7 +118,7 @@ video.autoplay = true; video.muted = true; video.display = "none"; - video.src = GetVideoSource(videoCount, i, codec); + video.src = GetVideoSource(videoCount, i, codec, useLargeSizeVideo); video.width = videoWidth; video.height = videoHeight; video.crossorigin = "anonymous"; @@ -113,14 +135,16 @@ // Simulate video playback by WebGpu rendering. webGpuDrawVideoFrames(gpuSetting, videos, videoRows, videoColumns, - hasUIOnTop , hasFPSOnTop, useImportTextureApi); + hasUIOnTop, hasFPSOnTop, useImportTextureApi, capUIFPS, enableBackPressureWorkaround); } </script> </head> + <body onload="startMxNVideos()"> <div id="container" style="position:absolute; top:0px; left:0px"> <p id="message"></p> </div> </body> -</html> + +</html> \ No newline at end of file
diff --git a/docs/webui_in_chrome.md b/docs/webui_in_chrome.md index b65e8868..5b838397 100644 --- a/docs/webui_in_chrome.md +++ b/docs/webui_in_chrome.md
@@ -161,7 +161,8 @@ ] input_files_base_dir = rebase_path(".", "//") deps = [ ":build_ts" ] - manifest_files = [ "$target_gen_dir/$tsconfig.manifest" ] + # build_ts below must match the target name for the TS build stage. + manifest_files = [ "$target_gen_dir/build_ts.manifest" ] } grit("resources") {
diff --git a/extensions/browser/api/file_system/file_system_api.cc b/extensions/browser/api/file_system/file_system_api.cc index e27a7ae8..032672a 100644 --- a/extensions/browser/api/file_system/file_system_api.cc +++ b/extensions/browser/api/file_system/file_system_api.cc
@@ -1079,9 +1079,7 @@ DCHECK(delegate); // Only kiosk apps in kiosk sessions can use this API. // Additionally it is enabled for allowlisted component extensions and apps. - if (delegate->GetGrantVolumesMode(browser_context(), render_frame_host(), - *extension()) == - FileSystemDelegate::kGrantNone) { + if (!delegate->IsGrantable(browser_context(), *extension())) { return RespondNow(Error(kNotSupportedOnNonKioskSessionError)); } @@ -1118,14 +1116,12 @@ DCHECK(delegate); // Only kiosk apps in kiosk sessions can use this API. // Additionally it is enabled for allowlisted component extensions and apps. - if (delegate->GetGrantVolumesMode(browser_context(), render_frame_host(), - *extension()) == - FileSystemDelegate::kGrantNone) { + if (!delegate->IsGrantable(browser_context(), *extension())) { return RespondNow(Error(kNotSupportedOnNonKioskSessionError)); } delegate->GetVolumeList( - browser_context(), *extension(), + browser_context(), base::BindOnce(&FileSystemGetVolumeListFunction::OnGotVolumeList, this), base::BindOnce(&FileSystemGetVolumeListFunction::OnError, this));
diff --git a/extensions/browser/api/file_system/file_system_delegate.h b/extensions/browser/api/file_system/file_system_delegate.h index 820bcdc..e56a18b 100644 --- a/extensions/browser/api/file_system/file_system_delegate.h +++ b/extensions/browser/api/file_system/file_system_delegate.h
@@ -24,7 +24,6 @@ namespace content { class BrowserContext; -class RenderFrameHost; class WebContents; } // namespace content @@ -44,8 +43,6 @@ using VolumeListCallback = base::OnceCallback<void(const std::vector<api::file_system::Volume>&)>; - enum GrantVolumesMode { kGrantAll, kGrantNone, kGrantPerVolume }; - virtual ~FileSystemDelegate() {} virtual base::FilePath GetDefaultDirectory() = 0; @@ -82,10 +79,8 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) // Checks whether the extension can be granted access. - virtual GrantVolumesMode GetGrantVolumesMode( - content::BrowserContext* browser_context, - content::RenderFrameHost* render_frame_host, - const Extension& extension) = 0; + virtual bool IsGrantable(content::BrowserContext* browser_context, + const Extension& extension) = 0; // Grants or denies an extension's request for access to the named file // system. May prompt the user for consent. @@ -99,7 +94,6 @@ // Immediately calls VolumeListCallback or ErrorCallback. virtual void GetVolumeList(content::BrowserContext* browser_context, - const Extension& extension, VolumeListCallback success_callback, ErrorCallback error_callback) = 0; #endif
diff --git a/extensions/browser/api/networking_private/networking_private_chromeos.cc b/extensions/browser/api/networking_private/networking_private_chromeos.cc index 3f1cba1..f16e78c2 100644 --- a/extensions/browser/api/networking_private/networking_private_chromeos.cc +++ b/extensions/browser/api/networking_private/networking_private_chromeos.cc
@@ -14,14 +14,14 @@ #include "base/values.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_activation_handler.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/onc/onc_translator.h" #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "chromeos/components/onc/onc_signature.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_activation_handler.h" -#include "chromeos/network/network_certificate_handler.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h"
diff --git a/extensions/browser/api/networking_private/networking_private_chromeos_unittest.cc b/extensions/browser/api/networking_private/networking_private_chromeos_unittest.cc index 571309f6..bce26705 100644 --- a/extensions/browser/api/networking_private/networking_private_chromeos_unittest.cc +++ b/extensions/browser/api/networking_private/networking_private_chromeos_unittest.cc
@@ -12,12 +12,12 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_profile_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc b/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc index a8f1e0f..1d84883b 100644 --- a/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc +++ b/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc
@@ -6,9 +6,9 @@ #include "base/json/json_writer.h" #include "chromeos/ash/components/network/device_state.h" +#include "chromeos/ash/components/network/network_certificate_handler.h" #include "chromeos/ash/components/network/onc/onc_translator.h" #include "chromeos/components/onc/onc_signature.h" -#include "chromeos/network/network_certificate_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h"
diff --git a/extensions/common/mojom/api_permission_id.mojom b/extensions/common/mojom/api_permission_id.mojom index 18878c6..3d389ad 100644 --- a/extensions/common/mojom/api_permission_id.mojom +++ b/extensions/common/mojom/api_permission_id.mojom
@@ -236,7 +236,7 @@ kEnterpriseReportingPrivate = 210, kCecPrivate = 211, kSafeBrowsingPrivate = 212, - kFileSystemRequestDownloads = 213, + kDeleted_FileSystemRequestDownloads = 213, kDeleted_SystemPowerSource = 214, kArcAppsPrivate = 215, kEnterpriseHardwarePlatform = 216,
diff --git a/extensions/common/permissions/extensions_api_permissions.cc b/extensions/common/permissions/extensions_api_permissions.cc index 712fb2a8..fd4a35a 100644 --- a/extensions/common/permissions/extensions_api_permissions.cc +++ b/extensions/common/permissions/extensions_api_permissions.cc
@@ -87,8 +87,6 @@ "fileSystem.requestFileSystem"}, {APIPermissionID::kFileSystemRetainEntries, "fileSystem.retainEntries", APIPermissionInfo::kFlagDoesNotRequireManagedSessionFullLoginWarning}, - {APIPermissionID::kFileSystemRequestDownloads, - "fileSystem.requestDownloads"}, {APIPermissionID::kFileSystemWrite, "fileSystem.write", APIPermissionInfo::kFlagDoesNotRequireManagedSessionFullLoginWarning}, {APIPermissionID::kHid, "hid"},
diff --git a/extensions/shell/browser/shell_network_controller_chromeos.cc b/extensions/shell/browser/shell_network_controller_chromeos.cc index 06335a0..97067e29 100644 --- a/extensions/shell/browser/shell_network_controller_chromeos.cc +++ b/extensions/shell/browser/shell_network_controller_chromeos.cc
@@ -11,8 +11,8 @@ #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "base/values.h" -#include "chromeos/network/network_configuration_handler.h" -#include "chromeos/network/network_connection_handler.h" +#include "chromeos/ash/components/network/network_configuration_handler.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler_callbacks.h"
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index 1f74cd0..e696c43 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn
@@ -9,25 +9,20 @@ import("//third_party/protobuf/proto_library.gni") declare_args() { - # You can set the variable 'use_official_google_api_keys' to true + # Set the variable 'use_official_google_api_keys' to true # to use the Google-internal file containing official API keys - # for Google Chrome even in a developer build. Setting this - # variable explicitly to true will cause your build to fail if the - # internal file is missing. + # even in a developer build. Setting this variable explicitly to + # true will cause the build to fail if the internal file is missing. # - # The variable is documented here, but not handled in this file; - # see //google_apis/determine_use_official_keys.gypi for the - # implementation. - # - # Set the variable to false to not use the internal file, even when - # it exists in your checkout. + # Set the variable to false to not use the internal file, even for + # Chrome-branded builds or when it exists in your checkout. # # Leave it unset or set to "" to have the variable # implicitly set to true if you have # src/google_apis/internal/google_chrome_api_keys.h in your # checkout, and implicitly set to false if not. # - # Note that official builds always behave as if the variable + # Note that Chrome-branded builds always behave as if the variable # was explicitly set to true, i.e. they always use official keys, # and will fail to build if the internal file is missing. use_official_google_api_keys = "" @@ -41,8 +36,8 @@ # require server-side APIs may fail to work if no keys are # provided. # - # Note that if you are building an official build or if - # use_official_google_api_keys has been set to trie (explicitly or + # Note that when building a Chrome-branded build or if + # `use_official_google_api_keys` has been set to `true` (explicitly or # implicitly), these values will be ignored and the official # keys will be used instead. google_api_key = "" @@ -67,7 +62,7 @@ config("key_defines") { defines = [] - # TODO(crbug.com/1171510): Refactor so use_official_google_api_keys can be + # TODO(crbug.com/1294915): Refactor so use_official_google_api_keys can be # used for Fuchsia. if (!is_fuchsia && (is_chrome_branded || use_official_google_api_keys)) { defines += [ "USE_OFFICIAL_GOOGLE_API_KEYS=1" ]
diff --git a/ios/chrome/app/first_run_app_state_agent.mm b/ios/chrome/app/first_run_app_state_agent.mm index 1613d0e2..c261fba 100644 --- a/ios/chrome/app/first_run_app_state_agent.mm +++ b/ios/chrome/app/first_run_app_state_agent.mm
@@ -248,7 +248,7 @@ [[WelcomeToChromeViewController alloc] initWithBrowser:self.presentingInterface.browser mainBrowser:self.mainBrowser - presenter:self.presentingInterface.bvc + presenter:self.presentingInterface.syncPresenter dispatcher:welcomeHandler]; self.welcomeToChromeController = welcomeToChrome; UINavigationController* navController =
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index b604a37..1924498 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -375,6 +375,19 @@ std::size(kBubbleRichIPHRichWithSnooze), nullptr}, }; +const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueIconCapsule[] = { + {kOmniboxPasteButtonParameterName, + kOmniboxPasteButtonParameterBlueIconCapsule}}; +const FeatureEntry::FeatureParam kOmniboxPasteButtonBlueFullCapsule[] = { + {kOmniboxPasteButtonParameterName, + kOmniboxPasteButtonParameterBlueFullCapsule}}; +const FeatureEntry::FeatureVariation kOmniboxPasteButtonVariations[] = { + {"Icon only", kOmniboxPasteButtonBlueIconCapsule, + std::size(kOmniboxPasteButtonBlueIconCapsule), nullptr}, + {"Icon and text", kOmniboxPasteButtonBlueFullCapsule, + std::size(kOmniboxPasteButtonBlueFullCapsule), nullptr}, +}; + const FeatureEntry::FeatureParam kPopupMenuBookmarkStringAddABookmark[] = { {kPopupMenuBookmarkStringParamName, kPopupMenuBookmarkStringParamAddABookmark}}; @@ -988,6 +1001,11 @@ flag_descriptions::kAutofillEnableNewCardUnmaskPromptViewDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kAutofillEnableNewCardUnmaskPromptView)}, + {"omnibox-paste-button", flag_descriptions::kOmniboxPasteButtonName, + flag_descriptions::kOmniboxPasteButtonDescription, flags_ui::kOsIos, + FEATURE_WITH_PARAMS_VALUE_TYPE(kOmniboxPasteButton, + kOmniboxPasteButtonVariations, + "OmniboxPasteButton")}, }; bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 799de49..9cf514a 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -499,6 +499,11 @@ const char kOmniboxNewImplementationDescription[] = "Uses a textfield implementation that doesn't use UILabels internally"; +const char kOmniboxPasteButtonName[] = "Omnibox paste to search button"; +const char kOmniboxPasteButtonDescription[] = + "Add a paste button when showing clipboard suggestions in the omnibox. iOS " + "16 and above."; + const char kIOSOmniboxUpdatedPopupUIName[] = "Popup refresh"; const char kIOSOmniboxUpdatedPopupUIDescription[] = "Enable the new SwiftUI Popup implementation";
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index befe2d07..4216128b 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -455,6 +455,11 @@ extern const char kOmniboxNewImplementationName[]; extern const char kOmniboxNewImplementationDescription[]; +// Title and description for the flag to enable paste button on clipboard +// suggestion. +extern const char kOmniboxPasteButtonName[]; +extern const char kOmniboxPasteButtonDescription[]; + // Title and description for the flag to enable the SwiftUI omnibox popup // implementation. extern const char kIOSOmniboxUpdatedPopupUIName[];
diff --git a/ios/chrome/browser/ui/authentication/signin/add_account_signin/BUILD.gn b/ios/chrome/browser/ui/authentication/signin/add_account_signin/BUILD.gn index db2bdab..b4cd3b9 100644 --- a/ios/chrome/browser/ui/authentication/signin/add_account_signin/BUILD.gn +++ b/ios/chrome/browser/ui/authentication/signin/add_account_signin/BUILD.gn
@@ -24,7 +24,6 @@ "//ios/chrome/browser/ui/alert_coordinator", "//ios/chrome/browser/ui/authentication", "//ios/chrome/browser/ui/authentication/signin:signin_protected", - "//ios/chrome/browser/ui/elements:elements_internal", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/signin", "//ui/base",
diff --git a/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_coordinator.mm b/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_coordinator.mm index c8cf8a2..b526960 100644 --- a/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_coordinator.mm +++ b/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_coordinator.mm
@@ -17,7 +17,6 @@ #import "ios/chrome/browser/ui/authentication/authentication_ui_util.h" #import "ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_manager.h" #import "ios/chrome/browser/ui/authentication/signin/signin_coordinator+protected.h" -#import "ios/chrome/browser/ui/elements/activity_overlay_coordinator.h" #import "ios/chrome/grit/ios_strings.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity_interaction_manager.h" @@ -50,11 +49,6 @@ @property(nonatomic, assign, readonly) AddAccountSigninIntent signinIntent; // Account manager service to retrieve Chrome identities. @property(nonatomic, assign) ChromeAccountManagerService* accountManagerService; -// Activity overlay coordinator needed while waiting for the add account sign-in -// manager to be presented. This is needed if the network is slow or not -// responding. -@property(nonatomic, strong) - ActivityOverlayCoordinator* activityOverlayCoordinator; @end @@ -110,10 +104,6 @@ - (void)start { [super start]; - self.activityOverlayCoordinator = [[ActivityOverlayCoordinator alloc] - initWithBaseViewController:self.baseViewController - browser:self.browser]; - [self.activityOverlayCoordinator start]; self.accountManagerService = ChromeAccountManagerServiceFactory::GetForBrowserState( self.browser->GetBrowserState()); @@ -137,9 +127,6 @@ - (void)stop { [super stop]; - DCHECK(self.activityOverlayCoordinator); - [self.activityOverlayCoordinator stop]; - self.activityOverlayCoordinator = nil; // If one of those 3 DCHECK() fails, -[AddAccountSigninCoordinator // runCompletionCallbackWithSigninResult] has not been called. DCHECK(!self.addAccountSigninManager);
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator.h b/ios/chrome/browser/ui/browser_view/browser_coordinator.h index 826d02f..93a3a6e 100644 --- a/ios/chrome/browser/ui/browser_view/browser_coordinator.h +++ b/ios/chrome/browser/ui/browser_view/browser_coordinator.h
@@ -7,11 +7,12 @@ #include "base/ios/block_types.h" #import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h" +#import "ios/chrome/browser/ui/settings/sync/utils/sync_presenter.h" @class BrowserViewController; // Coordinator for BrowserViewController. -@interface BrowserCoordinator : ChromeCoordinator +@interface BrowserCoordinator : ChromeCoordinator <SyncPresenter> // The main view controller. @property(nonatomic, strong, readonly) BrowserViewController* viewController;
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm index 5dc5da53..dbc0411 100644 --- a/ios/chrome/browser/ui/browser_view/browser_coordinator.mm +++ b/ios/chrome/browser/ui/browser_view/browser_coordinator.mm
@@ -27,6 +27,7 @@ #import "ios/chrome/browser/follow/follow_tab_helper.h" #import "ios/chrome/browser/main/browser.h" #import "ios/chrome/browser/ntp/features.h" +#import "ios/chrome/browser/ntp/new_tab_page_tab_helper.h" #import "ios/chrome/browser/prerender/preload_controller_delegate.h" #import "ios/chrome/browser/prerender/prerender_service.h" #import "ios/chrome/browser/prerender/prerender_service_factory.h" @@ -68,6 +69,7 @@ #import "ios/chrome/browser/ui/commands/policy_change_commands.h" #import "ios/chrome/browser/ui/commands/qr_generation_commands.h" #import "ios/chrome/browser/ui/commands/share_highlight_command.h" +#import "ios/chrome/browser/ui/commands/show_signin_command.h" #import "ios/chrome/browser/ui/commands/snackbar_commands.h" #import "ios/chrome/browser/ui/commands/text_zoom_commands.h" #import "ios/chrome/browser/ui/commands/whats_new_commands.h" @@ -168,6 +170,7 @@ PolicyChangeCommands, PreloadControllerDelegate, RepostFormTabHelperDelegate, + SigninPresenter, ToolbarAccessoryCoordinatorDelegate, URLLoadingDelegate, WebStateListObserving> @@ -1509,8 +1512,7 @@ // The view controller should have been created. DCHECK(self.viewController); - SyncErrorBrowserAgent::FromBrowser(self.browser) - ->SetUIProviders(self.viewController, self.viewController); + SyncErrorBrowserAgent::FromBrowser(self.browser)->SetUIProviders(self, self); WebStateDelegateBrowserAgent::FromBrowser(self.browser) ->SetUIProviders(self.contextMenuProvider, @@ -1585,6 +1587,11 @@ CaptivePortalTabHelper::FromWebState(webState)->SetTabInsertionBrowserAgent( insertionAgent); } + + if (NewTabPageTabHelper::FromWebState(webState)) { + NewTabPageTabHelper::FromWebState(webState)->SetDelegate( + self.viewController); + } } // Uninstalls delegates for `webState`. @@ -1613,6 +1620,10 @@ CaptivePortalTabHelper::FromWebState(webState)->SetTabInsertionBrowserAgent( nil); } + + if (NewTabPageTabHelper::FromWebState(webState)) { + NewTabPageTabHelper::FromWebState(webState)->SetDelegate(nil); + } } #pragma mark - PasswordBreachCommands @@ -1775,4 +1786,55 @@ return self.browserContainerCoordinator.viewController.view; } +#pragma mark - SyncPresenter (Public) + +- (void)showReauthenticateSignin { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showSignin: + [[ShowSigninCommand alloc] + initWithOperation:AuthenticationOperationReauthenticate + accessPoint:signin_metrics::AccessPoint:: + ACCESS_POINT_UNKNOWN] + baseViewController:self.viewController]; +} + +- (void)showSyncPassphraseSettings { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showSyncPassphraseSettingsFromViewController:self.viewController]; +} + +- (void)showGoogleServicesSettings { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showGoogleServicesSettingsFromViewController:self.viewController]; +} + +- (void)showAccountSettings { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showAccountsSettingsFromViewController:self.viewController]; +} + +- (void)showTrustedVaultReauthForFetchKeysWithTrigger: + (syncer::TrustedVaultUserActionTriggerForUMA)trigger { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showTrustedVaultReauthForFetchKeysFromViewController:self.viewController + trigger:trigger]; +} + +- (void)showTrustedVaultReauthForDegradedRecoverabilityWithTrigger: + (syncer::TrustedVaultUserActionTriggerForUMA)trigger { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showTrustedVaultReauthForDegradedRecoverabilityFromViewController: + self.viewController + trigger: + trigger]; +} + +#pragma mark - SigninPresenter + +- (void)showSignin:(ShowSigninCommand*)command { + [HandlerForProtocol(self.dispatcher, ApplicationCommands) + showSignin:command + baseViewController:self.viewController]; +} + @end
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.h b/ios/chrome/browser/ui/browser_view/browser_view_controller.h index 7413c49..26a2bb07 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.h +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.h
@@ -17,7 +17,6 @@ #import "ios/chrome/browser/ui/ntp/logo_animation_controller.h" #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.h" #import "ios/chrome/browser/ui/page_info/requirements/page_info_presentation.h" -#import "ios/chrome/browser/ui/print/print_controller.h" #import "ios/chrome/browser/ui/settings/sync/utils/sync_presenter.h" #import "ios/chrome/browser/ui/thumb_strip/thumb_strip_supporting.h" #import "ios/chrome/browser/ui/toolbar/toolbar_coordinator_delegate.h" @@ -84,9 +83,6 @@ LogoAnimationControllerOwnerOwner, OmniboxPopupPresenterDelegate, PageInfoPresentation, - PrintControllerDelegate, - SigninPresenter, - SyncPresenter, ThumbStripSupporting, ToolbarCoordinatorDelegate, WebNavigationNTPDelegate,
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index c47bf6c..01ab0eb 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -61,7 +61,6 @@ #import "ios/chrome/browser/ui/commands/help_commands.h" #import "ios/chrome/browser/ui/commands/load_query_commands.h" #import "ios/chrome/browser/ui/commands/reading_list_add_command.h" -#import "ios/chrome/browser/ui/commands/show_signin_command.h" #import "ios/chrome/browser/ui/commands/snackbar_commands.h" #import "ios/chrome/browser/ui/commands/text_zoom_commands.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h" @@ -90,7 +89,6 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_coordinator.h" #import "ios/chrome/browser/ui/ntp/ntp_util.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_coordinator.h" -#import "ios/chrome/browser/ui/settings/sync/utils/sync_util.h" #import "ios/chrome/browser/ui/side_swipe/side_swipe_controller.h" #import "ios/chrome/browser/ui/side_swipe/swipe_view.h" #import "ios/chrome/browser/ui/start_surface/start_surface_features.h" @@ -1040,12 +1038,6 @@ notifier->RemoveObserver(_URLLoadingObserverBridge.get()); } - // Uninstall delegates so that any delegate callbacks triggered by subsequent - // WebStateDestroyed() signals are not handled. - WebStateList* webStateList = self.browser->GetWebStateList(); - for (int index = 0; index < webStateList->count(); ++index) - [self uninstallDelegatesForWebState:webStateList->GetWebStateAt(index)]; - // Disconnect child coordinators. if (base::FeatureList::IsEnabled(kModernTabStrip)) { [self.tabStripCoordinator stop]; @@ -1611,10 +1603,6 @@ UrlLoadingNotifierBrowserAgent::FromBrowser(self.browser) ->AddObserver(_URLLoadingObserverBridge.get()); - WebStateList* webStateList = self.browser->GetWebStateList(); - for (int index = 0; index < webStateList->count(); ++index) - [self installDelegatesForWebState:webStateList->GetWebStateAt(index)]; - // Set the TTS playback controller's WebStateList. // TODO(crbug.com/1272528): Move this somewhere else -- BrowserCoordinator at // least. @@ -2338,40 +2326,6 @@ #pragma mark - Private Methods: Tab creation and selection -// DEPRECATED -- Do not add further logic to this method. -// Add all delegates to the provided `webState`. -// Unregistration happens when the WebState is removed from the WebStateList. -// TODO(crbug.com/1290819): Remove this method. -- (void)installDelegatesForWebState:(web::WebState*)webState { - // If the WebState is unrealized, don't install the delegate. Instead they - // will be installed when -webStateRealized: method is called. - if (!webState->IsRealized()) - return; - - // TODO(crbug.com/1328039): Remove all use of the prerender service from BVC - // There should be no pre-rendered Tabs for this BrowserState. - DCHECK(!_prerenderService || - !_prerenderService->IsWebStatePrerendered(webState)); - - NewTabPageTabHelper::FromWebState(webState)->SetDelegate(self); -} - -// DEPRECATED -- Do not add further logic to this method. -// Remove delegates from the provided `webState`. -// TODO(crbug.com/1290819): Remove this method. -- (void)uninstallDelegatesForWebState:(web::WebState*)webState { - // If the WebState is unrealized, then the delegate had not been installed - // and thus don't need to be uninstalled. - if (!webState->IsRealized()) - return; - - // TODO(crbug.com/1300911): Have BrowserCoordinator manage the NTP. - // No need to stop _ntpCoordinator with Single NTP enabled since shutdown will - // do that. In addition, uninstallDelegatesForWebState: is called for - // individual WebState removals, which should not trigger a stop. - NewTabPageTabHelper::FromWebState(webState)->SetDelegate(nil); -} - // Called when a `webState` is selected in the WebStateList. Make any required // view changes. The notification will not be sent when the `webState` is // already the selected WebState. `notifyToolbar` indicates whether the toolbar @@ -3107,14 +3061,6 @@ } } -// TODO(crbug.com/1290819): When -installDelegatesForWebState is removed, this -// method can be removed as well. -- (void)webStateRealized:(web::WebState*)webState { - // The delegate were not installed because the WebState was not realized. - // Do it now so that the WebState behaves correctly. - [self installDelegatesForWebState:webState]; -} - #pragma mark - OmniboxPopupPresenterDelegate methods. - (UIView*)popupParentViewForPresenter:(OmniboxPopupPresenter*)presenter { @@ -3758,7 +3704,6 @@ } [self stopNTPIfNeeded]; - [self uninstallDelegatesForWebState:webState]; } - (void)webStateList:(WebStateList*)webStateList @@ -3774,9 +3719,6 @@ didReplaceWebState:(web::WebState*)oldWebState withWebState:(web::WebState*)newWebState atIndex:(int)atIndex { - [self uninstallDelegatesForWebState:oldWebState]; - [self installDelegatesForWebState:newWebState]; - // Add `newTab`'s view to the hierarchy if it's the current Tab. if (self.active && self.currentWebState == newWebState) [self displayWebState:newWebState]; @@ -3788,7 +3730,6 @@ atIndex:(int)index activating:(BOOL)activating { DCHECK(webState); - [self installDelegatesForWebState:webState]; DCHECK_EQ(self.browser->GetWebStateList(), webStateList); @@ -4187,51 +4128,6 @@ return _toolbarAccessoryPresenter; } -#pragma mark - SigninPresenter - -- (void)showSignin:(ShowSigninCommand*)command { - [self.dispatcher showSignin:command baseViewController:self]; -} - -#pragma mark - SyncPresenter (Public) - -- (void)showReauthenticateSignin { - [self.dispatcher - showSignin: - [[ShowSigninCommand alloc] - initWithOperation:AuthenticationOperationReauthenticate - accessPoint:signin_metrics::AccessPoint:: - ACCESS_POINT_UNKNOWN] - baseViewController:self]; -} - -- (void)showSyncPassphraseSettings { - [self.dispatcher showSyncPassphraseSettingsFromViewController:self]; -} - -- (void)showGoogleServicesSettings { - [self.dispatcher showGoogleServicesSettingsFromViewController:self]; -} - -- (void)showAccountSettings { - [self.dispatcher showAccountsSettingsFromViewController:self]; -} - -- (void)showTrustedVaultReauthForFetchKeysWithTrigger: - (syncer::TrustedVaultUserActionTriggerForUMA)trigger { - [self.dispatcher - showTrustedVaultReauthForFetchKeysFromViewController:self - trigger:trigger]; -} - -- (void)showTrustedVaultReauthForDegradedRecoverabilityWithTrigger: - (syncer::TrustedVaultUserActionTriggerForUMA)trigger { - [self.dispatcher - showTrustedVaultReauthForDegradedRecoverabilityFromViewController:self - trigger: - trigger]; -} - #pragma mark - NewTabPageTabHelperDelegate - (void)newTabPageHelperDidChangeVisibility:(NewTabPageTabHelper*)NTPHelper @@ -4257,15 +4153,6 @@ } } -#pragma mark - PrintControllerDelegate - -- (UIViewController*)baseViewControllerForPrintPreview { - if (self.presentedViewController) { - return self.presentedViewController; - } - return self; -} - #pragma mark - Getters - (NewTabPageCoordinator*)ntpCoordinator {
diff --git a/ios/chrome/browser/ui/main/BUILD.gn b/ios/chrome/browser/ui/main/BUILD.gn index 1446f762..fe53bd3 100644 --- a/ios/chrome/browser/ui/main/BUILD.gn +++ b/ios/chrome/browser/ui/main/BUILD.gn
@@ -286,6 +286,7 @@ "//ios/chrome/browser/ui/reading_list", "//ios/chrome/browser/ui/recent_tabs", "//ios/chrome/browser/ui/settings/sync", + "//ios/chrome/browser/ui/settings/sync/utils", "//ios/chrome/browser/ui/snackbar", "//ios/chrome/browser/ui/tabs:constants", "//ios/chrome/browser/ui/thumb_strip",
diff --git a/ios/chrome/browser/ui/main/browser_interface_provider.h b/ios/chrome/browser/ui/main/browser_interface_provider.h index 24a0439..cfdd1cb 100644 --- a/ios/chrome/browser/ui/main/browser_interface_provider.h +++ b/ios/chrome/browser/ui/main/browser_interface_provider.h
@@ -13,6 +13,7 @@ @class BrowserCoordinator; @class BrowserViewController; class ChromeBrowserState; +@protocol SyncPresenter; // A BrowserInterface is an abstraction that exposes an interface to the Chrome // user interface (and related model objects) to the application layer. Each @@ -32,6 +33,7 @@ // The BrowserViewController showing the current tab. The API surface this // property exposes will be refactored so that the BVC class isn't exposed. @property(nonatomic, readonly) BrowserViewController* bvc; +@property(nonatomic, readonly) id<SyncPresenter> syncPresenter; // The active browser. This can never be nullptr. @property(nonatomic, readonly) Browser* browser; // The browser state for this interface. This can never be nullptr.
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm index c935040..f54035ca4 100644 --- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm +++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -27,6 +27,7 @@ #import "ios/chrome/browser/ui/incognito_reauth/incognito_reauth_scene_agent.h" #import "ios/chrome/browser/ui/main/scene_state.h" #import "ios/chrome/browser/ui/main/scene_state_browser_agent.h" +#import "ios/chrome/browser/ui/settings/sync/utils/sync_presenter.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -61,6 +62,10 @@ return self.coordinator.viewController; } +- (id<SyncPresenter>)syncPresenter { + return self.coordinator; +} + - (Browser*)browser { return self.coordinator.browser; }
diff --git a/ios/chrome/browser/ui/main/test/stub_browser_interface.h b/ios/chrome/browser/ui/main/test/stub_browser_interface.h index 22645e3..1901379 100644 --- a/ios/chrome/browser/ui/main/test/stub_browser_interface.h +++ b/ios/chrome/browser/ui/main/test/stub_browser_interface.h
@@ -12,12 +12,14 @@ class Browser; @class BrowserViewController; class ChromeBrowserState; +@protocol SyncPresenter; // Test double for BrowserInterface implementors. All properties are writable, // and have nil, nullptr, or NO as default values. @interface StubBrowserInterface : NSObject <BrowserInterface> @property(nonatomic, readwrite) UIViewController* viewController; @property(nonatomic, readwrite) BrowserViewController* bvc; +@property(nonatomic, readwrite) id<SyncPresenter> syncPresenter; @property(nonatomic, readwrite) Browser* browser; @property(nonatomic, readwrite) ChromeBrowserState* browserState; @property(nonatomic, readwrite) BOOL incognito;
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc index a469ab5..93bd7ed 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc +++ b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc
@@ -6,3 +6,10 @@ const base::Feature kEnableSuggestionsScrollingOnIPad{ "EnableSuggestionsScrollingOnIPad", base::FEATURE_DISABLED_BY_DEFAULT}; + +const base::Feature kOmniboxPasteButton{"OmniboxPasteButton", + base::FEATURE_DISABLED_BY_DEFAULT}; + +const char kOmniboxPasteButtonParameterName[] = "PasteButtonVariant"; +const char kOmniboxPasteButtonParameterBlueIconCapsule[] = "SuggestionIcon"; +const char kOmniboxPasteButtonParameterBlueFullCapsule[] = "SuggestionTextIcon";
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h index 143cdc7e..a1c835b 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h
@@ -11,4 +11,14 @@ // disable suggestions hiding on keyboard dismissal. extern const base::Feature kEnableSuggestionsScrollingOnIPad; +// Feature flag to enable omnibox suggestions with iOS 16 `PasteButton`. +extern const base::Feature kOmniboxPasteButton; + +// Feature parameter for kOmniboxPasteButton. +extern const char kOmniboxPasteButtonParameterName[]; +// PasteButton on suggestion row, blue color with icon only and capsule shape. +extern const char kOmniboxPasteButtonParameterBlueIconCapsule[]; +// PasteButton on suggestion row, blue color with icon/text and capsule shape. +extern const char kOmniboxPasteButtonParameterBlueFullCapsule[]; + #endif // IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_UI_FEATURES_H_
diff --git a/ios/chrome/browser/ui/print/print_controller.h b/ios/chrome/browser/ui/print/print_controller.h index 138b4bb..1703d43 100644 --- a/ios/chrome/browser/ui/print/print_controller.h +++ b/ios/chrome/browser/ui/print/print_controller.h
@@ -9,13 +9,6 @@ #import "ios/chrome/browser/web/print/web_state_printer.h" -// The delegate for PrintController. Provide information needed to display the -// UIPrintInteractionController. -@protocol PrintControllerDelegate -// The view controller the system print dialog should be presented from. -- (UIViewController*)baseViewControllerForPrintPreview; -@end - // Interface for printing. @interface PrintController : NSObject <WebStatePrinter>
diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc index 72cf4ca..ded0d20 100644 --- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc +++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
@@ -849,15 +849,16 @@ auto* info = ctx.event()->set_chrome_mojo_event_info(); info->set_mojo_interface_tag(interface_name_); const auto method_info = method_info_callback_(*message); - info->set_ipc_hash(method_info.first); - - const auto method_address = - reinterpret_cast<uintptr_t>(method_info.second); - const absl::optional<size_t> location_iid = - base::trace_event::InternedUnsymbolizedSourceLocation::Get( - &ctx, method_address); - if (location_iid) { - info->set_mojo_interface_method_iid(*location_iid); + if (method_info) { + info->set_ipc_hash((*method_info)()); + const auto method_address = + reinterpret_cast<uintptr_t>(method_info); + const absl::optional<size_t> location_iid = + base::trace_event::InternedUnsymbolizedSourceLocation:: + Get(&ctx, method_address); + if (location_iid) { + info->set_mojo_interface_method_iid(*location_iid); + } } static const uint8_t* flow_enabled =
diff --git a/mojo/public/cpp/bindings/message_metadata_helpers.h b/mojo/public/cpp/bindings/message_metadata_helpers.h index 6c1a0075..23b09d1 100644 --- a/mojo/public/cpp/bindings/message_metadata_helpers.h +++ b/mojo/public/cpp/bindings/message_metadata_helpers.h
@@ -6,17 +6,20 @@ #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_METADATA_HELPERS_H_ #include <cstdint> -#include <utility> namespace mojo { class Message; -// Alias for a function taking mojo::Message and returning an IPC hash (stable -// across Chrome versions) + an address of the symbol representing the -// mojo method name. -using MessageToMethodInfoCallback = - std::pair<uint32_t, const void*> (*)(Message&); +using IPCStableHashFunction = uint32_t (*)(); +// Alias for a function taking mojo::Message and returning a pointer to a +// function that computes an IPC hash (stable across Chrome versions). +// An address of the returned function is used for identifying mojo +// method after symbolization. +// The callback could have returned a pair (function address, IPC hash value) +// instead, but returning only the function address results in ~20k binary size +// savings. +using MessageToMethodInfoCallback = IPCStableHashFunction (*)(Message&); // Alias for a function taking mojo::Message and returning method name. using MessageToMethodNameCallback = const char* (*)(Message&);
diff --git a/mojo/public/cpp/bindings/tests/bindings_perftest.cc b/mojo/public/cpp/bindings/tests/bindings_perftest.cc index 14bf038..173c6c8 100644 --- a/mojo/public/cpp/bindings/tests/bindings_perftest.cc +++ b/mojo/public/cpp/bindings/tests/bindings_perftest.cc
@@ -28,8 +28,8 @@ const char kTestInterfaceName[] = "TestInterface"; -std::pair<uint32_t, const void*> MessageToMethodInfo(Message& message) { - return {-1, nullptr}; +IPCStableHashFunction MessageToMethodInfo(Message& message) { + return nullptr; } const char* MessageToMethodName(Message& message) {
diff --git a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc index f28e6cac..c04c386 100644 --- a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc +++ b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
@@ -25,8 +25,8 @@ const char kTestInterfaceName[] = "TestInterface"; -std::pair<uint32_t, const void*> MessageToMethodInfo(Message& message) { - return {-1, nullptr}; +IPCStableHashFunction MessageToMethodInfo(Message& message) { + return nullptr; } const char* MessageToMethodName(Message& message) {
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl index bbac331..c53d4ea 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -15,8 +15,10 @@ class {{export_attribute}} {{interface.name}} : public {{interface.name}}InterfaceBase { public: + using IPCStableHashFunction = uint32_t(*)(); + static const char Name_[]; - static std::pair<uint32_t, const void*> MessageToMethodInfo_(mojo::Message& message); + static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message); static const char* MessageToMethodName_(mojo::Message& message); @@ -61,7 +63,7 @@ {#--- Per method symbols #} {%- for method in interface.methods %} struct {{method.name}}_Sym { - NOINLINE static void IPCSymbol(); + NOINLINE static uint32_t IPCStableHash(); }; {%- endfor %} #endif // !BUILDFLAG(IS_FUCHSIA)
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl index 9beaa2cc..d538eaa 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -45,23 +45,19 @@ {%- endif %} {%- endfor %} -std::pair<uint32_t, const void*> {{interface.name}}::MessageToMethodInfo_(mojo::Message& message) { +{{interface.name}}::IPCStableHashFunction {{interface.name}}::MessageToMethodInfo_(mojo::Message& message) { +#if !BUILDFLAG(IS_FUCHSIA) {%- if interface.methods %} switch (message.name()) { {%- for method in interface.methods %} case internal::k{{interface.name}}_{{method.name}}_Name: { - constexpr uint32_t value = base::MD5Hash32Constexpr( - "(Impl){{namespace_as_string}}::{{interface.name}}::{{method.name}}"); -#if BUILDFLAG(IS_FUCHSIA) - return std::make_pair(value, nullptr); -#else - return std::make_pair(value, reinterpret_cast<const void*>(&{{interface.name}}::{{method.name}}_Sym::IPCSymbol)); -#endif // BUILDFLAG(IS_FUCHSIA) + return &{{interface.name}}::{{method.name}}_Sym::IPCStableHash; } {%- endfor %} } {%- endif %} - return std::make_pair(0, nullptr); +#endif // !BUILDFLAG(IS_FUCHSIA) + return nullptr; } @@ -98,10 +94,18 @@ #if !BUILDFLAG(IS_FUCHSIA) {%- for method in interface.methods %} -void {{interface.name}}::{{method.name}}_Sym::IPCSymbol() { +uint32_t {{interface.name}}::{{method.name}}_Sym::IPCStableHash() { // This method's address is used for indetifiying the mojo method name after - // symblozation. So each IPCSymbol should have a unique address. - NO_CODE_FOLDING(); + // symbolization. So each IPCStableHash should have a unique address. + // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of + // __LINE__ value, which is not unique accross different mojo modules. + // The code below is very similar to NO_CODE_FOLDING, but it uses a unique + // hash instead of __LINE__. + constexpr uint32_t kHash = base::MD5Hash32Constexpr( + "(Impl){{namespace_as_string}}::{{interface.name}}::{{method.name}}"); + const uint32_t hash = kHash; + base::debug::Alias(&hash); + return hash; } {%- endfor %} # endif // !BUILDFLAG(IS_FUCHSIA)
diff --git a/net/base/features.cc b/net/base/features.cc index 4196be6..15af33b 100644 --- a/net/base/features.cc +++ b/net/base/features.cc
@@ -108,6 +108,9 @@ const base::FeatureParam<int> kUseDnsHttpsSvcbExtraTimePercent{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbExtraTimePercent", 0}; +const base::Feature kUseDnsHttpsSvcbAlpn{"UseDnsHttpsSvcbAlpn", + base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/net/base/features.h b/net/base/features.h index ae47f39..c841edfb 100644 --- a/net/base/features.h +++ b/net/base/features.h
@@ -169,6 +169,9 @@ NET_EXPORT extern const base::FeatureParam<int> kUseDnsHttpsSvcbExtraTimePercent; +// Update protocol using ALPN information in HTTPS DNS records. +NET_EXPORT extern const base::Feature kUseDnsHttpsSvcbAlpn; + // Enables TLS 1.3 early data. NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
diff --git a/net/http/alternative_service.h b/net/http/alternative_service.h index 91dbc76..90656bf 100644 --- a/net/http/alternative_service.h +++ b/net/http/alternative_service.h
@@ -27,13 +27,19 @@ // Alternate Protocol was used by winning a race with a normal connection. ALTERNATE_PROTOCOL_USAGE_WON_RACE = 1, // Alternate Protocol was not used by losing a race with a normal connection. - ALTERNATE_PROTOCOL_USAGE_LOST_RACE = 2, + ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE = 2, // Alternate Protocol was not used because no Alternate-Protocol information // was available when the request was issued, but an Alternate-Protocol header // was present in the response. ALTERNATE_PROTOCOL_USAGE_MAPPING_MISSING = 3, // Alternate Protocol was not used because it was marked broken. ALTERNATE_PROTOCOL_USAGE_BROKEN = 4, + // HTTPS DNS protocol upgrade job was used without racing with a normal + // connection and an Alternate Protocol job. + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE = 5, + // HTTPS DNS protocol upgrade job won a race with a normal connection and + // an Alternate Protocol job. + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE = 6, // Maximum value for the enum. ALTERNATE_PROTOCOL_USAGE_MAX, };
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc index b2fd54f..403f239 100644 --- a/net/http/http_server_properties_manager.cc +++ b/net/http/http_server_properties_manager.cc
@@ -4,6 +4,7 @@ #include "net/http/http_server_properties_manager.h" +#include <algorithm> #include <utility> #include "base/bind.h" @@ -715,7 +716,7 @@ // Convert |server_info_map| to a list Value and add it to // |http_server_properties_dict|. base::Value::List servers_list; - for (const auto& [key, server_info] : base::Reversed(server_info_map)) { + for (const auto& [key, server_info] : server_info_map) { // If can't convert the NetworkIsolationKey to a value, don't save to disk. // Generally happens because the key is for a unique origin. base::Value network_isolation_key_value; @@ -750,6 +751,9 @@ std::move(network_isolation_key_value)); servers_list.Append(std::move(server_dict)); } + // Reverse `servers_list`. The least recently used item will be in the front. + std::reverse(servers_list.begin(), servers_list.end()); + http_server_properties_dict.Set(kServersKey, std::move(servers_list)); http_server_properties_dict.Set(kVersionKey, kVersionNumber);
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc index ca52a87..87aaabd 100644 --- a/net/http/http_server_properties_manager_unittest.cc +++ b/net/http/http_server_properties_manager_unittest.cc
@@ -2376,22 +2376,19 @@ std::move(pref_delegate), /*net_log=*/nullptr, GetMockTickClock()); unowned_pref_delegate->InitializePrefs(saved_value); - // Only the first of the values learned for kNetworkIsolationKey1 should have + // Only the last of the values learned for kNetworkIsolationKey1 should have // been saved, and the value for kNetworkIsolationKey2 as well. The canonical // suffix logic should still be respected. - // - // TODO(mmenke): Preferring the oldest value seems unexpected. - // https://crbug.com/994842. EXPECT_EQ( - 1u, + 2u, properties->GetAlternativeServiceInfos(kServer1, kNetworkIsolationKey1) .size()); EXPECT_EQ( - 1u, + 2u, properties->GetAlternativeServiceInfos(kServer2, kNetworkIsolationKey1) .size()); EXPECT_EQ( - 1u, + 2u, properties->GetAlternativeServiceInfos(kServer3, kNetworkIsolationKey1) .size()); EXPECT_EQ(
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h index 694d071..9ba1e633 100644 --- a/net/http/http_stream_factory.h +++ b/net/http/http_stream_factory.h
@@ -46,8 +46,17 @@ class NET_EXPORT_PRIVATE JobFactory; enum JobType { + // Job that will connect via HTTP/1 or HTTP/2. This may be paused for a + // while when ALTERNATIVE or DNS_ALPN_H3 job was created. MAIN, + // Job that will connect via HTTP/3 iff Chrome has received an Alt-Svc + // header from the origin. ALTERNATIVE, + // Job that will connect via HTTP/3 iff an "h3" value was found in the ALPN + // list of an HTTPS DNS record. + DNS_ALPN_H3, + // Job that will preconnect. This uses HTTP/3 iff Chrome has received an + // Alt-Svc header from the origin. Otherwise, it use HTTP/1 or HTTP/2. PRECONNECT, };
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index 93ff6b8..968b9ea4 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -71,12 +71,27 @@ } // namespace +const char* NetLogHttpStreamJobType(HttpStreamFactory::JobType job_type) { + switch (job_type) { + case HttpStreamFactory::MAIN: + return "main"; + case HttpStreamFactory::ALTERNATIVE: + return "alternative"; + case HttpStreamFactory::DNS_ALPN_H3: + return "dns_alpn_h3"; + case HttpStreamFactory::PRECONNECT: + return "preconnect"; + } + return ""; +} + // Returns parameters associated with the start of a HTTP stream job. base::Value NetLogHttpStreamJobParams(const NetLogSource& source, const GURL& original_url, const GURL& url, bool expect_spdy, bool using_quic, + HttpStreamFactory::JobType job_type, RequestPriority priority) { base::Value::Dict dict; if (source.IsValid()) @@ -86,6 +101,7 @@ dict.Set("expect_spdy", expect_spdy); dict.Set("using_quic", using_quic); dict.Set("priority", RequestPriorityToString(priority)); + dict.Set("type", NetLogHttpStreamJobType(job_type)); return base::Value(std::move(dict)); } @@ -142,7 +158,8 @@ origin_url_.SchemeIs(url::kWssScheme)), using_quic_( alternative_protocol == kProtoQUIC || - (ShouldForceQuic(session, destination_, proxy_info, using_ssl_))), + (ShouldForceQuic(session, destination_, proxy_info, using_ssl_)) || + job_type == DNS_ALPN_H3), quic_version_(quic_version), expect_spdy_(alternative_protocol == kProtoHTTP2 && !using_quic_), quic_request_(session_->quic_stream_factory()), @@ -179,8 +196,10 @@ session->context().quic_context->params()->supported_versions[0]; } - if (using_quic_) - DCHECK_NE(quic_version_, quic::ParsedQuicVersion::Unsupported()); + if (using_quic_) { + DCHECK((quic_version_ != quic::ParsedQuicVersion::Unsupported()) || + (job_type_ == DNS_ALPN_H3)); + } DCHECK(session); if (alternative_protocol != kProtoUnknown) { @@ -274,7 +293,7 @@ } void HttpStreamFactory::Job::Orphan() { - DCHECK_EQ(job_type_, ALTERNATIVE); + DCHECK(job_type_ == ALTERNATIVE || job_type_ == DNS_ALPN_H3); net_log_.AddEvent(NetLogEventType::HTTP_STREAM_JOB_ORPHANED); // Watching for SPDY sessions isn't supported on orphaned jobs. @@ -304,6 +323,16 @@ is_websocket_); } +bool HttpStreamFactory::Job::HasAvailableQuicSession() const { + if (!using_quic_) + return false; + bool require_dns_https_alpn = (job_type_ == DNS_ALPN_H3); + return quic_request_.CanUseExistingSession( + origin_url_, request_info_.privacy_mode, request_info_.socket_tag, + request_info_.network_isolation_key, request_info_.secure_dns_policy, + require_dns_https_alpn, destination_); +} + bool HttpStreamFactory::Job::was_alpn_negotiated() const { return was_alpn_negotiated_; } @@ -627,7 +656,7 @@ net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_JOB, [&] { return NetLogHttpStreamJobParams(net_log->source(), request_info_.url, origin_url_, expect_spdy_, using_quic_, - priority_); + job_type_, priority_); }); net_log->AddEventReferencingSource( NetLogEventType::HTTP_STREAM_REQUEST_STARTED_JOB, net_log_.source()); @@ -879,13 +908,14 @@ ssl_config = &server_ssl_config_; } DCHECK(url.SchemeIs(url::kHttpsScheme)); + bool require_dns_https_alpn = (job_type_ == DNS_ALPN_H3); int rv = quic_request_.Request( std::move(destination), quic_version_, request_info_.privacy_mode, priority_, request_info_.socket_tag, request_info_.network_isolation_key, request_info_.secure_dns_policy, proxy_info_.is_direct(), - /*require_dns_https_alpn=*/false, ssl_config->GetCertVerifyFlags(), url, - net_log_, &net_error_details_, + require_dns_https_alpn, ssl_config->GetCertVerifyFlags(), url, net_log_, + &net_error_details_, base::BindOnce(&Job::OnFailedOnDefaultNetwork, ptr_factory_.GetWeakPtr()), io_callback_); if (rv == OK) { @@ -908,7 +938,7 @@ } void HttpStreamFactory::Job::OnFailedOnDefaultNetwork(int result) { - DCHECK_EQ(job_type_, ALTERNATIVE); + DCHECK(job_type_ == ALTERNATIVE || job_type_ == DNS_ALPN_H3); DCHECK(using_quic_); delegate_->OnFailedOnDefaultNetwork(this); } @@ -1257,7 +1287,7 @@ HttpStreamFactory::JobFactory::~JobFactory() = default; std::unique_ptr<HttpStreamFactory::Job> -HttpStreamFactory::JobFactory::CreateMainJob( +HttpStreamFactory::JobFactory::CreateJob( HttpStreamFactory::Job::Delegate* delegate, HttpStreamFactory::JobType job_type, HttpNetworkSession* session, @@ -1270,31 +1300,9 @@ GURL origin_url, bool is_websocket, bool enable_ip_based_pooling, - NetLog* net_log) { - return std::make_unique<HttpStreamFactory::Job>( - delegate, job_type, session, request_info, priority, proxy_info, - server_ssl_config, proxy_ssl_config, std::move(destination), origin_url, - kProtoUnknown, quic::ParsedQuicVersion::Unsupported(), is_websocket, - enable_ip_based_pooling, net_log); -} - -std::unique_ptr<HttpStreamFactory::Job> -HttpStreamFactory::JobFactory::CreateAltSvcJob( - HttpStreamFactory::Job::Delegate* delegate, - HttpStreamFactory::JobType job_type, - HttpNetworkSession* session, - const HttpRequestInfo& request_info, - RequestPriority priority, - const ProxyInfo& proxy_info, - const SSLConfig& server_ssl_config, - const SSLConfig& proxy_ssl_config, - url::SchemeHostPort destination, - GURL origin_url, + NetLog* net_log, NextProto alternative_protocol, - quic::ParsedQuicVersion quic_version, - bool is_websocket, - bool enable_ip_based_pooling, - NetLog* net_log) { + quic::ParsedQuicVersion quic_version) { return std::make_unique<HttpStreamFactory::Job>( delegate, job_type, session, request_info, priority, proxy_info, server_ssl_config, proxy_ssl_config, std::move(destination), origin_url,
diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 6fbf76d9..17d04e80 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h
@@ -186,7 +186,7 @@ virtual void Resume(); // Called when |this| is orphaned by Delegate. This is valid for - // ALTERNATIVE job only. + // ALTERNATIVE job and DNS_ALPN_H3 job. void Orphan(); void SetPriority(RequestPriority priority); @@ -195,6 +195,10 @@ // spdy session. bool HasAvailableSpdySession() const; + // Returns true if the current request can be immediately sent on a existing + // QUIC session. + bool HasAvailableQuicSession() const; + const GURL& origin_url() const { return origin_url_; } RequestPriority priority() const { return priority_; } bool was_alpn_negotiated() const; @@ -475,7 +479,7 @@ virtual ~JobFactory(); - virtual std::unique_ptr<HttpStreamFactory::Job> CreateMainJob( + virtual std::unique_ptr<HttpStreamFactory::Job> CreateJob( HttpStreamFactory::Job::Delegate* delegate, HttpStreamFactory::JobType job_type, HttpNetworkSession* session, @@ -488,24 +492,10 @@ GURL origin_url, bool is_websocket, bool enable_ip_based_pooling, - NetLog* net_log); - - virtual std::unique_ptr<HttpStreamFactory::Job> CreateAltSvcJob( - HttpStreamFactory::Job::Delegate* delegate, - HttpStreamFactory::JobType job_type, - HttpNetworkSession* session, - const HttpRequestInfo& request_info, - RequestPriority priority, - const ProxyInfo& proxy_info, - const SSLConfig& server_ssl_config, - const SSLConfig& proxy_ssl_config, - url::SchemeHostPort destination, - GURL origin_url, - NextProto alternative_protocol, - quic::ParsedQuicVersion quic_version, - bool is_websocket, - bool enable_ip_based_pooling, - NetLog* net_log); + NetLog* net_log, + NextProto alternative_protocol = kProtoUnknown, + quic::ParsedQuicVersion quic_version = + quic::ParsedQuicVersion::Unsupported()); }; } // namespace net
diff --git a/net/http/http_stream_factory_job_controller.cc b/net/http/http_stream_factory_job_controller.cc index a1eddbb..74669aa 100644 --- a/net/http/http_stream_factory_job_controller.cc +++ b/net/http/http_stream_factory_job_controller.cc
@@ -16,8 +16,10 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_usage_estimator.h" #include "base/values.h" +#include "net/base/features.h" #include "net/base/host_mapping_rules.h" #include "net/base/load_flags.h" +#include "net/base/net_errors.h" #include "net/base/privacy_mode.h" #include "net/base/proxy_server.h" #include "net/base/proxy_string_util.h" @@ -94,6 +96,12 @@ } } +// Generate a AlternativeService for DNS alt job. Note: Chrome does not yet +// support different port DNS alpn. +AlternativeService GetAlternativeServiceForDnsJob(const GURL& url) { + return AlternativeService(kProtoQUIC, HostPortPair::FromURL(url)); +} + } // namespace // The maximum time to wait for the alternate job to complete before resuming @@ -165,6 +173,7 @@ HttpStreamFactory::JobController::~JobController() { main_job_.reset(); alternative_job_.reset(); + dns_alpn_h3_job_.reset(); bound_job_ = nullptr; if (proxy_resolve_request_) { DCHECK_EQ(STATE_RESOLVE_PROXY_COMPLETE, next_state_); @@ -224,6 +233,9 @@ return main_job_->GetLoadState(); if (alternative_job_) return alternative_job_->GetLoadState(); + if (dns_alpn_h3_job_) + return dns_alpn_h3_job_->GetLoadState(); + // When proxy resolution fails, there is no job created and // NotifyRequestFailed() is executed one message loop iteration later. return LOAD_STATE_IDLE; @@ -231,15 +243,20 @@ void HttpStreamFactory::JobController::OnRequestComplete() { DCHECK(request_); - - CancelJobs(); request_ = nullptr; - if (bound_job_) { + + if (!job_bound_) { + alternative_job_.reset(); + main_job_.reset(); + dns_alpn_h3_job_.reset(); + } else { if (bound_job_->job_type() == MAIN) { main_job_.reset(); - } else { - DCHECK(bound_job_->job_type() == ALTERNATIVE); + } else if (bound_job_->job_type() == ALTERNATIVE) { alternative_job_.reset(); + } else { + DCHECK(bound_job_->job_type() == DNS_ALPN_H3); + dns_alpn_h3_job_.reset(); } bound_job_ = nullptr; } @@ -258,6 +275,9 @@ if (alternative_job_) { alternative_job_->SetPriority(priority); } + if (dns_alpn_h3_job_) { + dns_alpn_h3_job_->SetPriority(priority); + } } void HttpStreamFactory::JobController::OnStreamReady( @@ -348,12 +368,18 @@ Job* job, int status, const SSLConfig& used_ssl_config) { - if (job->job_type() == ALTERNATIVE) { - DCHECK_EQ(alternative_job_.get(), job); - OnAlternativeServiceJobFailed(status); - } else { + DCHECK_NE(OK, status); + if (job->job_type() == MAIN) { DCHECK_EQ(main_job_.get(), job); main_job_net_error_ = status; + } else if (job->job_type() == ALTERNATIVE) { + DCHECK_EQ(alternative_job_.get(), job); + DCHECK_NE(kProtoUnknown, alternative_service_info_.protocol()); + alternative_job_net_error_ = status; + } else { + DCHECK_EQ(job->job_type(), DNS_ALPN_H3); + DCHECK_EQ(dns_alpn_h3_job_.get(), job); + dns_alpn_h3_job_net_error_ = status; } MaybeResumeMainJob(job, base::TimeDelta()); @@ -371,14 +397,19 @@ DCHECK(job); if (!bound_job_) { - if (main_job_ && alternative_job_) { + if (GetJobCount() >= 2) { // Hey, we've got other jobs! Maybe one of them will succeed, let's just // ignore this failure. if (job->job_type() == MAIN) { + DCHECK_EQ(main_job_.get(), job); main_job_.reset(); - } else { - DCHECK(job->job_type() == ALTERNATIVE); + } else if (job->job_type() == ALTERNATIVE) { + DCHECK_EQ(alternative_job_.get(), job); alternative_job_.reset(); + } else { + DCHECK_EQ(job->job_type(), DNS_ALPN_H3); + DCHECK_EQ(dns_alpn_h3_job_.get(), job); + dns_alpn_h3_job_.reset(); } return; } else { @@ -401,8 +432,14 @@ } void HttpStreamFactory::JobController::OnFailedOnDefaultNetwork(Job* job) { - DCHECK_EQ(job->job_type(), ALTERNATIVE); - alternative_job_failed_on_default_network_ = true; + if (job->job_type() == ALTERNATIVE) { + DCHECK_EQ(alternative_job_.get(), job); + alternative_job_failed_on_default_network_ = true; + } else { + DCHECK_EQ(job->job_type(), DNS_ALPN_H3); + DCHECK_EQ(dns_alpn_h3_job_.get(), job); + dns_alpn_h3_job_failed_on_default_network_ = true; + } } void HttpStreamFactory::JobController::OnCertificateError( @@ -483,9 +520,13 @@ if (job->job_type() == MAIN) { DCHECK_EQ(main_job_.get(), job); main_job_.reset(); - } else { + } else if (job->job_type() == ALTERNATIVE) { DCHECK_EQ(alternative_job_.get(), job); alternative_job_.reset(); + } else { + DCHECK_EQ(job->job_type(), DNS_ALPN_H3); + DCHECK_EQ(dns_alpn_h3_job_.get(), job); + dns_alpn_h3_job_.reset(); } MaybeNotifyFactoryOfCompletion(); @@ -530,15 +571,23 @@ main_job_net_error_ = OK; alternative_job_net_error_ = OK; alternative_job_failed_on_default_network_ = false; + dns_alpn_h3_job_net_error_ = OK; + dns_alpn_h3_job_failed_on_default_network_ = false; } void HttpStreamFactory::JobController::MaybeResumeMainJob( Job* job, const base::TimeDelta& delay) { DCHECK(delay == base::TimeDelta() || delay == main_job_wait_time_); - DCHECK(job == main_job_.get() || job == alternative_job_.get()); + DCHECK(job == main_job_.get() || job == alternative_job_.get() || + job == dns_alpn_h3_job_.get()); - if (job != alternative_job_.get() || !main_job_) + if (job == main_job_.get()) + return; + if (job == dns_alpn_h3_job_.get() && alternative_job_) { + return; + } + if (!main_job_) return; main_job_is_blocked_ = false; @@ -568,9 +617,9 @@ bool HttpStreamFactory::JobController::ShouldWait(Job* job) { // The alternative job never waits. - if (job == alternative_job_.get()) + if (job == alternative_job_.get() || job == dns_alpn_h3_job_.get()) return false; - + DCHECK_EQ(main_job_.get(), job); if (main_job_is_blocked_) return true; @@ -636,6 +685,7 @@ // iteration later to avoid re-entrancy. DCHECK(!main_job_); DCHECK(!alternative_job_); + DCHECK(!dns_alpn_h3_job_); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&HttpStreamFactory::JobController::NotifyRequestFailed, @@ -762,30 +812,33 @@ url::SchemeHostPort(alternative_url); ConvertWsToHttp(alternative_destination); - main_job_ = job_factory_->CreateAltSvcJob( + main_job_ = job_factory_->CreateJob( this, PRECONNECT, session_, request_info_, IDLE, proxy_info_, server_ssl_config_, proxy_ssl_config_, - std::move(alternative_destination), origin_url, - alternative_service_info_.protocol(), quic_version, is_websocket_, - enable_ip_based_pooling_, session_->net_log()); + std::move(alternative_destination), origin_url, is_websocket_, + enable_ip_based_pooling_, session_->net_log(), + alternative_service_info_.protocol(), quic_version); } else { - main_job_ = job_factory_->CreateMainJob( + main_job_ = job_factory_->CreateJob( this, PRECONNECT, session_, request_info_, IDLE, proxy_info_, server_ssl_config_, proxy_ssl_config_, std::move(destination), origin_url, is_websocket_, enable_ip_based_pooling_, session_->net_log()); } main_job_->Preconnect(num_streams_); + // TODO(crbug.com/1317943): Consider using DNS_ALPN_H3 job for preconnect. return OK; } - main_job_ = job_factory_->CreateMainJob( + main_job_ = job_factory_->CreateJob( this, MAIN, session_, request_info_, priority_, proxy_info_, server_ssl_config_, proxy_ssl_config_, std::move(destination), origin_url, is_websocket_, enable_ip_based_pooling_, net_log_.net_log()); + // Alternative Service can only be set for HTTPS requests while Alternative // Proxy is set for HTTP requests. if (alternative_service_info_.protocol() != kProtoUnknown) { DCHECK(request_info_.url.SchemeIs(url::kHttpsScheme)); + DCHECK(!is_websocket_); DVLOG(1) << "Selected alternative service (host: " << alternative_service_info_.host_port_pair().host() << " port: " << alternative_service_info_.host_port_pair().port() @@ -799,28 +852,86 @@ url::SchemeHostPort(alternative_url); ConvertWsToHttp(alternative_destination); - alternative_job_ = job_factory_->CreateAltSvcJob( + alternative_job_ = job_factory_->CreateJob( this, ALTERNATIVE, session_, request_info_, priority_, proxy_info_, server_ssl_config_, proxy_ssl_config_, - std::move(alternative_destination), origin_url, - alternative_service_info_.protocol(), quic_version, is_websocket_, - enable_ip_based_pooling_, net_log_.net_log()); + std::move(alternative_destination), origin_url, is_websocket_, + enable_ip_based_pooling_, net_log_.net_log(), + alternative_service_info_.protocol(), quic_version); + } + if (base::FeatureList::IsEnabled(features::kUseDnsHttpsSvcbAlpn) && + base::EqualsCaseInsensitiveASCII(origin_url.scheme(), + url::kHttpsScheme) && + session_->IsQuicEnabled() && proxy_info_.is_direct() && + !session_->http_server_properties()->IsAlternativeServiceBroken( + GetAlternativeServiceForDnsJob(origin_url), + request_info_.network_isolation_key)) { + DCHECK(!is_websocket_); + url::SchemeHostPort dns_alpn_h3_destination = + url::SchemeHostPort(origin_url); + dns_alpn_h3_job_ = job_factory_->CreateJob( + this, DNS_ALPN_H3, session_, request_info_, priority_, proxy_info_, + server_ssl_config_, proxy_ssl_config_, + std::move(dns_alpn_h3_destination), origin_url, is_websocket_, + enable_ip_based_pooling_, net_log_.net_log()); + } + + ClearInappropriateJobs(); + + if (alternative_job_ || dns_alpn_h3_job_) { + // TODO(crbug.com/1317943): Consider not to block the main job when an + // active session is available for the main job and |alternative_job_| + // doesn't exists and |dns_alpn_h3_job_| exists. This may make the fallback + // logic faster when QUIC connection is unstable on the network. But we need + // to support DNS alpn job for preconnect before doing so. Currently + // preconnect job is triggered for all navigations by + // features::kNavigationRequestPreconnect. And the preconnect job doesn't + // support DNS HTTPS alpn and establishes non-HTTP/3 connection for the + // first connection. So when this method is called after the preconnect + // request, an active session may be available for the main job, and the + // DNS alpn job may be unintentionally disturbed. main_job_is_blocked_ = true; + } + + if (alternative_job_) { alternative_job_->Start(request_->stream_type()); } - // Even if |alternative_job| has already finished, it will not have notified - // the request yet, since we defer that to the next iteration of the - // MessageLoop, so starting |main_job_| is always safe. - main_job_->Start(request_->stream_type()); + if (dns_alpn_h3_job_) { + dns_alpn_h3_job_->Start(request_->stream_type()); + } + + if (main_job_) { + main_job_->Start(request_->stream_type()); + } return OK; } +void HttpStreamFactory::JobController::ClearInappropriateJobs() { + if (dns_alpn_h3_job_ && dns_alpn_h3_job_->HasAvailableQuicSession()) { + // Clear |main_job_| and |alternative_job_| here not to start them when + // there is an active session available for |dns_alpn_h3_job_|. + main_job_.reset(); + alternative_job_.reset(); + } + + if (alternative_job_ && dns_alpn_h3_job_ && + (alternative_job_->HasAvailableQuicSession() || + (alternative_service_info_.alternative_service() == + GetAlternativeServiceForDnsJob(request_info_.url)))) { + // Clear |dns_alpn_h3_job_|, when there is an active session available for + // |alternative_job_| or |alternative_job_| was created for the same + // destination. + dns_alpn_h3_job_.reset(); + } +} + void HttpStreamFactory::JobController::BindJob(Job* job) { DCHECK(request_); DCHECK(job); - DCHECK(job == alternative_job_.get() || job == main_job_.get()); + DCHECK(job == alternative_job_.get() || job == main_job_.get() || + job == dns_alpn_h3_job_.get()); DCHECK(!job_bound_); DCHECK(!bound_job_); @@ -837,54 +948,73 @@ OrphanUnboundJob(); } -void HttpStreamFactory::JobController::CancelJobs() { - DCHECK(request_); - if (job_bound_) - return; - if (alternative_job_) - alternative_job_.reset(); - if (main_job_) - main_job_.reset(); -} - void HttpStreamFactory::JobController::OrphanUnboundJob() { DCHECK(request_); DCHECK(bound_job_); - if (bound_job_->job_type() == MAIN && alternative_job_) { - DCHECK(!is_websocket_); - // Allow |alternative_job_| to run to completion, rather than resetting it - // to check if there is any broken alternative service to report. - // OnOrphanedJobComplete() will clean up |this| when the job completes. - alternative_job_->Orphan(); + if (bound_job_->job_type() == MAIN) { + // Allow |alternative_job_| and |dns_alpn_h3_job_| to run to completion, + // rather than resetting them to check if there is any broken alternative + // service to report. OnOrphanedJobComplete() will clean up |this| when the + // jobs complete. + if (alternative_job_) { + DCHECK(!is_websocket_); + alternative_job_->Orphan(); + } + if (dns_alpn_h3_job_) { + DCHECK(!is_websocket_); + dns_alpn_h3_job_->Orphan(); + } return; } - if (bound_job_->job_type() == ALTERNATIVE && main_job_ && - !alternative_job_failed_on_default_network_) { - // |request_| is bound to the alternative job and the alternative job - // succeeds on the default network. This means that the main job - // is no longer needed, so cancel it now. Pending ConnectJobs will return - // established sockets to socket pools if applicable. - // https://crbug.com/757548. - // The main job still needs to run if the alternative job succeeds on the - // alternate network in order to figure out whether QUIC should be marked as - // broken until the default network changes. - DCHECK_EQ(OK, alternative_job_net_error_); - main_job_.reset(); + if (bound_job_->job_type() == ALTERNATIVE) { + if (!alternative_job_failed_on_default_network_ && !dns_alpn_h3_job_) { + // |request_| is bound to the alternative job and the alternative job + // succeeds on the default network, and there is no DNS alt job. This + // means that the main job is no longer needed, so cancel it now. Pending + // ConnectJobs will return established sockets to socket pools if + // applicable. + // https://crbug.com/757548. + // The main job still needs to run if the alternative job succeeds on the + // alternate network in order to figure out whether QUIC should be marked + // as broken until the default network changes. And also the main job + // still needs to run if the DNS alt job exists to figure out whether + // the DNS alpn service is broken. + DCHECK(!main_job_ || (alternative_job_net_error_ == OK)); + main_job_.reset(); + } + // Allow |dns_alpn_h3_job_| to run to completion, rather than resetting + // it to check if there is any broken alternative service to report. + // OnOrphanedJobComplete() will clean up |this| when the job completes. + if (dns_alpn_h3_job_) { + DCHECK(!is_websocket_); + dns_alpn_h3_job_->Orphan(); + } + } + if (bound_job_->job_type() == DNS_ALPN_H3) { + if (!dns_alpn_h3_job_failed_on_default_network_ && !alternative_job_) { + DCHECK(!main_job_ || (dns_alpn_h3_job_net_error_ == OK)); + main_job_.reset(); + } + // Allow |alternative_job_| to run to completion, rather than resetting + // it to check if there is any broken alternative service to report. + // OnOrphanedJobComplete() will clean up |this| when the job completes. + if (alternative_job_) { + DCHECK(!is_websocket_); + alternative_job_->Orphan(); + } } } void HttpStreamFactory::JobController::OnJobSucceeded(Job* job) { DCHECK(job); - if (!bound_job_) { - if (main_job_ && alternative_job_) + if ((main_job_ && alternative_job_) || dns_alpn_h3_job_) ReportAlternateProtocolUsage(job); BindJob(job); return; } - DCHECK(bound_job_); } void HttpStreamFactory::JobController::MarkRequestComplete( @@ -895,77 +1025,75 @@ request_->Complete(was_alpn_negotiated, negotiated_protocol, using_spdy); } -void HttpStreamFactory::JobController::OnAlternativeServiceJobFailed( - int net_error) { - DCHECK_EQ(alternative_job_->job_type(), ALTERNATIVE); - DCHECK_NE(OK, net_error); - DCHECK_NE(kProtoUnknown, alternative_service_info_.protocol()); - - alternative_job_net_error_ = net_error; -} - -void HttpStreamFactory::JobController::MaybeReportBrokenAlternativeService() { +void HttpStreamFactory::JobController::MaybeReportBrokenAlternativeService( + const AlternativeService& alt_service, + int alt_job_net_error, + bool alt_job_failed_on_default_network, + const std::string& histogram_name_for_failure) { // If alternative job succeeds on the default network, no brokenness to // report. - if (alternative_job_net_error_ == OK && - !alternative_job_failed_on_default_network_) + if (alt_job_net_error == OK && !alt_job_failed_on_default_network) return; // No brokenness to report if the main job fails. if (main_job_net_error_ != OK) return; - DCHECK(alternative_service_info_.protocol() != kProtoUnknown); + // No need to record DNS_NO_MACHING_SUPPORTED_ALPN error. + if (alt_job_net_error == ERR_DNS_NO_MACHING_SUPPORTED_ALPN) + return; - if (alternative_job_failed_on_default_network_ && - alternative_job_net_error_ == OK) { + if (alt_job_failed_on_default_network && alt_job_net_error == OK) { // Alternative job failed on the default network but succeeds on the // non-default network, mark alternative service broken until the default // network changes. session_->http_server_properties() ->MarkAlternativeServiceBrokenUntilDefaultNetworkChanges( - alternative_service_info_.alternative_service(), - request_info_.network_isolation_key); - // Reset error status for Jobs after reporting brokenness. - ResetErrorStatusForJobs(); + alt_service, request_info_.network_isolation_key); return; } - if (alternative_job_net_error_ == ERR_NETWORK_CHANGED || - alternative_job_net_error_ == ERR_INTERNET_DISCONNECTED || - (alternative_job_net_error_ == ERR_NAME_NOT_RESOLVED && - request_info_.url.host() == - alternative_service_info_.alternative_service().host)) { + if (alt_job_net_error == ERR_NETWORK_CHANGED || + alt_job_net_error == ERR_INTERNET_DISCONNECTED || + (alt_job_net_error == ERR_NAME_NOT_RESOLVED && + request_info_.url.host() == alt_service.host)) { // No need to mark alternative service as broken. - // Reset error status for Jobs. - ResetErrorStatusForJobs(); return; } // Report brokenness if alternative job failed. - base::UmaHistogramSparse("Net.AlternateServiceFailed", - -alternative_job_net_error_); + base::UmaHistogramSparse(histogram_name_for_failure, -alt_job_net_error); HistogramBrokenAlternateProtocolLocation( BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_JOB_ALT); session_->http_server_properties()->MarkAlternativeServiceBroken( - alternative_service_info_.alternative_service(), - request_info_.network_isolation_key); - // Reset error status for Jobs after reporting brokenness. - ResetErrorStatusForJobs(); + alt_service, request_info_.network_isolation_key); } void HttpStreamFactory::JobController::MaybeNotifyFactoryOfCompletion() { - if (!main_job_ && !alternative_job_) { - // Both jobs are gone, report brokenness if apply. Error status for Jobs - // will be reset after reporting to avoid redundant reporting. - MaybeReportBrokenAlternativeService(); - } + if (main_job_ || alternative_job_ || dns_alpn_h3_job_) + return; - if (!request_ && !main_job_ && !alternative_job_) { - DCHECK(!bound_job_); - factory_->OnJobControllerComplete(this); - } + // All jobs are gone. + // Report brokenness for the alternate jobs if apply. + MaybeReportBrokenAlternativeService( + alternative_service_info_.alternative_service(), + alternative_job_net_error_, alternative_job_failed_on_default_network_, + "Net.AlternateServiceFailed"); + // Report for the DNS alt job if apply. + MaybeReportBrokenAlternativeService( + GetAlternativeServiceForDnsJob(request_info_.url), + dns_alpn_h3_job_net_error_, dns_alpn_h3_job_failed_on_default_network_, + "Net.AlternateServiceForDnsAlpnH3Failed"); + + // Reset error status for Jobs after reporting brokenness to avoid redundant + // reporting. + ResetErrorStatusForJobs(); + + if (request_) + return; + DCHECK(!bound_job_); + factory_->OnJobControllerComplete(this); } void HttpStreamFactory::JobController::NotifyRequestFailed(int rv) { @@ -1161,25 +1289,35 @@ void HttpStreamFactory::JobController::ReportAlternateProtocolUsage( Job* job) const { - DCHECK(main_job_ && alternative_job_); + DCHECK((main_job_ && alternative_job_) || dns_alpn_h3_job_); bool is_google_host = HasGoogleHost(job->origin_url()); if (job == main_job_.get()) { - HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_LOST_RACE, + HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, is_google_host); return; } + if (job == alternative_job_.get()) { + if (job->using_existing_quic_session()) { + HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE, + is_google_host); + return; + } - DCHECK_EQ(alternative_job_.get(), job); - if (job->using_existing_quic_session()) { - HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE, + HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE, is_google_host); - return; } - - HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE, - is_google_host); + if (job == dns_alpn_h3_job_.get()) { + if (job->using_existing_quic_session()) { + HistogramAlternateProtocolUsage( + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE, + is_google_host); + return; + } + HistogramAlternateProtocolUsage( + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, is_google_host); + } } bool HttpStreamFactory::JobController::IsJobOrphaned(Job* job) const { @@ -1189,7 +1327,7 @@ int HttpStreamFactory::JobController::ReconsiderProxyAfterError(Job* job, int error) { // ReconsiderProxyAfterError() should only be called when the last job fails. - DCHECK(!(alternative_job_ && main_job_)); + DCHECK_EQ(1, GetJobCount()); DCHECK(!proxy_resolve_request_); DCHECK(session_); @@ -1213,6 +1351,7 @@ // Abandon all Jobs and start over. job_bound_ = false; bound_job_ = nullptr; + dns_alpn_h3_job_.reset(); alternative_job_.reset(); main_job_.reset(); ResetErrorStatusForJobs();
diff --git a/net/http/http_stream_factory_job_controller.h b/net/http/http_stream_factory_job_controller.h index ec698c4e..5206db8 100644 --- a/net/http/http_stream_factory_job_controller.h +++ b/net/http/http_stream_factory_job_controller.h
@@ -52,6 +52,7 @@ // Used in tests only for verification purpose. const Job* main_job() const { return main_job_.get(); } const Job* alternative_job() const { return alternative_job_.get(); } + const Job* dns_alpn_h3_job() const { return dns_alpn_h3_job_.get(); } void RewriteUrlWithHostMappingRules(GURL& url); @@ -185,10 +186,6 @@ // still associated with |request_|. void BindJob(Job* job); - // Called when |request_| is destructed. - // Job(s) associated with but not bound to |request_| will be deleted. - void CancelJobs(); - // Called after BindJob() to notify the unbound job that its result should be // ignored by JobController. The unbound job can be canceled or continue until // completion. @@ -200,15 +197,14 @@ // Called when a Job succeeds. void OnJobSucceeded(Job* job); + // Clears inappropriate jobs before starting them. + void ClearInappropriateJobs(); + // Marks completion of the |request_|. void MarkRequestComplete(bool was_alpn_negotiated, NextProto negotiated_protocol, bool using_spdy); - // Must be called when the alternative service job fails. |net_error| is the - // net error of the failed alternative service job. - void OnAlternativeServiceJobFailed(int net_error); - // Called when all Jobs complete. Reports alternative service brokenness to // HttpServerProperties if apply and resets net errors afterwards: // - report broken if the main job has no error and the alternative job has an @@ -216,7 +212,11 @@ // - report broken until default network change if the main job has no error, // the alternative job has no error, but the alternative job failed on the // default network. - void MaybeReportBrokenAlternativeService(); + void MaybeReportBrokenAlternativeService( + const AlternativeService& alt_service, + int alt_job_net_error, + bool alt_job_failed_on_default_network, + const std::string& histogram_name_for_failure); void MaybeNotifyFactoryOfCompletion(); @@ -233,8 +233,10 @@ void ResumeMainJob(); // Reset error status to default value for Jobs: - // - reset |main_job_net_error_| and |alternative_job_net_error_| to OK; - // - reset |alternative_job_failed_on_default_network_| to false. + // - reset |main_job_net_error_| and |alternative_job_net_error_| and + // |dns_alpn_h3_job_net_error_| to OK; + // - reset |alternative_job_failed_on_default_network_| and + // |dns_alpn_h3_job_failed_on_default_network_| to false. void ResetErrorStatusForJobs(); AlternativeServiceInfo GetAlternativeServiceInfoFor( @@ -272,6 +274,11 @@ // Returns true if QUIC is allowed for |host|. bool IsQuicAllowedForHost(const std::string& host); + int GetJobCount() const { + return (main_job_ ? 1 : 0) + (alternative_job_ ? 1 : 0) + + (dns_alpn_h3_job_ ? 1 : 0); + } + raw_ptr<HttpStreamFactory> factory_; raw_ptr<HttpNetworkSession> session_; raw_ptr<JobFactory> job_factory_; @@ -302,6 +309,7 @@ // |main_job_| to proceed and then race the two jobs. std::unique_ptr<Job> main_job_; std::unique_ptr<Job> alternative_job_; + std::unique_ptr<Job> dns_alpn_h3_job_; // The alternative service used by |alternative_job_| // (or by |main_job_| if |is_preconnect_|.) AlternativeServiceInfo alternative_service_info_; @@ -313,6 +321,10 @@ int alternative_job_net_error_ = OK; // Set to true if the alternative job failed on the default network. bool alternative_job_failed_on_default_network_ = false; + // Net error code of the DNS HTTPS ALPN job. Set to OK by default. + int dns_alpn_h3_job_net_error_ = OK; + // Set to true if the DNS HTTPS ALPN job failed on the default network. + bool dns_alpn_h3_job_failed_on_default_network_ = false; // True if a Job has ever been bound to the |request_|. bool job_bound_ = false;
diff --git a/net/http/http_stream_factory_job_controller_unittest.cc b/net/http/http_stream_factory_job_controller_unittest.cc index a8cc3a8..59f06e7 100644 --- a/net/http/http_stream_factory_job_controller_unittest.cc +++ b/net/http/http_stream_factory_job_controller_unittest.cc
@@ -16,6 +16,7 @@ #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" +#include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" @@ -30,6 +31,7 @@ #include "net/base/test_proxy_delegate.h" #include "net/dns/mock_host_resolver.h" #include "net/dns/public/secure_dns_policy.h" +#include "net/http/alternative_service.h" #include "net/http/http_basic_stream.h" #include "net/http/http_network_session_peer.h" #include "net/http/http_response_headers.h" @@ -46,9 +48,11 @@ #include "net/proxy_resolution/mock_proxy_resolver.h" #include "net/proxy_resolution/proxy_config_service_fixed.h" #include "net/proxy_resolution/proxy_info.h" +#include "net/quic/crypto/proof_verifier_chromium.h" #include "net/quic/mock_crypto_client_stream_factory.h" #include "net/quic/mock_quic_context.h" #include "net/quic/mock_quic_data.h" +#include "net/quic/quic_http_stream.h" #include "net/quic/quic_stream_factory.h" #include "net/quic/quic_stream_factory_peer.h" #include "net/quic/quic_test_packet_maker.h" @@ -79,6 +83,10 @@ const char kServerHostname[] = "www.example.com"; +// The default delay for main job defined in QuicStreamFactory:: +// GetTimeDelayForWaitingJob(). +const int kDefaultDelayMilliSecsForWaitingJob = 300; + class FailingProxyResolverFactory : public ProxyResolverFactory { public: FailingProxyResolverFactory() : ProxyResolverFactory(false) {} @@ -173,13 +181,23 @@ HttpStreamFactoryJobPeer::SetQuicConnectionFailedOnDefaultNetwork( job_controller->alternative_job_.get()); } + static void SetDnsAlpnH3JobFailedOnDefaultNetwork( + HttpStreamFactory::JobController* job_controller) { + DCHECK(job_controller->dns_alpn_h3_job() != nullptr); + HttpStreamFactoryJobPeer::SetQuicConnectionFailedOnDefaultNetwork( + job_controller->dns_alpn_h3_job_.get()); + } }; -class HttpStreamFactoryJobControllerTest : public TestWithTaskEnvironment { +class HttpStreamFactoryJobControllerTestBase : public TestWithTaskEnvironment { public: - HttpStreamFactoryJobControllerTest() + explicit HttpStreamFactoryJobControllerTestBase(bool dns_https_alpn_enabled) : TestWithTaskEnvironment( - base::test::TaskEnvironment::TimeSource::MOCK_TIME) { + base::test::TaskEnvironment::TimeSource::MOCK_TIME), + dns_https_alpn_enabled_(dns_https_alpn_enabled) { + if (dns_https_alpn_enabled_) { + feature_list_.InitWithFeatures({features::kUseDnsHttpsSvcbAlpn}, {}); + } FLAGS_quic_enable_http3_grease_randomness = false; CreateSessionDeps(); } @@ -228,6 +246,8 @@ if (quic_data_) quic_data_->AddSocketDataToFactory(session_deps_.socket_factory.get()); + if (quic_data2_) + quic_data2_->AddSocketDataToFactory(session_deps_.socket_factory.get()); if (tcp_data_) session_deps_.socket_factory->AddSocketDataProvider(tcp_data_.get()); @@ -260,16 +280,20 @@ return test_proxy_delegate_.get(); } - HttpStreamFactoryJobControllerTest( - const HttpStreamFactoryJobControllerTest&) = delete; - HttpStreamFactoryJobControllerTest& operator=( - const HttpStreamFactoryJobControllerTest&) = delete; + HttpStreamFactoryJobControllerTestBase( + const HttpStreamFactoryJobControllerTestBase&) = delete; + HttpStreamFactoryJobControllerTestBase& operator=( + const HttpStreamFactoryJobControllerTestBase&) = delete; - ~HttpStreamFactoryJobControllerTest() override { + ~HttpStreamFactoryJobControllerTestBase() override { if (quic_data_) { EXPECT_TRUE(quic_data_->AllReadDataConsumed()); EXPECT_TRUE(quic_data_->AllWriteDataConsumed()); } + if (quic_data2_) { + EXPECT_TRUE(quic_data2_->AllReadDataConsumed()); + EXPECT_TRUE(quic_data2_->AllWriteDataConsumed()); + } if (tcp_data_) { EXPECT_TRUE(tcp_data_->AllReadDataConsumed()); EXPECT_TRUE(tcp_data_->AllWriteDataConsumed()); @@ -325,6 +349,8 @@ const quic::ParsedQuicVersion& expected_version, const quic::ParsedQuicVersionVector& supported_versions); + bool dns_https_alpn_enabled() const { return dns_https_alpn_enabled_; } + quic::ParsedQuicVersion version_ = DefaultSupportedQuicVersions().front(); RecordingNetLogObserver net_log_observer_; NetLogWithSource net_log_with_source_{ @@ -339,6 +365,7 @@ std::unique_ptr<HttpStreamRequest> request_; std::unique_ptr<SequencedSocketData> tcp_data_; std::unique_ptr<MockQuicData> quic_data_; + std::unique_ptr<MockQuicData> quic_data2_; MockCryptoClientStreamFactory crypto_client_stream_factory_; QuicTestPacketMaker client_maker_{version_, quic::QuicUtils::CreateRandomConnectionId( @@ -355,11 +382,26 @@ bool delay_main_job_with_available_spdy_session_ = true; private: + bool dns_https_alpn_enabled_; std::unique_ptr<TestProxyDelegate> test_proxy_delegate_; bool create_job_controller_ = true; + + base::test::ScopedFeatureList feature_list_; }; -TEST_F(HttpStreamFactoryJobControllerTest, ProxyResolutionFailsSync) { +class HttpStreamFactoryJobControllerTest + : public HttpStreamFactoryJobControllerTestBase, + public ::testing::WithParamInterface<bool> { + protected: + HttpStreamFactoryJobControllerTest() + : HttpStreamFactoryJobControllerTestBase(GetParam()) {} +}; + +INSTANTIATE_TEST_SUITE_P(All, + HttpStreamFactoryJobControllerTest, + testing::Bool()); + +TEST_P(HttpStreamFactoryJobControllerTest, ProxyResolutionFailsSync) { ProxyConfig proxy_config; proxy_config.set_pac_url(GURL("http://fooproxyurl")); proxy_config.set_pac_mandatory(true); @@ -396,7 +438,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, ProxyResolutionFailsAsync) { +TEST_P(HttpStreamFactoryJobControllerTest, ProxyResolutionFailsAsync) { ProxyConfig proxy_config; proxy_config.set_pac_url(GURL("http://fooproxyurl")); proxy_config.set_pac_mandatory(true); @@ -437,7 +479,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, NoSupportedProxies) { +TEST_P(HttpStreamFactoryJobControllerTest, NoSupportedProxies) { session_deps_.proxy_resolution_service = ConfiguredProxyResolutionService::CreateFixedFromPacResult( "QUIC myproxy.org:443", TRAFFIC_ANNOTATION_FOR_TESTS); @@ -464,8 +506,10 @@ } class JobControllerReconsiderProxyAfterErrorTest - : public HttpStreamFactoryJobControllerTest { + : public HttpStreamFactoryJobControllerTestBase { public: + JobControllerReconsiderProxyAfterErrorTest() + : HttpStreamFactoryJobControllerTestBase(false) {} void Initialize( std::unique_ptr<ProxyResolutionService> proxy_resolution_service) { session_deps_.proxy_resolution_service = @@ -1131,7 +1175,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, OnStreamFailedWithNoAlternativeJob) { +TEST_P(HttpStreamFactoryJobControllerTest, OnStreamFailedWithNoAlternativeJob) { tcp_data_ = std::make_unique<SequencedSocketData>(); tcp_data_->set_connect_data(MockConnect(ASYNC, ERR_FAILED)); @@ -1155,7 +1199,7 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(HttpStreamFactoryJobControllerTest, OnStreamReadyWithNoAlternativeJob) { +TEST_P(HttpStreamFactoryJobControllerTest, OnStreamReadyWithNoAlternativeJob) { tcp_data_ = std::make_unique<SequencedSocketData>(); tcp_data_->set_connect_data(MockConnect(ASYNC, OK)); @@ -1179,7 +1223,7 @@ // Test we cancel Jobs correctly when the Request is explicitly canceled // before any Job is bound to Request. -TEST_F(HttpStreamFactoryJobControllerTest, CancelJobsBeforeBinding) { +TEST_P(HttpStreamFactoryJobControllerTest, CancelJobsBeforeBinding) { // Use COLD_START to make the alt job pending. crypto_client_stream_factory_.set_handshake_mode( MockCryptoClientStream::COLD_START); @@ -1214,7 +1258,7 @@ // Test that the controller does not create alternative job when the advertised // versions in AlternativeServiceInfo do not contain any version that is // supported. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, DoNotCreateAltJobIfQuicVersionsUnsupported) { tcp_data_ = std::make_unique<SequencedSocketData>(); tcp_data_->set_connect_data(MockConnect(ASYNC, OK)); @@ -1241,7 +1285,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, DoNotDelayMainJobIfQuicWasRecentlyBroken) { crypto_client_stream_factory_.set_handshake_mode( MockCryptoClientStream::COLD_START); @@ -1299,7 +1343,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, DelayMainJobAfterRecentlyBrokenQuicWasConfirmed) { crypto_client_stream_factory_.set_handshake_mode( MockCryptoClientStream::COLD_START); @@ -1363,7 +1407,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -void HttpStreamFactoryJobControllerTest::TestOnStreamFailedForBothJobs( +void HttpStreamFactoryJobControllerTestBase::TestOnStreamFailedForBothJobs( bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddConnect(ASYNC, ERR_FAILED); @@ -1402,20 +1446,21 @@ // This test verifies that the alternative service is not marked broken if both // jobs fail, and the alternative job is not retried on the alternate network. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, OnStreamFailedForBothJobsWithoutQuicRetry) { TestOnStreamFailedForBothJobs(false); } // This test verifies that the alternative service is not marked broken if both // jobs fail, and the alternative job is retried on the alternate network. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, OnStreamFailedForBothJobsWithQuicRetriedOnAlternateNetwork) { TestOnStreamFailedForBothJobs(true); } -void HttpStreamFactoryJobControllerTest::TestAltJobFailsAfterMainJobSucceeded( - bool alt_job_retried_on_non_default_network) { +void HttpStreamFactoryJobControllerTestBase:: + TestAltJobFailsAfterMainJobSucceeded( + bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(ASYNC, ERR_FAILED); crypto_client_stream_factory_.set_handshake_mode( @@ -1470,7 +1515,7 @@ // This test verifies that the alternatvie service is marked broken when the // alternative job fails on default after the main job succeeded. The // brokenness should not be cleared when the default network changes. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobFailsOnDefaultNetworkAfterMainJobSucceeded) { TestAltJobFailsAfterMainJobSucceeded(false); } @@ -1478,13 +1523,13 @@ // This test verifies that the alternatvie service is marked broken when the // alternative job fails on both networks after the main job succeeded. The // brokenness should not be cleared when the default network changes. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobFailsOnBothNetworksAfterMainJobSucceeded) { TestAltJobFailsAfterMainJobSucceeded(true); } // Tests that when alt job succeeds, main job is destroyed. -TEST_F(HttpStreamFactoryJobControllerTest, AltJobSucceedsMainJobDestroyed) { +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsMainJobDestroyed) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); // Use cold start and complete alt job manually. @@ -1531,7 +1576,7 @@ // Tests that if alt job succeeds and main job is blocked, main job should be // cancelled immediately. |request_| completion will clean up the JobController. // Regression test for crbug.com/678768. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsMainJobBlockedControllerDestroyed) { quic_data_ = std::make_unique<MockQuicData>(version_); if (version_.UsesHttp3()) { @@ -1572,7 +1617,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, SpdySessionKeyHasOriginHostPortPair) { session_deps_.enable_http2_alternative_service = true; @@ -1612,7 +1657,7 @@ // Tests that if an orphaned job completes after |request_| is gone, // JobController will be cleaned up. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, OrphanedJobCompletesControllerDestroyed) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); @@ -1666,8 +1711,9 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -void HttpStreamFactoryJobControllerTest::TestAltJobSucceedsAfterMainJobFailed( - bool alt_job_retried_on_non_default_network) { +void HttpStreamFactoryJobControllerTestBase:: + TestAltJobSucceedsAfterMainJobFailed( + bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); // Use cold start and complete alt job manually. @@ -1721,19 +1767,19 @@ // This test verifies that the alternative service is not mark broken if the // alternative job succeeds on the default network after the main job failed. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsOnDefaultNetworkAfterMainJobFailed) { TestAltJobSucceedsAfterMainJobFailed(false); } // This test verifies that the alternative service is not mark broken if the // alternative job succeeds on the alternate network after the main job failed. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsOnAlternateNetwrokAfterMainJobFailed) { TestAltJobSucceedsAfterMainJobFailed(true); } -void HttpStreamFactoryJobControllerTest:: +void HttpStreamFactoryJobControllerTestBase:: TestAltJobSucceedsAfterMainJobSucceeded( bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); @@ -1801,7 +1847,7 @@ // This test verifies that the alternative service is not marked broken if the // alternative job succeeds on the default network after the main job succeeded. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsOnDefaultNetworkAfterMainJobSucceeded) { TestAltJobSucceedsAfterMainJobSucceeded(false); } @@ -1811,12 +1857,12 @@ // network, which failed on the default network previously, after the main job // succeeded. The brokenness should be cleared when the default network // changes. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltJobSucceedsOnAlternateNetworkAfterMainJobSucceeded) { TestAltJobSucceedsAfterMainJobSucceeded(true); } -void HttpStreamFactoryJobControllerTest:: +void HttpStreamFactoryJobControllerTestBase:: TestMainJobSucceedsAfterAltJobSucceeded( bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); @@ -1878,7 +1924,7 @@ // This test verifies that the alternative service is not marked broken if the // main job succeeds after the alternative job succeeded on the default network. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterAltJobSucceededOnDefaultNetwork) { TestMainJobSucceedsAfterAltJobSucceeded(false); } @@ -1888,13 +1934,14 @@ // succeeded on the non-default network, i.e., failed on the default network // previously. The brokenness should be cleared when the default network // changes. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterAltJobSucceededOnAlternateNetwork) { TestMainJobSucceedsAfterAltJobSucceeded(true); } -void HttpStreamFactoryJobControllerTest::TestMainJobFailsAfterAltJobSucceeded( - bool alt_job_retried_on_non_default_network) { +void HttpStreamFactoryJobControllerTestBase:: + TestMainJobFailsAfterAltJobSucceeded( + bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); // Use cold start and complete alt job manually. @@ -1943,7 +1990,7 @@ // This test verifies that the alternative service is not marked broken if the // main job fails after the alternative job succeeded on the default network. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobFailsAfterAltJobSucceededOnDefaultNetwork) { TestMainJobFailsAfterAltJobSucceeded(false); } @@ -1951,13 +1998,14 @@ // This test verifies that the alternative service is not marked broken if the // main job fails after the alternative job succeeded on the non-default // network, i.e., failed on the default network previously. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobFailsAfterAltJobSucceededOnAlternateNetwork) { TestMainJobFailsAfterAltJobSucceeded(true); } -void HttpStreamFactoryJobControllerTest::TestMainJobSucceedsAfterAltJobFailed( - bool alt_job_retried_on_non_default_network) { +void HttpStreamFactoryJobControllerTestBase:: + TestMainJobSucceedsAfterAltJobFailed( + bool alt_job_retried_on_non_default_network) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddConnect(SYNCHRONOUS, ERR_FAILED); @@ -2009,7 +2057,7 @@ // This test verifies that the alternative service will be marked broken when // the alternative job fails on the default network and main job succeeds later. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterAltJobFailedOnDefaultNetwork) { TestMainJobSucceedsAfterAltJobFailed(false); } @@ -2017,15 +2065,15 @@ // This test verifies that the alternative service will be marked broken when // the alternative job fails on both default and alternate networks and main job // succeeds later. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterAltJobFailedOnBothNetworks) { TestMainJobSucceedsAfterAltJobFailed(true); } -void HttpStreamFactoryJobControllerTest::TestMainJobSucceedsAfterIgnoredError( - int net_error, - bool expect_broken, - std::string alternate_host) { +void HttpStreamFactoryJobControllerTestBase:: + TestMainJobSucceedsAfterIgnoredError(int net_error, + bool expect_broken, + std::string alternate_host) { quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddConnect(SYNCHRONOUS, net_error); tcp_data_ = std::make_unique<SequencedSocketData>(); @@ -2071,27 +2119,27 @@ // Verifies that if the alternative job fails due to a connection change event, // then the alternative service is not marked as broken. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterConnectionChanged) { TestMainJobSucceedsAfterIgnoredError(ERR_NETWORK_CHANGED); } // Verifies that if the alternative job fails due to a disconnected network, // then the alternative service is not marked as broken. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterInternetDisconnected) { TestMainJobSucceedsAfterIgnoredError(ERR_INTERNET_DISCONNECTED); } // Verifies that if the alternative job fails due to a DNS failure, // then the alternative service is not marked as broken. -TEST_F(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterDnsFailure) { +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterDnsFailure) { TestMainJobSucceedsAfterIgnoredError(ERR_NAME_NOT_RESOLVED); } // Verifies that if the alternative job fails due to a DNS failure on a // different name, then the alternative service is marked as broken. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, MainJobSucceedsAfterDnsFailureWithAlternateName) { TestMainJobSucceedsAfterIgnoredError(ERR_NAME_NOT_RESOLVED, true, "alternate.google.com"); @@ -2099,7 +2147,7 @@ // Regression test for crbug/621069. // Get load state after main job fails and before alternative job succeeds. -TEST_F(HttpStreamFactoryJobControllerTest, GetLoadStateAfterMainJobFailed) { +TEST_P(HttpStreamFactoryJobControllerTest, GetLoadStateAfterMainJobFailed) { // Use COLD_START to complete alt job manually. quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); @@ -2146,7 +2194,7 @@ EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); } -TEST_F(HttpStreamFactoryJobControllerTest, ResumeMainJobWhenAltJobStalls) { +TEST_P(HttpStreamFactoryJobControllerTest, ResumeMainJobWhenAltJobStalls) { // Use COLD_START to stall alt job. quic_data_ = std::make_unique<MockQuicData>(version_); quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); @@ -2179,7 +2227,7 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(HttpStreamFactoryJobControllerTest, InvalidPortForQuic) { +TEST_P(HttpStreamFactoryJobControllerTest, InvalidPortForQuic) { HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.google.com"); @@ -2205,7 +2253,7 @@ // Verifies that the main job is not resumed until after the alt job completes // host resolution. -TEST_F(HttpStreamFactoryJobControllerTest, HostResolutionHang) { +TEST_P(HttpStreamFactoryJobControllerTest, HostResolutionHang) { auto hanging_resolver = std::make_unique<MockHostResolver>(); hanging_resolver->set_ondemand_mode(true); hanging_resolver->rules()->AddRule("www.google.com", "1.2.3.4"); @@ -2277,13 +2325,13 @@ // OnStreamFailed will post a task to resume the main job immediately but // won't call Resume() on the main job since it's been resumed already. EXPECT_CALL(*job_factory_.main_job(), Resume()).Times(0); - quic_data.GetSequencedSocketData()->Resume(); + quic_data.Resume(); FastForwardUntilNoTasksRemain(); // Alt job should be cleaned up EXPECT_FALSE(job_controller_->alternative_job()); } -TEST_F(HttpStreamFactoryJobControllerTest, DelayedTCP) { +TEST_P(HttpStreamFactoryJobControllerTest, DelayedTCP) { HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.google.com"); @@ -2338,13 +2386,13 @@ // Unpause mock quic data and run all remaining tasks. Alt-job should fail // and be cleaned up. - quic_data.GetSequencedSocketData()->Resume(); + quic_data.Resume(); FastForwardUntilNoTasksRemain(); EXPECT_FALSE(job_controller_->alternative_job()); } // Regression test for crbug.com/789560. -TEST_F(HttpStreamFactoryJobControllerTest, ResumeMainJobLaterCanceled) { +TEST_P(HttpStreamFactoryJobControllerTest, ResumeMainJobLaterCanceled) { std::unique_ptr<ConfiguredProxyResolutionService> proxy_resolution_service = ConfiguredProxyResolutionService::CreateDirect(); ConfiguredProxyResolutionService* proxy_resolution_service_raw = @@ -2422,7 +2470,7 @@ // http_server_properties cached an inappropriate large srtt for the server, // which would potentially delay the main job for a extremely long time in // delayed tcp case. -TEST_F(HttpStreamFactoryJobControllerTest, DelayedTCPWithLargeSrtt) { +TEST_P(HttpStreamFactoryJobControllerTest, DelayedTCPWithLargeSrtt) { // The max delay time should be in sync with .cc file. base::TimeDelta kMaxDelayTimeForMainJob = base::Seconds(3); @@ -2479,14 +2527,14 @@ // Unpause mock quic data and run all remaining tasks. Alt-job should fail // and be cleaned up. - quic_data.GetSequencedSocketData()->Resume(); + quic_data.Resume(); FastForwardUntilNoTasksRemain(); EXPECT_FALSE(job_controller_->alternative_job()); } // TODO(https://crbug.com/1007502): Disabled because the pending task count does // not match expectations. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, DISABLED_ResumeMainJobImmediatelyOnStreamFailed) { HttpRequestInfo request_info; request_info.method = "GET"; @@ -2538,7 +2586,7 @@ // Now unpause the mock quic data to fail the alt job. This should immediately // resume the main job. EXPECT_CALL(*job_factory_.main_job(), Resume()).Times(1); - quic_data.GetSequencedSocketData()->Resume(); + quic_data.Resume(); FastForwardBy(base::TimeDelta()); EXPECT_TRUE(job_controller_->main_job()); @@ -2554,7 +2602,7 @@ FastForwardUntilNoTasksRemain(); } -TEST_F(HttpStreamFactoryJobControllerTest, PreconnectToHostWithValidAltSvc) { +TEST_P(HttpStreamFactoryJobControllerTest, PreconnectToHostWithValidAltSvc) { quic_data_ = std::make_unique<MockQuicData>(version_); if (version_.UsesHttp3()) { quic_data_->AddWrite(SYNCHRONOUS, @@ -2584,7 +2632,7 @@ } // When preconnect to a H2 supported server, only 1 connection is opened. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, PreconnectMultipleStreamsToH2Server) { tcp_data_ = std::make_unique<SequencedSocketData>(); tcp_data_->set_connect_data(MockConnect(ASYNC, OK)); @@ -2616,7 +2664,7 @@ // Check that the logic to only preconnect a single socket to servers with H2 // support respects NetworkIsolationKeys. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, PreconnectMultipleStreamsToH2ServerWithNetworkIsolationKey) { base::test::ScopedFeatureList feature_list; // It's not strictly necessary to enable @@ -2704,7 +2752,7 @@ } } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, DonotDelayMainJobIfHasAvailableSpdySession) { SetNotDelayMainJobWithAvailableSpdySession(); HttpRequestInfo request_info; @@ -2758,7 +2806,7 @@ // Check the case that while a preconnect is waiting in the H2 request queue, // and a SPDY session appears, the job completes successfully. -TEST_F(HttpStreamFactoryJobControllerTest, SpdySessionInterruptsPreconnect) { +TEST_P(HttpStreamFactoryJobControllerTest, SpdySessionInterruptsPreconnect) { // Make sure there is only one socket connect. MockWrite writes[] = {MockWrite(SYNCHRONOUS, ERR_IO_PENDING, 0)}; MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 1)}; @@ -2832,7 +2880,7 @@ // OnConnectComplete() is called in the end of the test. // [3] Normal non-preconnect request to other.example.org. This request must // succeed even while the preconnect request [2] is paused. -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, PreconnectJobDoesntBlockIpBasedPooling) { // Make sure that both "www.example.org" and "other.example.org" are pointing // to the same IP address. @@ -2879,6 +2927,11 @@ &request_delegate_, /*websocket_handshake_stream_create_helper=*/nullptr, NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, DEFAULT_PRIORITY); + if (dns_https_alpn_enabled()) { + EXPECT_CALL(*job_factory_.main_job(), Resume()) + .Times(1) + .WillOnce([this]() { job_factory_.main_job()->DoResume(); }); + } base::RunLoop run_loop; EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) .WillOnce([&run_loop]() { run_loop.Quit(); }); @@ -2953,6 +3006,11 @@ NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, DEFAULT_PRIORITY); + if (dns_https_alpn_enabled()) { + EXPECT_CALL(*job_factory_.main_job(), Resume()) + .Times(1) + .WillOnce([this]() { job_factory_.main_job()->DoResume(); }); + } base::RunLoop run_loop; EXPECT_CALL(request_delegate, OnStreamReadyImpl(_, _, _)) .WillOnce([&run_loop]() { run_loop.Quit(); }); @@ -2970,8 +3028,10 @@ } class JobControllerLimitMultipleH2Requests - : public HttpStreamFactoryJobControllerTest { + : public HttpStreamFactoryJobControllerTestBase { protected: + JobControllerLimitMultipleH2Requests() + : HttpStreamFactoryJobControllerTestBase(false) {} const int kNumRequests = 5; void SetUp() override { SkipCreatingJobController(); } }; @@ -3432,8 +3492,12 @@ } class HttpStreamFactoryJobControllerMisdirectedRequestRetry - : public HttpStreamFactoryJobControllerTest, - public ::testing::WithParamInterface<::testing::tuple<bool, bool>> {}; + : public HttpStreamFactoryJobControllerTestBase, + public ::testing::WithParamInterface<::testing::tuple<bool, bool>> { + public: + HttpStreamFactoryJobControllerMisdirectedRequestRetry() + : HttpStreamFactoryJobControllerTestBase(false) {} +}; INSTANTIATE_TEST_SUITE_P( All, @@ -3489,9 +3553,12 @@ } class HttpStreamFactoryJobControllerPreconnectTest - : public HttpStreamFactoryJobControllerTest, + : public HttpStreamFactoryJobControllerTestBase, public ::testing::WithParamInterface<bool> { protected: + HttpStreamFactoryJobControllerPreconnectTest() + : HttpStreamFactoryJobControllerTestBase(false) {} + void SetUp() override { if (!GetParam()) { scoped_feature_list_.InitFromCommandLine(std::string(), @@ -3562,7 +3629,7 @@ // Test that GetAlternativeServiceInfoFor will include a list of advertised // versions, which contains a version that is supported. Returns an empty list // if advertised versions are missing in HttpServerProperties. -TEST_F(HttpStreamFactoryJobControllerTest, GetAlternativeServiceInfoFor) { +TEST_P(HttpStreamFactoryJobControllerTest, GetAlternativeServiceInfoFor) { HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.google.com"); @@ -3656,7 +3723,7 @@ EXPECT_EQ(0u, alt_svc_info.advertised_versions().size()); } -void HttpStreamFactoryJobControllerTest::TestAltSvcVersionSelection( +void HttpStreamFactoryJobControllerTestBase::TestAltSvcVersionSelection( const std::string& alt_svc_header, const quic::ParsedQuicVersion& expected_version, const quic::ParsedQuicVersionVector& supported_versions) { @@ -3689,7 +3756,7 @@ << quic::ParsedQuicVersionVectorToString(advertised_versions); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltSvcVersionSelectionFindsFirstMatch) { TestAltSvcVersionSelection( "h3-Q050=\":443\"; ma=2592000," @@ -3700,7 +3767,7 @@ quic::ParsedQuicVersion::Q050(), quic::AllSupportedVersions()); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltSvcVersionSelectionFindsFirstMatchInverse) { TestAltSvcVersionSelection( "h3-Q043=\":443\"; ma=2592000," @@ -3710,7 +3777,7 @@ quic::ParsedQuicVersion::Q043(), quic::AllSupportedVersions()); } -TEST_F(HttpStreamFactoryJobControllerTest, +TEST_P(HttpStreamFactoryJobControllerTest, AltSvcVersionSelectionWithInverseOrderingNewFormat) { // Server prefers Q043 but client prefers Q046. TestAltSvcVersionSelection( @@ -3724,7 +3791,7 @@ // Tests that if HttpNetworkSession has a non-empty QUIC host allowlist, // then GetAlternativeServiceFor() will not return any QUIC alternative service // that's not on the allowlist. -TEST_F(HttpStreamFactoryJobControllerTest, QuicHostAllowlist) { +TEST_P(HttpStreamFactoryJobControllerTest, QuicHostAllowlist) { HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.google.com"); @@ -3779,4 +3846,1017 @@ EXPECT_EQ(0u, alt_svc_info.advertised_versions().size()); } +// Tests specific to UseDnsHttpsAlpn feature. +class HttpStreamFactoryJobControllerDnsHttpsAlpnTest + : public HttpStreamFactoryJobControllerTestBase { + protected: + HttpStreamFactoryJobControllerDnsHttpsAlpnTest() + : HttpStreamFactoryJobControllerTestBase(true) {} + + void SetUp() override { SkipCreatingJobController(); } + + void EnableOndemandHostResolver() { + session_deps_.host_resolver->set_synchronous_mode(false); + session_deps_.host_resolver->set_ondemand_mode(true); + } + + HttpRequestInfo CreateTestHttpRequestInfo() { + HttpRequestInfo request_info; + request_info.method = "GET"; + request_info.url = GURL("https://www.example.org"); + return request_info; + } + + void RegisterMockHttpsRecord() { + HostResolverEndpointResult endpoint_result1; + endpoint_result1.ip_endpoints = {IPEndPoint(IPAddress::IPv4Localhost(), 0)}; + endpoint_result1.metadata.supported_protocol_alpns = { + quic::QuicVersionLabelToString(quic::CreateQuicVersionLabel(version_))}; + + HostResolverEndpointResult endpoint_result2; + endpoint_result2.ip_endpoints = {IPEndPoint(IPAddress::IPv4Localhost(), 0)}; + + std::vector<HostResolverEndpointResult> endpoints; + endpoints.push_back(endpoint_result1); + endpoints.push_back(endpoint_result2); + session_deps_.host_resolver->rules()->AddRule("www.example.org", + std::move(endpoints)); + } + + std::unique_ptr<HttpStreamRequest> CreateJobControllerAndStart( + const HttpRequestInfo& request_info) { + job_controller_ = new HttpStreamFactory::JobController( + factory_, &request_delegate_, session_.get(), &default_job_factory_, + request_info, is_preconnect_, false /* is_websocket */, + enable_ip_based_pooling_, enable_alternative_services_, + delay_main_job_with_available_spdy_session_, SSLConfig(), SSLConfig()); + HttpStreamFactoryPeer::AddJobController(factory_, job_controller_); + return job_controller_->Start( + &request_delegate_, nullptr, net_log_with_source_, + HttpStreamRequest::HTTP_STREAM, DEFAULT_PRIORITY); + } + + void PrepareForMainJob() { + tcp_data_ = std::make_unique<SequencedSocketData>(); + tcp_data_->set_connect_data(MockConnect(ASYNC, ERR_IO_PENDING)); /* pause */ + ssl_data_ = std::make_unique<SSLSocketDataProvider>(ASYNC, OK); + session_deps_.socket_factory->AddSSLSocketDataProvider(ssl_data_.get()); + } + + void PrepareForFirstQuicJob() { + crypto_client_stream_factory_.set_handshake_mode( + MockCryptoClientStream::COLD_START); + quic_data_ = std::make_unique<MockQuicData>(version_); + quic_data_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); + if (version_.UsesHttp3()) { + quic_data_->AddWrite( + SYNCHRONOUS, + CreateQuicTestPacketMakerForClient().MakeInitialSettingsPacket(1)); + } + } + void PrepareForFirstQuicJobFailure() { + crypto_client_stream_factory_.set_handshake_mode( + MockCryptoClientStream::COLD_START); + quic_data_ = std::make_unique<MockQuicData>(version_); + quic_data_->AddRead(ASYNC, ERR_IO_PENDING); // Pause + quic_data_->AddRead(ASYNC, ERR_FAILED); + } + + void PrepareForSecondQuicJob() { + quic_data2_ = std::make_unique<MockQuicData>(version_); + quic_data2_->AddRead(SYNCHRONOUS, ERR_IO_PENDING); + if (version_.UsesHttp3()) { + quic_data2_->AddWrite( + SYNCHRONOUS, + CreateQuicTestPacketMakerForClient().MakeInitialSettingsPacket(1)); + } + } + + void MakeMainJobSucceed(bool expect_stream_ready) { + if (expect_stream_ready) { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + tcp_data_->socket()->OnConnectComplete(MockConnect()); + run_loop.Run(); + } else { + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)).Times(0); + tcp_data_->socket()->OnConnectComplete(MockConnect()); + base::RunLoop().RunUntilIdle(); + } + } + + void MakeQuicJobScceed(size_t index, bool expect_stream_ready) { + ASSERT_GT(crypto_client_stream_factory_.streams().size(), index); + MockCryptoClientStream* stream = + crypto_client_stream_factory_.streams()[index].get(); + ASSERT_TRUE(stream); + + if (expect_stream_ready) { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + stream->NotifySessionOneRttKeyAvailable(); + run_loop.Run(); + } else { + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)).Times(0); + stream->NotifySessionOneRttKeyAvailable(); + base::RunLoop().RunUntilIdle(); + } + } + + void CheckJobsStatus(bool main_job_exists, + bool alternative_job_exists, + bool dns_alpn_h3_job_exists, + const std::string& scoped_trace_message = "") { + SCOPED_TRACE(scoped_trace_message); + EXPECT_EQ(main_job_exists, !!job_controller_->main_job()); + EXPECT_EQ(alternative_job_exists, !!job_controller_->alternative_job()); + EXPECT_EQ(dns_alpn_h3_job_exists, !!job_controller_->dns_alpn_h3_job()); + } + + std::unique_ptr<QuicHttpStream> ConnectQuicHttpStream( + bool alt_destination, + bool require_dns_https_alpn) { + NetErrorDetails net_error_details; + QuicStreamRequest quic_request(session_->quic_stream_factory()); + url::SchemeHostPort scheme_host_port( + url::kHttpsScheme, + alt_destination ? "alt.example.org" : "www.example.org", 443); + absl::optional<int> quic_request_result; + + CHECK_EQ(ERR_IO_PENDING, + quic_request.Request( + scheme_host_port, + require_dns_https_alpn ? quic::ParsedQuicVersion::Unsupported() + : version_, + PRIVACY_MODE_DISABLED, DEFAULT_PRIORITY, SocketTag(), + NetworkIsolationKey(), SecureDnsPolicy::kAllow, + /*use_dns_aliases=*/true, require_dns_https_alpn, + /*cert_verify_flags=*/0, GURL("https://www.example.org/"), + net_log_with_source_, &net_error_details, + base::BindLambdaForTesting([&](int result) {}), + base::BindLambdaForTesting([&quic_request_result](int result) { + quic_request_result = result; + }))); + CHECK_EQ(1u, crypto_client_stream_factory_.streams().size()); + CHECK(crypto_client_stream_factory_.streams()[0]); + crypto_client_stream_factory_.streams()[0] + ->NotifySessionOneRttKeyAvailable(); + base::RunLoop().RunUntilIdle(); + CHECK(quic_request_result); + CHECK_EQ(OK, *quic_request_result); + + std::unique_ptr<QuicChromiumClientSession::Handle> session = + quic_request.ReleaseSessionHandle(); + std::set<std::string> dns_aliases = + session->GetDnsAliasesForSessionKey(quic_request.session_key()); + auto stream = std::make_unique<QuicHttpStream>(std::move(session), + std::move(dns_aliases)); + return stream; + } + + bool IsAlternativeServiceBroken(GURL& url) { + return session_->http_server_properties()->IsAlternativeServiceBroken( + AlternativeService(kProtoQUIC, HostPortPair::FromURL(url)), + NetworkIsolationKey()); + } + + private: + QuicTestPacketMaker CreateQuicTestPacketMakerForClient() { + return QuicTestPacketMaker(version_, + quic::QuicUtils::CreateRandomConnectionId( + quic_context_.random_generator()), + quic_context_.clock(), "www.example.org", + quic::Perspective::IS_CLIENT, false); + } + + // Use real Jobs so that Job::Resume() is not mocked out. When main job is + // resumed it will use mock socket data. + HttpStreamFactory::JobFactory default_job_factory_; + + // Used for man job connection. + std::unique_ptr<SSLSocketDataProvider> ssl_data_; +}; + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + NoHttpsRecordSyncHostResolve) { + PrepareForMainJob(); + Initialize(HttpRequestInfo()); + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + // The main job should be synchronously resumed, as host is resolved + // synchronously. + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + base::RunLoop().RunUntilIdle(); + + // |dns_alpn_h3_job| must fail when there is no valid supported alpn. And + // must be deleted. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS ALPN job must be deleted."); + + base::HistogramTester histogram_tester; + MakeMainJobSucceed(/*expect_stream_ready=*/true); + // Net.AlternateProtocolUsage must not record anything, when HTTPS record with + // alpn is not available. + histogram_tester.ExpectTotalCount("Net.AlternateProtocolUsage", 0); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + NoHttpsRecordAsyncHostResolveResumeMainWithoutDelay) { + EnableOndemandHostResolver(); + PrepareForMainJob(); + Initialize(HttpRequestInfo()); + + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + // The main job should be resumed quickly after resolving the host. + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + + // Resolve the host resolve request from |dns_alpn_h3_job|. + session_deps_.host_resolver->ResolveAllPending(); + base::RunLoop().RunUntilIdle(); + + // |dns_alpn_h3_job| must fail when there is no valid supported alpn. And + // must be deleted. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS ALPN job must be deleted."); + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + // The host resolve request from the main job must be resolved using the + // cached result. + EXPECT_TRUE(tcp_data_->socket()); + + base::HistogramTester histogram_tester; + MakeMainJobSucceed(/*expect_stream_ready=*/true); + // Net.AlternateProtocolUsage must not record anything, when HTTPS record with + // alpn is not available. + histogram_tester.ExpectTotalCount("Net.AlternateProtocolUsage", 0); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + NoHttpsRecordAsyncHostResolveResumeMainWithoutDelayQuicWorkedNetwork) { + EnableOndemandHostResolver(); + PrepareForMainJob(); + Initialize(HttpRequestInfo()); + + QuicStreamFactory* quic_stream_factory = session_->quic_stream_factory(); + quic_stream_factory->set_is_quic_known_to_work_on_current_network(true); + + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + // Main job must be waiting. + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + + // Resolve the host resolve request from |dns_alpn_h3_job|. + session_deps_.host_resolver->ResolveAllPending(); + base::RunLoop().RunUntilIdle(); + + // |dns_alpn_h3_job| must fail when there is no valid supported alpn. And + // must be deleted. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS ALPN job must be deleted."); + // The main job should be resumed quickly after resolving the host. + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + // The host resolve request from the main job must be resolved using the + // cached result. + EXPECT_TRUE(tcp_data_->socket()); + + base::HistogramTester histogram_tester; + MakeMainJobSucceed(/*expect_stream_ready=*/true); + // Net.AlternateProtocolUsage must not record anything, when HTTPS record with + // alpn is not available. + histogram_tester.ExpectTotalCount("Net.AlternateProtocolUsage", 0); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + MainJobNoDelayOnQuicNotWorkedNetworkSyncHostResolve) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + // |main_job| is not blocked, because the hostname is resolved synchronously + // and |is_quic_known_to_work_on_current_network| is false for this test. + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // The success of |dns_alpn_h3_job| deletes |main_job|. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Main job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + MainJobNoDelayOnQuicNotWorkedNetworkAsyncHostResolve) { + EnableOndemandHostResolver(); + PrepareForMainJob(); + PrepareForFirstQuicJob(); + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + // |main_job| is blocked until host resolves. + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + + // Resolve the host resolve request from |dns_alpn_h3_job|. + session_deps_.host_resolver->ResolveAllPending(); + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + base::RunLoop().RunUntilIdle(); + + // |main_job| should have been resumed quickly because + // |is_quic_known_to_work_on_current_network| is false for this test. + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + // |dns_alpn_h3_job| must not fail when there is a valid supported alpn. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Both main job and DNS ALPN job must be alive"); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // The success of |dns_alpn_h3_job| deletes |main_job|. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Main job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + MainJobDelayOnQuicWorkedNetwork) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + QuicStreamFactory* quic_stream_factory = session_->quic_stream_factory(); + quic_stream_factory->set_is_quic_known_to_work_on_current_network(true); + + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + base::RunLoop().RunUntilIdle(); + // |dns_alpn_h3_job| must not fail when there is a valid supported alpn. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Both main job and DNS ALPN job must be alive"); + + // The main job should be waiting until kDefaultDelayMilliSecsForWaitingJob + // amount of time has passed. + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + FastForwardBy(base::Milliseconds(kDefaultDelayMilliSecsForWaitingJob - 1)); + EXPECT_TRUE(job_controller_->main_job()->is_waiting()); + FastForwardBy(base::Milliseconds(1)); + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // The success of |dns_alpn_h3_job| deletes |main_job|. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Main job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + MainJobSucceedsDnsAlpnH3JobSucceeds) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + base::RunLoop().RunUntilIdle(); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + // |main_job| is not blocked, because the hostname is resolved synchronously + // and |is_quic_known_to_work_on_current_network| is false for this test. + EXPECT_FALSE(job_controller_->main_job()->is_waiting()); + + base::HistogramTester histogram_tester; + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, + 1); + + // The success of |main_job| doesn't delete |dns_alpn_h3_job|. + EXPECT_TRUE(job_controller_->dns_alpn_h3_job()); + + // Make |dns_alpn_h3_job| complete. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + ActiveSessionAvailableForMainJob) { + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + PrepareForFirstQuicJob(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + // Put a SpdySession in the pool. + SpdySessionKey key(HostPortPair::FromURL(request_info.url), + ProxyServer::Direct(), PRIVACY_MODE_DISABLED, + SpdySessionKey::IsProxySession::kFalse, SocketTag(), + NetworkIsolationKey(), SecureDnsPolicy::kAllow); + std::ignore = CreateFakeSpdySession(session_->spdy_session_pool(), key); + + request_ = CreateJobControllerAndStart(request_info); + // |dns_alpn_h3_job| must be created even when an active session is + // available for |main_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + base::HistogramTester histogram_tester; + // Run the message loop to make |main_job| succeed and status will be + // reported to Request. + { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + run_loop.Run(); + } + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, + 1); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "DNS ALPN job must be alive"); + + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS ALPN job must be deleted"); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + ActiveSessionAvailableForAltSvcJob) { + PrepareForMainJob(); + RegisterMockHttpsRecord(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + PrepareForFirstQuicJob(); + + Initialize(HttpRequestInfo()); + + auto stream = ConnectQuicHttpStream(/*alt_destination=*/true, + /*require_dns_https_alpn=*/false); + + url::SchemeHostPort server(request_info.url); + AlternativeService alternative_service(kProtoQUIC, "alt.example.org", 443); + SetAlternativeService(request_info, alternative_service); + + request_ = CreateJobControllerAndStart(request_info); + + // |dns_alpn_h3_job| must not be created when an active session is + // available for |alternative_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/false, + "Main job and alternative job must be created."); + + base::HistogramTester histogram_tester; + // Run the message loop to make |alternative_job| succeed and status will be + // reported to Request. + { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + run_loop.Run(); + } + histogram_tester.ExpectUniqueSample("Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_NO_RACE, 1); + + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/false, + "Main job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + ActiveSessionAvailableForDnsAlpnH3Job) { + PrepareForFirstQuicJob(); + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + auto stream = ConnectQuicHttpStream(/*alt_destination=*/false, + /*require_dns_https_alpn=*/true); + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and alternative job must not be available."); + + base::HistogramTester histogram_tester; + // Run the message loop to make |dns_alpn_h3_job| succeed and status will be + // reported to Request. + { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + run_loop.Run(); + } + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE, 1); + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "DNS alpn H3 job must exist."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + ActiveSessionAvailableForMainJobAndDnsAlpnH3Job) { + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + PrepareForFirstQuicJob(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + // Put a SpdySession in the pool. + SpdySessionKey key(HostPortPair::FromURL(request_info.url), + ProxyServer::Direct(), PRIVACY_MODE_DISABLED, + SpdySessionKey::IsProxySession::kFalse, SocketTag(), + NetworkIsolationKey(), SecureDnsPolicy::kAllow); + std::ignore = CreateFakeSpdySession(session_->spdy_session_pool(), key); + + auto stream = ConnectQuicHttpStream(/*alt_destination=*/false, + /*require_dns_https_alpn=*/true); + request_ = CreateJobControllerAndStart(CreateTestHttpRequestInfo()); + + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job must not be available."); + + base::HistogramTester histogram_tester; + // Run the message loop to make |dns_alpn_h3_job| succeed and status will be + // reported to Request. + { + base::RunLoop run_loop; + EXPECT_CALL(request_delegate_, OnStreamReadyImpl(_, _, _)) + .Times(1) + .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); + run_loop.Run(); + } + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE, 1); + + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "DNS alpn H3 job must exist."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + DonotStartDnsAlpnH3JobWhenSameHostDefaultPortAltJobCreated) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + url::SchemeHostPort server(request_info.url); + AlternativeService alternative_service(kProtoQUIC, "www.example.org", 443); + SetAlternativeService(request_info, alternative_service); + + request_ = CreateJobControllerAndStart(request_info); + // |dns_alpn_h3_job| must be deleted when a same origin alt service + // was registered. + CheckJobsStatus( + true, true, false, + "All types of jobs are created, but DNS alpn job must be deleted"); + + base::HistogramTester histogram_tester; + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, + 1); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/false, + "Alternate job must not be deleted"); + + // Make |alternative_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + AllJobsCreatedMainJobSucceedAltJobSucceedDnsJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + PrepareForSecondQuicJob(); + + // Use cold start and complete `alternative_job` and `dns_alpn_h3_job` + // manually. + crypto_client_stream_factory_.set_handshake_mode( + MockCryptoClientStream::COLD_START); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + url::SchemeHostPort server(request_info.url); + AlternativeService alternative_service(kProtoQUIC, "alt.example.org", 443); + SetAlternativeService(request_info, alternative_service); + + request_ = CreateJobControllerAndStart(request_info); + // |dns_alpn_h3_job| must be created when a different origin alt service + // was registered. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, + "All types of jobs are created"); + + base::HistogramTester histogram_tester; + MakeMainJobSucceed(/*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, + 1); + + // The success of |main_job| doesn't delete |alternative_job| and + // |dns_alpn_h3_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + // Make |alternative_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Alternate job must be deleted."); + + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(1, /*expect_stream_ready=*/false); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS alpn job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + AllJobsCreatedAltJobSucceedDnsJobSucceedMainJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + PrepareForSecondQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + url::SchemeHostPort server(request_info.url); + AlternativeService alternative_service(kProtoQUIC, "alt.example.org", 443); + SetAlternativeService(request_info, alternative_service); + + request_ = CreateJobControllerAndStart(request_info); + // |dns_alpn_h3_job| must be created when a different origin alt service + // was registered. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, + "All types of jobs are created"); + + base::HistogramTester histogram_tester; + // Make |alternative_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample("Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_WON_RACE, 1); + + // The success of |alternative_job| doesn't delete |main_job| and + // |dns_alpn_h3_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(1, /*expect_stream_ready=*/false); + + // The success of |dns_alpn_h3_job| doesn't delete |main_job| and + // |alternative_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/false, + "DNS alpn job must be deleted."); + + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/false); + + // |main_job| should be cleared. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/false, + "Alternate job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + AllJobsCreatedDnsJobSucceedAltJobSucceedMainJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + PrepareForSecondQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + + url::SchemeHostPort server(request_info.url); + AlternativeService alternative_service(kProtoQUIC, "alt.example.org", 443); + SetAlternativeService(request_info, alternative_service); + + request_ = CreateJobControllerAndStart(request_info); + // |dns_alpn_h3_job| must be created when a different origin alt service + // was registered. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, + "All types of jobs are created"); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(1, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // The success of |dns_alpn_h3_job| doesn't delete |main_job| and + // |alternative_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/true, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + // Make |alternative_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + + // The success of |alternative_job| doesn't delete |main_job| and + // |dns_alpn_h3_job|. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Alternate job must be deleted."); + + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/false); + + // |main_job| should be cleared. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Main job must be deleted."); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + DnsJobFailOnDefaultNetworkDnsJobFailMainJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJobFailure(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + request_ = CreateJobControllerAndStart(request_info); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + JobControllerPeer::SetDnsAlpnH3JobFailedOnDefaultNetwork(job_controller_); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| fail. + quic_data_->Resume(); + base::RunLoop().RunUntilIdle(); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, "DNS alpn job be deleted."); + + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/true); + // Net.AlternateProtocolUsage must not record anything, when DNS alpn job + // failed. + histogram_tester.ExpectTotalCount("Net.AlternateProtocolUsage", 0); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/false, + "DNS alpn job must be deleted."); + + request_.reset(); + EXPECT_TRUE(IsAlternativeServiceBroken(request_info.url)); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); + histogram_tester.ExpectUniqueSample("Net.AlternateServiceForDnsAlpnH3Failed", + -ERR_QUIC_PROTOCOL_ERROR, 1); + + // Verify the brokenness is not cleared when the default network changes. + session_->http_server_properties()->OnDefaultNetworkChanged(); + EXPECT_TRUE(IsAlternativeServiceBroken(request_info.url)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + DnsJobFailOnDefaultNetworkMainJobSucceedDnsJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + base::HistogramTester histogram_tester; + request_ = CreateJobControllerAndStart(request_info); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + JobControllerPeer::SetDnsAlpnH3JobFailedOnDefaultNetwork(job_controller_); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE, + 1); + + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "DNS alpn job must not be deleted."); + + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/false); + + request_.reset(); + histogram_tester.ExpectTotalCount("Net.AlternateServiceForDnsAlpnH3Failed", + 0); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); + EXPECT_TRUE(IsAlternativeServiceBroken(request_info.url)); + + // Verify the brokenness is cleared when the default network changes. + session_->http_server_properties()->OnDefaultNetworkChanged(); + EXPECT_FALSE(IsAlternativeServiceBroken(request_info.url)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + DnsJobSucceedMainJobCanceled) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + request_ = CreateJobControllerAndStart(request_info); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // Main job is canceled. + CheckJobsStatus(/*main_job_exists=*/false, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Main job must be deleted"); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + +TEST_F(HttpStreamFactoryJobControllerDnsHttpsAlpnTest, + DnsJobFailOnDefaultNetworkDnsJobSucceedMainJobSucceed) { + PrepareForMainJob(); + PrepareForFirstQuicJob(); + + HttpRequestInfo request_info = CreateTestHttpRequestInfo(); + + RegisterMockHttpsRecord(); + + Initialize(HttpRequestInfo()); + request_ = CreateJobControllerAndStart(request_info); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job and DNS ALPN job must be created."); + + JobControllerPeer::SetDnsAlpnH3JobFailedOnDefaultNetwork(job_controller_); + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, "Jobs must not be deleted."); + + base::HistogramTester histogram_tester; + // Make |dns_alpn_h3_job| succeed. + MakeQuicJobScceed(0, /*expect_stream_ready=*/true); + histogram_tester.ExpectUniqueSample( + "Net.AlternateProtocolUsage", + ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE, 1); + + // Main job is not canceled, because |dns_alpn_h3_job| has failed on the + // default network. + CheckJobsStatus(/*main_job_exists=*/true, /*alternative_job_exists=*/false, + /*dns_alpn_h3_job_exists=*/true, + "Main job must not be deleted."); + + // Make |main_job| succeed. + MakeMainJobSucceed(/*expect_stream_ready=*/false); + + request_.reset(); + EXPECT_TRUE(HttpStreamFactoryPeer::IsJobControllerDeleted(factory_)); +} + } // namespace net::test
diff --git a/net/http/http_stream_factory_test_util.cc b/net/http/http_stream_factory_test_util.cc index 5b7a376b..4ff0eee 100644 --- a/net/http/http_stream_factory_test_util.cc +++ b/net/http/http_stream_factory_test_util.cc
@@ -52,11 +52,15 @@ MockHttpStreamFactoryJob::~MockHttpStreamFactoryJob() = default; +void MockHttpStreamFactoryJob::DoResume() { + HttpStreamFactory::Job::Resume(); +} + TestJobFactory::TestJobFactory() = default; TestJobFactory::~TestJobFactory() = default; -std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateMainJob( +std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateJob( HttpStreamFactory::Job::Delegate* delegate, HttpStreamFactory::JobType job_type, HttpNetworkSession* session, @@ -69,48 +73,32 @@ GURL origin_url, bool is_websocket, bool enable_ip_based_pooling, - NetLog* net_log) { - if (override_main_job_url_) - origin_url = main_job_alternative_url_; - - auto main_job = std::make_unique<MockHttpStreamFactoryJob>( - delegate, job_type, session, request_info, priority, proxy_info, - SSLConfig(), SSLConfig(), std::move(destination), origin_url, - kProtoUnknown, quic::ParsedQuicVersion::Unsupported(), is_websocket, - enable_ip_based_pooling, net_log); - - // Keep raw pointer to Job but pass ownership. - main_job_ = main_job.get(); - - return std::move(main_job); -} - -std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateAltSvcJob( - HttpStreamFactory::Job::Delegate* delegate, - HttpStreamFactory::JobType job_type, - HttpNetworkSession* session, - const HttpRequestInfo& request_info, - RequestPriority priority, - const ProxyInfo& proxy_info, - const SSLConfig& server_ssl_config, - const SSLConfig& proxy_ssl_config, - url::SchemeHostPort destination, - GURL origin_url, - NextProto alternative_protocol, - quic::ParsedQuicVersion quic_version, - bool is_websocket, - bool enable_ip_based_pooling, - NetLog* net_log) { - auto alternative_job = std::make_unique<MockHttpStreamFactoryJob>( + NetLog* net_log, + NextProto alternative_protocol = kProtoUnknown, + quic::ParsedQuicVersion quic_version = + quic::ParsedQuicVersion::Unsupported()) { + auto job = std::make_unique<MockHttpStreamFactoryJob>( delegate, job_type, session, request_info, priority, proxy_info, SSLConfig(), SSLConfig(), std::move(destination), origin_url, alternative_protocol, quic_version, is_websocket, enable_ip_based_pooling, net_log); // Keep raw pointer to Job but pass ownership. - alternative_job_ = alternative_job.get(); - - return std::move(alternative_job); + switch (job_type) { + case HttpStreamFactory::MAIN: + main_job_ = job.get(); + break; + case HttpStreamFactory::ALTERNATIVE: + alternative_job_ = job.get(); + break; + case HttpStreamFactory::DNS_ALPN_H3: + dns_alpn_h3_job_ = job.get(); + break; + case HttpStreamFactory::PRECONNECT: + main_job_ = job.get(); + break; + } + return job; } } // namespace net
diff --git a/net/http/http_stream_factory_test_util.h b/net/http/http_stream_factory_test_util.h index ac89b431..4aed769f 100644 --- a/net/http/http_stream_factory_test_util.h +++ b/net/http/http_stream_factory_test_util.h
@@ -125,6 +125,8 @@ MOCK_METHOD0(Resume, void()); MOCK_METHOD0(Orphan, void()); + + void DoResume(); }; // JobFactory for creating MockHttpStreamFactoryJobs. @@ -133,7 +135,7 @@ TestJobFactory(); ~TestJobFactory() override; - std::unique_ptr<HttpStreamFactory::Job> CreateMainJob( + std::unique_ptr<HttpStreamFactory::Job> CreateJob( HttpStreamFactory::Job::Delegate* delegate, HttpStreamFactory::JobType job_type, HttpNetworkSession* session, @@ -146,38 +148,18 @@ GURL origin_url, bool is_websocket, bool enable_ip_based_pooling, - NetLog* net_log) override; - - std::unique_ptr<HttpStreamFactory::Job> CreateAltSvcJob( - HttpStreamFactory::Job::Delegate* delegate, - HttpStreamFactory::JobType job_type, - HttpNetworkSession* session, - const HttpRequestInfo& request_info, - RequestPriority priority, - const ProxyInfo& proxy_info, - const SSLConfig& server_ssl_config, - const SSLConfig& proxy_ssl_config, - url::SchemeHostPort destination, - GURL origin_url, + NetLog* net_log, NextProto alternative_protocol, - quic::ParsedQuicVersion quic_version, - bool is_websocket, - bool enable_ip_based_pooling, - NetLog* net_log) override; + quic::ParsedQuicVersion quic_version) override; MockHttpStreamFactoryJob* main_job() const { return main_job_; } MockHttpStreamFactoryJob* alternative_job() const { return alternative_job_; } - - void UseDifferentURLForMainJob(GURL url) { - override_main_job_url_ = true; - main_job_alternative_url_ = url; - } + MockHttpStreamFactoryJob* dns_alpn_h3_job() const { return dns_alpn_h3_job_; } private: raw_ptr<MockHttpStreamFactoryJob> main_job_ = nullptr; raw_ptr<MockHttpStreamFactoryJob> alternative_job_ = nullptr; - bool override_main_job_url_ = false; - GURL main_job_alternative_url_; + raw_ptr<MockHttpStreamFactoryJob> dns_alpn_h3_job_ = nullptr; }; } // namespace net
diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h index dc199c7..6f28dba 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h
@@ -1118,8 +1118,11 @@ // "original_url": <The URL to create a stream for>, // "url": <The URL actually being used, possibly different from // original_url if using an alternate service>, -// "alternate_service": <The alternate service being used>, +// "expect_spdy": <Boolean indicating whether the Job will use SPDY>, +// "using_quic": <Boolean indicating whether the Job will use QUIC>, // "priority": <The priority of the Job>, +// "type": <The type of this Job ("main", "alternative", "dns_alpn_h3", +// "preconnect")>, // } EVENT_TYPE(HTTP_STREAM_JOB)
diff --git a/net/quic/mock_crypto_client_stream.h b/net/quic/mock_crypto_client_stream.h index d6bf54b..0abfd5e 100644 --- a/net/quic/mock_crypto_client_stream.h +++ b/net/quic/mock_crypto_client_stream.h
@@ -6,6 +6,7 @@ #define NET_QUIC_MOCK_CRYPTO_CLIENT_STREAM_H_ #include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" #include "net/quic/crypto/proof_verifier_chromium.h" #include "net/third_party/quiche/src/quiche/quic/core/crypto/crypto_handshake.h" #include "net/third_party/quiche/src/quiche/quic/core/crypto/crypto_protocol.h" @@ -88,6 +89,10 @@ // Notify session that 0-RTT setup is complete. void NotifySessionZeroRttComplete(); + base::WeakPtr<MockCryptoClientStream> GetWeakPtr() { + return weak_factory_.GetWeakPtr(); + } + static quic::CryptoHandshakeMessage GetDummyCHLOMessage(); protected: @@ -111,6 +116,7 @@ const quic::QuicServerId server_id_; raw_ptr<const net::ProofVerifyDetailsChromium> proof_verify_details_; const quic::QuicConfig config_; + base::WeakPtrFactory<MockCryptoClientStream> weak_factory_{this}; }; } // namespace net
diff --git a/net/quic/mock_crypto_client_stream_factory.cc b/net/quic/mock_crypto_client_stream_factory.cc index f60b3a1..8f901443 100644 --- a/net/quic/mock_crypto_client_stream_factory.cc +++ b/net/quic/mock_crypto_client_stream_factory.cc
@@ -32,10 +32,16 @@ proof_verify_details = proof_verify_details_queue_.front(); proof_verify_details_queue_.pop(); } - last_stream_ = new MockCryptoClientStream( + raw_ptr<MockCryptoClientStream> stream = new MockCryptoClientStream( server_id, session, nullptr, *(config_.get()), crypto_config, handshake_mode_, proof_verify_details, use_mock_crypter_); - return last_stream_; + streams_.push_back(stream->GetWeakPtr()); + return stream; +} + +MockCryptoClientStream* MockCryptoClientStreamFactory::last_stream() const { + CHECK(!streams_.empty()); + return streams_.back().get(); } } // namespace net
diff --git a/net/quic/mock_crypto_client_stream_factory.h b/net/quic/mock_crypto_client_stream_factory.h index 2a703b8..0a4d6efc 100644 --- a/net/quic/mock_crypto_client_stream_factory.h +++ b/net/quic/mock_crypto_client_stream_factory.h
@@ -6,6 +6,7 @@ #define NET_QUIC_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ #include <memory> +#include <vector> #include "base/containers/queue.h" #include "base/memory/raw_ptr.h" @@ -50,7 +51,10 @@ proof_verify_details_queue_.push(proof_verify_details); } - MockCryptoClientStream* last_stream() const { return last_stream_; } + MockCryptoClientStream* last_stream() const; + const std::vector<base::WeakPtr<MockCryptoClientStream>>& streams() const { + return streams_; + } // Sets initial config for new sessions. void SetConfig(const quic::QuicConfig& config); @@ -58,7 +62,7 @@ private: MockCryptoClientStream::HandshakeMode handshake_mode_ = MockCryptoClientStream::CONFIRM_HANDSHAKE; - raw_ptr<MockCryptoClientStream> last_stream_ = nullptr; + std::vector<base::WeakPtr<MockCryptoClientStream>> streams_; base::queue<const ProofVerifyDetailsChromium*> proof_verify_details_queue_; std::unique_ptr<quic::QuicConfig> config_; bool use_mock_crypter_ = false;
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc index 75f6d15a..d6c3e6b 100644 --- a/net/quic/quic_stream_factory.cc +++ b/net/quic/quic_stream_factory.cc
@@ -1136,6 +1136,21 @@ session_ = std::move(session); } +bool QuicStreamRequest::CanUseExistingSession( + const GURL& url, + PrivacyMode privacy_mode, + const SocketTag& socket_tag, + const NetworkIsolationKey& network_isolation_key, + SecureDnsPolicy secure_dns_policy, + bool require_dns_https_alpn, + const url::SchemeHostPort& destination) const { + return factory_->CanUseExistingSession( + QuicSessionKey(HostPortPair::FromURL(url), privacy_mode, socket_tag, + network_isolation_key, secure_dns_policy, + require_dns_https_alpn), + destination); +} + QuicStreamFactory::QuicSessionAliasKey::QuicSessionAliasKey( url::SchemeHostPort destination, QuicSessionKey session_key) @@ -1234,13 +1249,15 @@ bool QuicStreamFactory::CanUseExistingSession( const QuicSessionKey& session_key, - const url::SchemeHostPort& destination) { + const url::SchemeHostPort& destination) const { if (base::Contains(active_sessions_, session_key)) return true; for (const auto& key_value : active_sessions_) { QuicChromiumClientSession* session = key_value.second; - if (destination == all_sessions_[session].destination() && + const auto& it = all_sessions_.find(session); + if ((it != all_sessions_.end()) && + (destination == it->second.destination()) && session->CanPool(session_key.host(), session_key)) { return true; }
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h index c509693..cc52bec 100644 --- a/net/quic/quic_stream_factory.h +++ b/net/quic/quic_stream_factory.h
@@ -183,6 +183,14 @@ const NetLogWithSource& net_log() const { return net_log_; } + bool CanUseExistingSession(const GURL& url, + PrivacyMode privacy_mode, + const SocketTag& socket_tag, + const NetworkIsolationKey& network_isolation_key, + SecureDnsPolicy secure_dns_policy, + bool require_dns_https_alpn, + const url::SchemeHostPort& destination) const; + private: raw_ptr<QuicStreamFactory> factory_; QuicSessionKey session_key_; @@ -258,7 +266,7 @@ // request can be pooled to an existing session to the IP address of // |destination|. bool CanUseExistingSession(const QuicSessionKey& session_key, - const url::SchemeHostPort& destination); + const url::SchemeHostPort& destination) const; // Fetches a QuicChromiumClientSession to |host_port_pair| which will be // owned by |request|.
diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn index 5361116a..7c7dd11 100644 --- a/services/network/BUILD.gn +++ b/services/network/BUILD.gn
@@ -77,6 +77,10 @@ "network_quality_estimator_manager.h", "network_service.cc", "network_service.h", + "network_service_memory_cache.cc", + "network_service_memory_cache.h", + "network_service_memory_cache_writer.cc", + "network_service_memory_cache_writer.h", "network_service_network_delegate.cc", "network_service_network_delegate.h", "network_service_proxy_delegate.cc", @@ -357,6 +361,7 @@ "network_context_unittest.cc", "network_qualities_pref_delegate_unittest.cc", "network_quality_estimator_manager_unittest.cc", + "network_service_memory_cache_unittest.cc", "network_service_proxy_delegate_unittest.cc", "network_service_unittest.cc", "pending_callback_chain_unittest.cc",
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index 9fbb457b9..9f9d54b 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -2178,6 +2178,13 @@ return &http_auth_merged_preferences_; } +NetworkServiceMemoryCache* NetworkContext::GetMemoryCache() { + if (!base::FeatureList::IsEnabled(features::kNetworkServiceMemoryCache)) { + return nullptr; + } + return &memory_cache_; +} + size_t NetworkContext::NumOpenWebTransports() const { return std::count_if(web_transports_.begin(), web_transports_.end(), [](const std::unique_ptr<WebTransport>& transport) {
diff --git a/services/network/network_context.h b/services/network/network_context.h index 051a33d..34b3e31 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h
@@ -46,6 +46,7 @@ #include "services/network/http_cache_data_counter.h" #include "services/network/http_cache_data_remover.h" #include "services/network/network_qualities_pref_delegate.h" +#include "services/network/network_service_memory_cache.h" #include "services/network/public/cpp/cors/origin_access_list.h" #include "services/network/public/cpp/network_service_buildflags.h" #include "services/network/public/cpp/transferable_directory.h" @@ -572,6 +573,9 @@ WebBundleManager& GetWebBundleManager() { return web_bundle_manager_; } + // May return null if the in-memory cache is disabled. + NetworkServiceMemoryCache* GetMemoryCache(); + // Returns the current same-origin-policy exceptions. For more details see // network::mojom::NetworkContextParams::cors_origin_access_list and // network::mojom::NetworkContext::SetCorsOriginAccessListsForOrigin. @@ -881,6 +885,8 @@ // manages the lifetiem of a WebBundleURLLoaderFactory object. WebBundleManager web_bundle_manager_; + NetworkServiceMemoryCache memory_cache_; + // Whether all external consumers are expected to provide a non-empty // NetworkIsolationKey with all requests. When set, enabled a variety of // DCHECKs on APIs used by external callers.
diff --git a/services/network/network_service_memory_cache.cc b/services/network/network_service_memory_cache.cc new file mode 100644 index 0000000..8fafa850 --- /dev/null +++ b/services/network/network_service_memory_cache.cc
@@ -0,0 +1,242 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/network_service_memory_cache.h" + +#include "base/memory/ref_counted_memory.h" +#include "base/memory/scoped_refptr.h" +#include "base/metrics/field_trial_params.h" +#include "net/base/load_flags.h" +#include "net/base/network_isolation_key.h" +#include "net/http/http_cache.h" +#include "net/http/http_response_headers.h" +#include "net/http/http_status_code.h" +#include "net/http/http_util.h" +#include "net/url_request/url_request.h" +#include "services/network/network_context.h" +#include "services/network/network_service_memory_cache_writer.h" +#include "services/network/public/cpp/features.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/url_loader.h" +#include "url/gurl.h" +#include "url/origin.h" + +namespace network { + +namespace { + +// TODO(https://crbug.com/1339708): Adjust the default size based on stats. +const base::FeatureParam<int> kNetworkServiceMemoryCacheMaxTotalSize{ + &features::kNetworkServiceMemoryCache, "max_total_size", 64 * 1024 * 1024}; + +std::string GenerateCacheKeyForResourceRequest( + const ResourceRequest& resource_request, + const net::NetworkIsolationKey& network_isolation_key) { + const bool is_subframe_document_resource = + resource_request.destination == mojom::RequestDestination::kIframe; + return net::HttpCache::GenerateCacheKey( + resource_request.url, resource_request.load_flags, network_isolation_key, + /*upload_data_identifier=*/0, is_subframe_document_resource, + /*use_single_keyed_cache=*/false, /*single_key_checksum=*/""); +} + +} // namespace + +struct NetworkServiceMemoryCache::Entry { + Entry(mojom::URLResponseHeadPtr response_head, + scoped_refptr<base::RefCountedBytes> content) + : response_head(std::move(response_head)), content(std::move(content)) {} + ~Entry() = default; + + // Movable. + Entry(Entry&&) = default; + Entry& operator=(Entry&&) = default; + Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + + mojom::URLResponseHeadPtr response_head; + scoped_refptr<base::RefCountedBytes> content; +}; + +NetworkServiceMemoryCache::NetworkServiceMemoryCache() + : entries_(CacheMap::NO_AUTO_EVICT), + max_total_bytes_(kNetworkServiceMemoryCacheMaxTotalSize.Get()) {} + +NetworkServiceMemoryCache::~NetworkServiceMemoryCache() = default; + +base::WeakPtr<NetworkServiceMemoryCache> +NetworkServiceMemoryCache::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} + +std::unique_ptr<NetworkServiceMemoryCacheWriter> +NetworkServiceMemoryCache::MaybeCreateWriter( + net::URLRequest* url_request, + mojom::RequestDestination request_destination, + const mojom::URLResponseHeadPtr& response) { + DCHECK(url_request); + + // TODO(https://crbug.com/1339708): Make `this` work with + // SplitCacheByIncludeCredentials. Currently some tests are failing when + // the feature is enabled. + if (base::FeatureList::IsEnabled( + net::features::kSplitCacheByIncludeCredentials)) { + return nullptr; + } + + // TODO(https://crbug.com/1339708): Make `this` work for responses from + // private network. Currently some tests are failing. + if (response->response_address_space == mojom::IPAddressSpace::kPrivate) + return nullptr; + + DCHECK(url_request->url().is_valid()); + if (!url_request->url().SchemeIsHTTPOrHTTPS()) + return nullptr; + + if (url_request->method() != net::HttpRequestHeaders::kGetMethod) + return nullptr; + + // See the comment in HttpCache::Transaction::ShouldPassThrough(). + if (net::HttpCache::IsSplitCacheEnabled() && + url_request->isolation_info().network_isolation_key().IsTransient()) { + return nullptr; + } + + if (!response->headers || response->headers->response_code() != net::HTTP_OK) + return nullptr; + + const int load_flags = url_request->load_flags(); + if (load_flags & net::LOAD_BYPASS_CACHE || + load_flags & net::LOAD_DISABLE_CACHE) { + return nullptr; + } + + net::ValidationType validation_type = response->headers->RequiresValidation( + response->request_time, response->response_time, GetCurrentTime()); + if (validation_type != net::VALIDATION_NONE) + return nullptr; + + bool is_subframe_document_resource = + request_destination == mojom::RequestDestination::kIframe; + std::string cache_key = net::HttpCache::GenerateCacheKey( + url_request->url(), url_request->load_flags(), + url_request->isolation_info().network_isolation_key(), + /*upload_data_identifier=*/0, is_subframe_document_resource, + /*use_single_keyed_cache=*/false, + /*single_key_checksum=*/""); + + return std::make_unique<NetworkServiceMemoryCacheWriter>( + weak_ptr_factory_.GetWeakPtr(), GetNextTraceId(), std::move(cache_key), + url_request, response); +} + +void NetworkServiceMemoryCache::StoreResponse( + const std::string& cache_key, + const URLLoaderCompletionStatus& status, + mojom::URLResponseHeadPtr response_head, + std::vector<unsigned char> data) { + // TODO(https://crbug.com/1339708): Consider caching a response that doesn't + // have contents. + if (status.error_code != net::OK || data.size() == 0) + return; + + // TODO(https://crbug.com/1339708): Consider not storing a large response to + // improve cache hit rate. + if (max_total_bytes_ < data.size()) + return; + + auto prev = entries_.Peek(cache_key); + if (prev != entries_.end()) { + DCHECK_GE(total_bytes_, prev->second->content->size()); + total_bytes_ -= prev->second->content->size(); + // The following Put() will remove `prev`. + } + + DCHECK_GE(std::numeric_limits<size_t>::max() - total_bytes_, data.size()); + total_bytes_ += data.size(); + + scoped_refptr<base::RefCountedBytes> content = + base::RefCountedBytes::TakeVector(&data); + auto entry = + std::make_unique<Entry>(std::move(response_head), std::move(content)); + entries_.Put(cache_key, std::move(entry)); + + ShrinkToTotalBytes(); +} + +absl::optional<std::string> NetworkServiceMemoryCache::CanServe( + const ResourceRequest& resource_request, + const net::NetworkIsolationKey& network_isolation_key) { + // TODO(https://crbug.com/1339708): Support automatically assigned network + // isolation key for request from browsers. See comments in + // CorsURLLoaderFactory::CorsURLLoaderFactory. + DCHECK(network_isolation_key.IsFullyPopulated()); + + const GURL& url = resource_request.url; + if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) + return absl::nullopt; + + if (resource_request.method != net::HttpRequestHeaders::kGetMethod) + return absl::nullopt; + + if (resource_request.load_flags & net::LOAD_BYPASS_CACHE || + resource_request.load_flags & net::LOAD_DISABLE_CACHE || + resource_request.load_flags & net::LOAD_VALIDATE_CACHE) { + return absl::nullopt; + } + + // TODO(https://crbug.com/1339708): Perform CORP checks. + + std::string cache_key = GenerateCacheKeyForResourceRequest( + resource_request, network_isolation_key); + + auto it = entries_.Peek(cache_key); + if (it == entries_.end()) + return absl::nullopt; + + const mojom::URLResponseHeadPtr& response = it->second->response_head; + net::ValidationType validation_type = response->headers->RequiresValidation( + response->request_time, response->response_time, GetCurrentTime()); + if (validation_type != net::VALIDATION_NONE) { + // The cached response is stale, erase it from the in-memory cache. + entries_.Erase(it); + return absl::nullopt; + } + + return std::move(cache_key); +} + +void NetworkServiceMemoryCache::SetCurrentTimeForTesting( + base::Time current_time) { + current_time_for_testing_ = current_time; +} + +mojom::URLResponseHeadPtr NetworkServiceMemoryCache::GetResponseHeadForTesting( + const std::string& cache_key) { + auto it = entries_.Peek(cache_key); + if (it == entries_.end()) + return nullptr; + return it->second->response_head.Clone(); +} + +base::Time NetworkServiceMemoryCache::GetCurrentTime() { + if (!current_time_for_testing_.is_null()) + return current_time_for_testing_; + return base::Time::Now(); +} + +uint64_t NetworkServiceMemoryCache::GetNextTraceId() { + return (reinterpret_cast<uint64_t>(this) << 32) | next_trace_id_++; +} + +void NetworkServiceMemoryCache::ShrinkToTotalBytes() { + while (!entries_.empty() && total_bytes_ > max_total_bytes_) { + auto it = entries_.rbegin(); + DCHECK_GE(total_bytes_, it->second->content->size()); + total_bytes_ -= it->second->content->size(); + entries_.Erase(it); + } +} + +} // namespace network
diff --git a/services/network/network_service_memory_cache.h b/services/network/network_service_memory_cache.h new file mode 100644 index 0000000..8f6856b --- /dev/null +++ b/services/network/network_service_memory_cache.h
@@ -0,0 +1,98 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_H_ +#define SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_H_ + +#include <inttypes.h> +#include <memory> +#include <string> + +#include "base/component_export.h" +#include "base/containers/lru_cache.h" +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "base/time/time.h" +#include "services/network/public/mojom/url_loader_completion_status.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace net { +class NetworkIsolationKey; +class URLRequest; +} // namespace net + +namespace network { + +class NetworkServiceMemoryCacheWriter; +struct ResourceRequest; + +// An in-memory HTTP cache. NetworkContext owns the in-memory cache. +// TODO(https://crbug.com/1339708): Add more descriptions once the network +// service starts serving response from the in-memory cache. +class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkServiceMemoryCache { + public: + NetworkServiceMemoryCache(); + ~NetworkServiceMemoryCache(); + + NetworkServiceMemoryCache(const NetworkServiceMemoryCache&) = delete; + NetworkServiceMemoryCache& operator=(const NetworkServiceMemoryCache&) = + delete; + + base::WeakPtr<NetworkServiceMemoryCache> GetWeakPtr(); + + // Creates a NetworkServiceMemoryCacheWriter when the response is 200 and it + // can be cacheable. + std::unique_ptr<NetworkServiceMemoryCacheWriter> MaybeCreateWriter( + net::URLRequest* url_request, + mojom::RequestDestination request_destination, + const mojom::URLResponseHeadPtr& response); + + // Stores an HTTP response into `this`. Called when a writer finished reading + // response body. + void StoreResponse(const std::string& cache_key, + const URLLoaderCompletionStatus& status, + mojom::URLResponseHeadPtr response_head, + std::vector<unsigned char> data); + + // Returns a cache key if `this` has a fresh response for `resource_request`. + // The returned cache key is valid only for the current call stack. It must be + // used synchronously. + absl::optional<std::string> CanServe( + const ResourceRequest& resource_request, + const net::NetworkIsolationKey& network_isolation_key); + + void SetCurrentTimeForTesting(base::Time current_time); + + mojom::URLResponseHeadPtr GetResponseHeadForTesting( + const std::string& cache_key); + + private: + struct Entry; + using CacheMap = base::LRUCache<std::string, std::unique_ptr<Entry>>; + + // Returns the current time for cache freshness checks. + base::Time GetCurrentTime(); + + // Used for tracing. + uint64_t GetNextTraceId(); + + // Erases least recently used entries from the in-memory cache until + // `total_bytes_` becomes less than `max_total_bytes_`. + void ShrinkToTotalBytes(); + + uint32_t next_trace_id_ = 0; + + CacheMap entries_; + const size_t max_total_bytes_; + size_t total_bytes_ = 0; + + base::Time current_time_for_testing_; + + base::WeakPtrFactory<NetworkServiceMemoryCache> weak_ptr_factory_{this}; +}; + +} // namespace network + +#endif // SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_H_
diff --git a/services/network/network_service_memory_cache_unittest.cc b/services/network/network_service_memory_cache_unittest.cc new file mode 100644 index 0000000..a05b4b4d --- /dev/null +++ b/services/network/network_service_memory_cache_unittest.cc
@@ -0,0 +1,474 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <memory> + +#include "base/run_loop.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/stringprintf.h" +#include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "net/base/features.h" +#include "net/base/schemeful_site.h" +#include "net/base/url_util.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_builder.h" +#include "services/network/cors/cors_url_loader_factory.h" +#include "services/network/network_context.h" +#include "services/network/network_service.h" +#include "services/network/network_service_memory_cache_writer.h" +#include "services/network/public/cpp/cors/origin_access_list.h" +#include "services/network/public/cpp/features.h" +#include "services/network/public/mojom/url_loader.mojom.h" +#include "services/network/public/mojom/url_loader_factory.mojom.h" +#include "services/network/resource_scheduler/resource_scheduler_client.h" +#include "services/network/test/fake_test_cert_verifier_params_factory.h" +#include "services/network/test/test_url_loader_client.h" +#include "services/network/test/test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" +#include "url/origin.h" + +namespace network { + +namespace { + +constexpr int kMaxTotalSize = 2 * 1024; + +struct LoaderPair { + LoaderPair() : client(std::make_unique<TestURLLoaderClient>()) {} + ~LoaderPair() = default; + + LoaderPair(LoaderPair&&) = default; + LoaderPair& operator=(LoaderPair&&) = default; + LoaderPair(const LoaderPair&) = delete; + LoaderPair& operator=(const LoaderPair&) = delete; + + mojo::Remote<mojom::URLLoader> loader_remote; + std::unique_ptr<TestURLLoaderClient> client; +}; + +mojom::URLResponseHeadPtr CreateCacheableURLResponseHead() { + mojom::URLResponseHeadPtr response_head = CreateURLResponseHead(net::HTTP_OK); + response_head->headers->AddHeader("Cache-Control", "max-age=60"); + base::Time now = base::Time::Now(); + response_head->request_time = now; + response_head->response_time = now; + return response_head; +} + +// An EmbeddedTestServer request handler that returns a cacheable response of +// which body size and max-age are specified by the query string. +std::unique_ptr<net::test_server::HttpResponse> CacheableResponseHandler( + const net::test_server::HttpRequest& request) { + if (request.GetURL().path_piece() != "/cacheable") + return nullptr; + + auto response = std::make_unique<net::test_server::BasicHttpResponse>(); + + uint64_t body_size = 64; + std::string query_body_size; + if (net::GetValueForKeyInQuery(request.GetURL(), "body-size", + &query_body_size)) { + EXPECT_TRUE(base::StringToUint64(query_body_size, &body_size)); + } + + uint64_t max_age = 60; + std::string query_max_age; + if (net::GetValueForKeyInQuery(request.GetURL(), "max-age", &query_max_age)) { + EXPECT_TRUE(base::StringToUint64(query_max_age, &max_age)); + } + + response->AddCustomHeader("cache-control", + base::StringPrintf("max-age=%" PRId64, max_age)); + response->set_content(std::string(body_size, 'a')); + return response; +} + +} // namespace + +class NetworkServiceMemoryCacheTest : public testing::Test { + public: + NetworkServiceMemoryCacheTest() + : task_environment_(base::test::TaskEnvironment::MainThreadType::IO) { + scoped_feature_list_.InitAndEnableFeatureWithParameters( + features::kNetworkServiceMemoryCache, + {{"max_total_size", base::NumberToString(kMaxTotalSize)}}); + } + + ~NetworkServiceMemoryCacheTest() override = default; + + void SetUp() override { + // The following setup similar to CorsURLLoaderFactoryTest. + + test_server_.AddDefaultHandlers(); + test_server_.RegisterRequestHandler( + base::BindRepeating(&CacheableResponseHandler)); + ASSERT_TRUE(test_server_.Start()); + + network_service_ = NetworkService::CreateForTesting(); + + auto context_params = mojom::NetworkContextParams::New(); + context_params->cert_verifier_params = + FakeTestCertVerifierParamsFactory::GetCertVerifierParams(); + context_params->initial_proxy_config = + net::ProxyConfigWithAnnotation::CreateDirect(); + network_context_ = std::make_unique<NetworkContext>( + network_service_.get(), + network_context_remote_.BindNewPipeAndPassReceiver(), + std::move(context_params)); + + auto factory_params = network::mojom::URLLoaderFactoryParams::New(); + constexpr int kProcessId = 123; + factory_params->process_id = kProcessId; + factory_params->request_initiator_origin_lock = + url::Origin::Create(test_server_.base_url()); + + url::Origin test_server_origin = + url::Origin::Create(test_server_.base_url()); + factory_params->isolation_info = + net::IsolationInfo::CreateForInternalRequest(test_server_origin); + + cors_url_loader_factory_ = std::make_unique<cors::CorsURLLoaderFactory>( + network_context_.get(), std::move(factory_params), + /*resource_scheduler_client=*/nullptr, + cors_url_loader_factory_remote_.BindNewPipeAndPassReceiver(), + &origin_access_list_); + } + + net::test_server::EmbeddedTestServer& test_server() { return test_server_; } + + net::URLRequestContext& url_request_context() { + return *network_context_->url_request_context(); + } + + NetworkServiceMemoryCache& memory_cache() { + return *network_context_->GetMemoryCache(); + } + + ResourceRequest CreateRequest(const std::string& relative_path) { + ResourceRequest request; + GURL url = test_server().GetURL(relative_path); + url::Origin origin = url::Origin::Create(url); + request.url = url; + request.request_initiator = origin; + return request; + } + + std::unique_ptr<net::URLRequest> CreateURLRequest(const GURL& url) { + return url_request_context().CreateRequest(url, net::DEFAULT_PRIORITY, + /*delegate=*/nullptr, + TRAFFIC_ANNOTATION_FOR_TESTS); + } + + LoaderPair CreateLoaderAndStart(const ResourceRequest& request) { + LoaderPair pair; + cors_url_loader_factory_->CreateLoaderAndStart( + pair.loader_remote.BindNewPipeAndPassReceiver(), /*request_id=*/1, + mojom::kURLLoadOptionNone, request, pair.client->CreateRemote(), + net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS)); + return pair; + } + + void StoreResponseToMemoryCache(const ResourceRequest& request) { + LoaderPair pair = CreateLoaderAndStart(request); + pair.client->RunUntilComplete(); + } + + bool WriterWillBeCreatedToStoreResponse( + net::URLRequest* url_request, + const mojom::URLResponseHeadPtr& response_head) { + std::unique_ptr<NetworkServiceMemoryCacheWriter> writer = + memory_cache().MaybeCreateWriter( + url_request, mojom::RequestDestination::kDocument, response_head); + return writer.get() != nullptr; + } + + bool CanServeFromMemoryCache(const ResourceRequest& request) { + net::SchemefulSite site(request.url); + net::NetworkIsolationKey network_isolation_key(/*top_frame_site=*/site, + /*frame_site=*/site); + return memory_cache().CanServe(request, network_isolation_key).has_value(); + } + + bool CanServeFromMemoryCache( + const ResourceRequest& request, + net::NetworkIsolationKey& network_isolation_key) { + return memory_cache().CanServe(request, network_isolation_key).has_value(); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + base::test::TaskEnvironment task_environment_; + std::unique_ptr<net::URLRequestContext> url_request_context_; + std::unique_ptr<NetworkService> network_service_; + std::unique_ptr<NetworkContext> network_context_; + mojo::Remote<mojom::NetworkContext> network_context_remote_; + + net::test_server::EmbeddedTestServer test_server_; + + std::unique_ptr<mojom::URLLoaderFactory> cors_url_loader_factory_; + mojo::Remote<mojom::URLLoaderFactory> cors_url_loader_factory_remote_; + + cors::OriginAccessList origin_access_list_; +}; + +TEST_F(NetworkServiceMemoryCacheTest, + CreateWriter_SchemeIsNeitherHTTPNorHTTPS) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(GURL("data:text/plain;foo")); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_MethodIsNotGet) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + url_request->set_method("POST"); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, + CreateWriter_NetworkIsolationKeyIsTransient) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + net::features::kSplitCacheByNetworkIsolationKey); + + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + url_request->set_isolation_info(net::IsolationInfo::CreateTransient()); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_StatusCodeIsNotOK) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + + mojom::URLResponseHeadPtr response_head = + CreateURLResponseHead(net::HTTP_BAD_REQUEST); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_EmptyResponse) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + + auto response_head = mojom::URLResponseHead::New(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_BypassCache) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + url_request->SetLoadFlags(net::LOAD_BYPASS_CACHE); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_DisableCache) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + url_request->SetLoadFlags(net::LOAD_DISABLE_CACHE); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CreateWriter_ResponseNotCacheable) { + std::unique_ptr<net::URLRequest> url_request = + CreateURLRequest(test_server().GetURL("/cacheable")); + + mojom::URLResponseHeadPtr response_head = CreateCacheableURLResponseHead(); + response_head->headers->RemoveHeader("cache-control"); + response_head->headers->AddHeader("cache-control", "no-store"); + + ASSERT_FALSE( + WriterWillBeCreatedToStoreResponse(url_request.get(), response_head)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_Basic) { + ResourceRequest request = CreateRequest("/cacheable"); + StoreResponseToMemoryCache(request); + + ASSERT_TRUE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_InvalidURL) { + ResourceRequest request; + request.url = GURL(); + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_SchemeIsNeitherHTTPNorHTTPS) { + ResourceRequest request; + request.url = GURL("data:text/plain;foo"); + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_MethodIsNotGet) { + ResourceRequest request = CreateRequest("/cacheable"); + request.method = net::HttpRequestHeaders::kPostMethod; + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_BypassCache) { + ResourceRequest request = CreateRequest("/cacheable"); + request.load_flags |= net::LOAD_BYPASS_CACHE; + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_DisableCache) { + ResourceRequest request = CreateRequest("/cacheable"); + request.load_flags |= net::LOAD_DISABLE_CACHE; + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_ValidateCache) { + ResourceRequest request = CreateRequest("/cacheable"); + request.load_flags |= net::LOAD_VALIDATE_CACHE; + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_Expired) { + const uint64_t kMaxAge = 60; + ResourceRequest request = + CreateRequest(base::StringPrintf("/cacheable?max-age=%" PRId64, kMaxAge)); + StoreResponseToMemoryCache(request); + + ASSERT_TRUE(CanServeFromMemoryCache(request)); + + // The response has `max-age=60`. Set the current time 61 seconds later to + // make the cached response stale. + memory_cache().SetCurrentTimeForTesting(base::Time::Now() + + base::Seconds(kMaxAge + 1)); + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, CanServe_ResponseTooLarge) { + ResourceRequest request = CreateRequest( + base::StringPrintf("/cacheable?body-size=%d", kMaxTotalSize + 1)); + StoreResponseToMemoryCache(request); + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +TEST_F(NetworkServiceMemoryCacheTest, + CanServe_SplitCacheByNetworkIsolationKeyEnabled) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + net::features::kSplitCacheByNetworkIsolationKey); + + ResourceRequest request = CreateRequest("/cacheable"); + StoreResponseToMemoryCache(request); + + net::SchemefulSite same_site(request.url); + net::NetworkIsolationKey same_site_network_isolation_key( + /*top_frame_site=*/same_site, /*frame_site=*/same_site); + ASSERT_TRUE( + CanServeFromMemoryCache(request, same_site_network_isolation_key)); + + net::SchemefulSite other_site(GURL("https://example.test")); + net::NetworkIsolationKey other_site_network_isolation_key( + /*top_frame_site=*/same_site, /*frame_site=*/other_site); + ASSERT_FALSE( + CanServeFromMemoryCache(request, other_site_network_isolation_key)); +} + +TEST_F(NetworkServiceMemoryCacheTest, UpdateStoredCache) { + ResourceRequest request = CreateRequest("/cacheable"); + + StoreResponseToMemoryCache(request); + + net::SchemefulSite site(request.url); + net::NetworkIsolationKey network_isolation_key(/*top_frame_site=*/site, + /*frame_site=*/site); + + absl::optional<std::string> cache_key = + memory_cache().CanServe(request, network_isolation_key); + ASSERT_TRUE(cache_key.has_value()); + mojom::URLResponseHeadPtr response = + memory_cache().GetResponseHeadForTesting(*cache_key); + base::Time first_response_time = response->response_time; + + // Store the same response again. Force validation to update the response. + request.load_flags |= net::LOAD_VALIDATE_CACHE; + StoreResponseToMemoryCache(request); + response = memory_cache().GetResponseHeadForTesting(*cache_key); + base::Time second_response_time = response->response_time; + + // Compare response time to make sure the stored response is updated. + ASSERT_LT(first_response_time, second_response_time); +} + +TEST_F(NetworkServiceMemoryCacheTest, EvictLeastRecentlyUsed) { + const int kBodySize = kMaxTotalSize / 2; + + // Stores two responses to consume the full budget of the in-memory cache. + ResourceRequest request1 = CreateRequest( + base::StringPrintf("/cacheable?id=1&body-size=%d", kBodySize)); + StoreResponseToMemoryCache(request1); + + ResourceRequest request2 = CreateRequest( + base::StringPrintf("/cacheable?id=2&body-size=%d", kBodySize)); + StoreResponseToMemoryCache(request2); + + ASSERT_TRUE(CanServeFromMemoryCache(request1)); + ASSERT_TRUE(CanServeFromMemoryCache(request2)); + + // Stores the third response. It should evict the first stored response. + ResourceRequest request3 = CreateRequest( + base::StringPrintf("/cacheable?id=3&body-size=%d", kBodySize)); + StoreResponseToMemoryCache(request3); + + ASSERT_FALSE(CanServeFromMemoryCache(request1)); + ASSERT_TRUE(CanServeFromMemoryCache(request2)); + ASSERT_TRUE(CanServeFromMemoryCache(request3)); +} + +TEST_F(NetworkServiceMemoryCacheTest, ClientDisconnectedWhileCaching) { + ResourceRequest request = CreateRequest("/cacheable"); + LoaderPair pair = CreateLoaderAndStart(request); + + pair.client->RunUntilResponseReceived(); + pair.client->Unbind(); + + ASSERT_TRUE(pair.loader_remote.is_connected()); + base::RunLoop loop; + pair.loader_remote.set_disconnect_handler(loop.QuitClosure()); + loop.Run(); + + ASSERT_FALSE(CanServeFromMemoryCache(request)); +} + +} // namespace network
diff --git a/services/network/network_service_memory_cache_writer.cc b/services/network/network_service_memory_cache_writer.cc new file mode 100644 index 0000000..5dec092 --- /dev/null +++ b/services/network/network_service_memory_cache_writer.cc
@@ -0,0 +1,60 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/network_service_memory_cache_writer.h" + +#include "base/trace_event/common/trace_event_common.h" +#include "base/trace_event/trace_event.h" +#include "base/trace_event/typed_macros.h" +#include "services/network/network_service_memory_cache.h" + +namespace network { + +NetworkServiceMemoryCacheWriter::NetworkServiceMemoryCacheWriter( + base::WeakPtr<NetworkServiceMemoryCache> cache, + uint64_t trace_id, + std::string cache_key, + net::URLRequest* url_request, + const mojom::URLResponseHeadPtr& response_head) + : cache_(std::move(cache)), + trace_id_(trace_id), + cache_key_(std::move(cache_key)), + url_request_(url_request), + response_head_(response_head.Clone()) { + DCHECK(cache_); + DCHECK(url_request_); + TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( + "loading", "NetworkServiceMemoryCacheWriter", TRACE_ID_LOCAL(trace_id_), + "key", cache_key_); +} + +NetworkServiceMemoryCacheWriter::~NetworkServiceMemoryCacheWriter() { + TRACE_EVENT_NESTABLE_ASYNC_END0("loading", "NetworkServiceMemoryCacheWriter", + TRACE_ID_LOCAL(trace_id_)); +} + +void NetworkServiceMemoryCacheWriter::OnDataRead(const char* buf, int result) { + TRACE_EVENT_NESTABLE_ASYNC_INSTANT1( + "loading", "NetworkServiceMemoryCacheWriter::OnDataRead", + TRACE_ID_LOCAL(trace_id_), "result", result); + + if (result > 0) + received_data_.insert(received_data_.end(), buf, buf + result); +} + +void NetworkServiceMemoryCacheWriter::OnCompleted( + const URLLoaderCompletionStatus& status) { + TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( + "loading", "NetworkServiceMemoryCacheWriter::OnCompleted", + TRACE_ID_LOCAL(trace_id_), "result", status.error_code, "total_size", + received_data_.size()); + + if (cache_) { + cache_->StoreResponse(cache_key_, status, std::move(response_head_), + std::move(received_data_)); + } + // `this` will be deleted by the owner. +} + +} // namespace network
diff --git a/services/network/network_service_memory_cache_writer.h b/services/network/network_service_memory_cache_writer.h new file mode 100644 index 0000000..0a68c42 --- /dev/null +++ b/services/network/network_service_memory_cache_writer.h
@@ -0,0 +1,64 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_WRITER_H_ +#define SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_WRITER_H_ + +#include <string> +#include <vector> + +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "services/network/public/mojom/url_loader_completion_status.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" + +namespace net { +class URLRequest; +} // namespace net + +namespace network { + +class NetworkServiceMemoryCache; + +// Duplicates an HTTP response that comes from the underlying layer, i.e., a +// URLLoader. The URLLoader owns an instance of this class. +// +// When the URLLoader completed successfully, the duplicated response is stored +// into the in-memory cache so that it can be served without disk access until +// it gets evicted. +class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkServiceMemoryCacheWriter { + public: + NetworkServiceMemoryCacheWriter( + base::WeakPtr<NetworkServiceMemoryCache> cache, + uint64_t trace_id, + std::string cache_key, + net::URLRequest* request, + const mojom::URLResponseHeadPtr& response_head); + + ~NetworkServiceMemoryCacheWriter(); + + // Called when the owner received response content. + void OnDataRead(const char* buf, int result); + + // Called when the owner completed. + void OnCompleted(const URLLoaderCompletionStatus& status); + + private: + base::WeakPtr<NetworkServiceMemoryCache> cache_; + + // Used for tracing. + const uint64_t trace_id_; + + std::string cache_key_; + + // `url_request_` must outlive `this`. The owner owns `url_request_`. + const raw_ptr<net::URLRequest> url_request_; + + mojom::URLResponseHeadPtr response_head_; + std::vector<unsigned char> received_data_; +}; + +} // namespace network + +#endif // SERVICES_NETWORK_NETWORK_SERVICE_MEMORY_CACHE_WRITER_H_
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc index 4be1c69..8912c7d6 100644 --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc
@@ -266,6 +266,9 @@ const base::Feature kBatchSimpleURLLoader{"BatchSimpleURLLoader", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kNetworkServiceMemoryCache{ + "NetworkServiceMemoryCache", base::FEATURE_DISABLED_BY_DEFAULT}; + // Do not send TLS client certificates in CORS preflight. Omit all client certs // and continue the handshake without sending one if requested. const base::Feature kOmitCorsClientCert{"OmitCorsClientCert",
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h index b6c1e50..0bded2a 100644 --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h
@@ -107,6 +107,9 @@ extern const base::Feature kBatchSimpleURLLoader; COMPONENT_EXPORT(NETWORK_CPP) +extern const base::Feature kNetworkServiceMemoryCache; + +COMPONENT_EXPORT(NETWORK_CPP) extern const base::Feature kOmitCorsClientCert; COMPONENT_EXPORT(NETWORK_CPP)
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc index e70cf2a3..54f5037 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc
@@ -63,6 +63,7 @@ #include "net/url_request/url_request_context_getter.h" #include "services/network/chunked_data_pipe_upload_data_stream.h" #include "services/network/data_pipe_element_reader.h" +#include "services/network/network_service_memory_cache_writer.h" #include "services/network/public/cpp/client_hints.h" #include "services/network/public/cpp/constants.h" #include "services/network/public/cpp/corb/orb_impl.h" @@ -949,8 +950,8 @@ // initializing before getting deleted. base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::BindOnce(&URLLoader::NotifyCompleted, base::Unretained(this), - net::ERR_ACCESS_DENIED)); + base::BindOnce(&URLLoader::NotifyCompleted, + weak_ptr_factory_.GetWeakPtr(), net::ERR_ACCESS_DENIED)); return; } url_request_->LogBlockedBy("Opening Files"); @@ -969,7 +970,7 @@ // initializing before getting deleted. base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&URLLoader::NotifyCompleted, - base::Unretained(this), error_code)); + weak_ptr_factory_.GetWeakPtr(), error_code)); return; } scoped_refptr<base::SequencedTaskRunner> task_runner = @@ -1119,6 +1120,8 @@ // requests by the same client. private_network_access_checker_.ResetForRedirect(); + memory_cache_writer_.reset(); + // Removing headers can't make the set of pre-existing headers unsafe, but // adding headers can. if (!AreRequestHeadersSafe(modified_headers) || @@ -1545,6 +1548,11 @@ return; } + if (memory_cache_) { + memory_cache_writer_ = memory_cache_->MaybeCreateWriter( + url_request_.get(), request_destination_, response_); + } + ContinueOnResponseStarted(); } @@ -1744,6 +1752,11 @@ DCHECK(read_in_progress_); read_in_progress_ = false; + if (memory_cache_writer_ && pending_write_) { + memory_cache_writer_->OnDataRead( + pending_write_->buffer() + pending_write_buffer_offset_, num_bytes); + } + size_t new_data_offset = pending_write_buffer_offset_; if (num_bytes > 0) { pending_write_buffer_offset_ += num_bytes; @@ -2087,6 +2100,9 @@ status.pervasive_payload_requested = pervasive_payload_requested_; + if (memory_cache_writer_) + memory_cache_writer_->OnCompleted(status); + url_loader_client_.Get()->OnComplete(status); } @@ -2378,11 +2394,15 @@ status.decoded_body_length = 0; status.should_report_corb_blocking = should_report_corb_blocking; status.blocked_by_response_reason = reason; + + if (memory_cache_writer_) + memory_cache_writer_->OnCompleted(status); url_loader_client_.Get()->OnComplete(status); // Reset the connection to the URLLoaderClient. This helps ensure that we // won't accidentally leak any data to the renderer from this point on. url_loader_client_.Reset(); + memory_cache_writer_.reset(); } URLLoader::BlockResponseForCorbResult URLLoader::BlockResponseForCorb(
diff --git a/services/network/url_loader.h b/services/network/url_loader.h index 63ee006c..158eaacb 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h
@@ -29,6 +29,7 @@ #include "net/url_request/url_request.h" #include "services/network/keepalive_statistics_recorder.h" #include "services/network/network_service.h" +#include "services/network/network_service_memory_cache.h" #include "services/network/private_network_access_checker.h" #include "services/network/public/cpp/corb/corb_api.h" #include "services/network/public/cpp/cors/cors_error_status.h" @@ -184,6 +185,10 @@ ~URLLoader() override; + void SetMemoryCache(base::WeakPtr<NetworkServiceMemoryCache> memory_cache) { + memory_cache_ = std::move(memory_cache); + } + // mojom::URLLoader implementation: void FollowRedirect( const std::vector<std::string>& removed_headers, @@ -562,6 +567,9 @@ base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder_; + base::WeakPtr<NetworkServiceMemoryCache> memory_cache_; + std::unique_ptr<NetworkServiceMemoryCacheWriter> memory_cache_writer_; + bool first_auth_attempt_ = true; std::unique_ptr<ScopedThrottlingToken> throttling_token_;
diff --git a/services/network/url_loader_factory.cc b/services/network/url_loader_factory.cc index ce3c509..286cd5df 100644 --- a/services/network/url_loader_factory.cc +++ b/services/network/url_loader_factory.cc
@@ -348,6 +348,9 @@ std::move(devtools_observer), std::move(accept_ch_frame_observer), third_party_cookies_enabled); + if (context_->GetMemoryCache()) + loader->SetMemoryCache(context_->GetMemoryCache()->GetWeakPtr()); + cors_url_loader_factory_->OnURLLoaderCreated(std::move(loader)); }
diff --git a/services/tracing/public/cpp/BUILD.gn b/services/tracing/public/cpp/BUILD.gn index bdaafba..e15d33d 100644 --- a/services/tracing/public/cpp/BUILD.gn +++ b/services/tracing/public/cpp/BUILD.gn
@@ -56,6 +56,8 @@ sources += [ "base_agent.cc", "base_agent.h", + "perfetto/custom_event_recorder.cc", + "perfetto/custom_event_recorder.h", "perfetto/dummy_producer.cc", "perfetto/dummy_producer.h", "perfetto/interning_index.h",
diff --git a/services/tracing/public/cpp/perfetto/custom_event_recorder.cc b/services/tracing/public/cpp/perfetto/custom_event_recorder.cc new file mode 100644 index 0000000..86d7b52 --- /dev/null +++ b/services/tracing/public/cpp/perfetto/custom_event_recorder.cc
@@ -0,0 +1,313 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/tracing/public/cpp/perfetto/custom_event_recorder.h" + +#include "base/base64.h" +#include "base/callback_helpers.h" +#include "base/metrics/histogram_samples.h" +#include "base/metrics/metrics_hashes.h" +#include "base/metrics/statistics_recorder.h" +#include "base/metrics/user_metrics.h" +#include "base/no_destructor.h" +#include "base/pickle.h" +#include "base/synchronization/lock.h" +#include "base/time/time.h" +#include "base/trace_event/trace_config.h" +#include "base/trace_event/typed_macros.h" +#include "build/build_config.h" +#include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h" +#include "services/tracing/public/cpp/perfetto/trace_string_lookup.h" +#include "third_party/perfetto/include/perfetto/tracing/internal/track_event_internal.h" +#include "third_party/perfetto/include/perfetto/tracing/track_event_interned_data_index.h" +#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_histogram_sample.pbzero.h" +#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_process_descriptor.pbzero.h" +#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_user_event.pbzero.h" + +#if BUILDFLAG(IS_ANDROID) +#include "base/android/application_status_listener.h" +#include "base/trace_event/application_state_proto_android.h" +#endif + +using TraceConfig = base::trace_event::TraceConfig; +using perfetto::protos::pbzero::ChromeProcessDescriptor; + +namespace tracing { +namespace { + +base::SequencedTaskRunner* GetTaskRunner() { + return PerfettoTracedProcess::Get() + ->GetTaskRunner() + ->GetOrCreateTaskRunner() + .get(); +} + +struct InternedHistogramName + : public perfetto::TrackEventInternedDataIndex< + InternedHistogramName, + perfetto::protos::pbzero::InternedData::kHistogramNamesFieldNumber, + const char*> { + static void Add(perfetto::protos::pbzero::InternedData* interned_data, + size_t iid, + const char* histogram_name) { + auto* msg = interned_data->add_histogram_names(); + msg->set_iid(iid); + msg->set_name(histogram_name); + } +}; + +} // namespace + +CustomEventRecorder::CustomEventRecorder() { + DETACH_FROM_SEQUENCE(perfetto_sequence_checker_); +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + perfetto::TrackEvent::AddSessionObserver(this); +#endif +} + +CustomEventRecorder::~CustomEventRecorder() +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) +{ + perfetto::TrackEvent::RemoveSessionObserver(this); +} +#else + = default; +#endif + +// static +CustomEventRecorder* CustomEventRecorder::GetInstance() { + static base::NoDestructor<CustomEventRecorder> instance; + return instance.get(); +} + +// static +void CustomEventRecorder::EmitRecurringUpdates() { +#if BUILDFLAG(IS_ANDROID) + static const ChromeProcessDescriptor::ProcessType process_type = + GetProcessType( + base::trace_event::TraceLog::GetInstance()->process_name()); + if (process_type == ChromeProcessDescriptor::PROCESS_BROWSER) { + auto state = base::android::ApplicationStatusListener::GetState(); + TRACE_APPLICATION_STATE(state); + } +#endif +} + +void CustomEventRecorder::OnSetup( + const perfetto::DataSourceBase::SetupArgs& args) { + GetTaskRunner()->PostTask( + FROM_HERE, base::BindOnce(&CustomEventRecorder::OnTracingStarted, + base::Unretained(this), *args.config)); +} + +void CustomEventRecorder::OnStop( + const perfetto::DataSourceBase::StopArgs& args) { + std::function<void()> finish_async_stop = args.HandleStopAsynchronously(); + base::OnceClosure stop_callback = base::BindOnce( + [](std::function<void()> callback) { callback(); }, finish_async_stop); + GetTaskRunner()->PostTask( + FROM_HERE, + base::BindOnce(&CustomEventRecorder::OnTracingStopped, + base::Unretained(this), std::move(stop_callback))); +} + +void CustomEventRecorder::WillClearIncrementalState( + const perfetto::DataSourceBase::ClearIncrementalStateArgs&) { + EmitRecurringUpdates(); +} + +void CustomEventRecorder::OnStartupTracingStarted( + const TraceConfig& trace_config, + bool privacy_filtering_enabled) { + DCHECK(monitored_histograms_.empty()); + if (trace_config.IsCategoryGroupEnabled( + TRACE_DISABLED_BY_DEFAULT("histogram_samples")) && + trace_config.histogram_names().empty()) { + // The global callback can be added early at startup before main message + // loop is created. But histogram specific observers need task runner and + // are added when tracing service is setup in OnTracingStarted() instead. + base::StatisticsRecorder::SetGlobalSampleCallback( + &CustomEventRecorder::OnMetricsSampleCallback); + } + { + base::AutoLock lock(lock_); + privacy_filtering_enabled_ = privacy_filtering_enabled; + } +} + +// TODO(b/237761718): Support multiple simultaneous tracing sessions. +// * Read privacy_filtering_enabled from EventContext. +// * Make monitored_histograms_ a map keyed on session ID. +void CustomEventRecorder::OnTracingStarted( + const perfetto::DataSourceConfig& data_source_config) { + DCHECK_CALLED_ON_VALID_SEQUENCE(perfetto_sequence_checker_); + + auto trace_config = + TraceConfig(data_source_config.chrome_config().trace_config()); + + bool privacy_filtering_enabled = + data_source_config.chrome_config().privacy_filtering_enabled(); + { + base::AutoLock lock(lock_); + privacy_filtering_enabled_ = privacy_filtering_enabled; + } + + EmitRecurringUpdates(); + ResetHistograms(trace_config); + + DCHECK(monitored_histograms_.empty()); + if (trace_config.IsCategoryGroupEnabled( + TRACE_DISABLED_BY_DEFAULT("histogram_samples"))) { + if (trace_config.histogram_names().empty() && + !base::StatisticsRecorder::global_sample_callback()) { + // Add the global callback if it wasn't already. + base::StatisticsRecorder::SetGlobalSampleCallback( + &CustomEventRecorder::OnMetricsSampleCallback); + } + for (const std::string& histogram_name : trace_config.histogram_names()) { + monitored_histograms_.emplace_back( + std::make_unique< + base::StatisticsRecorder::ScopedHistogramSampleObserver>( + histogram_name, + base::BindRepeating( + &CustomEventRecorder::OnMetricsSampleCallback))); + } + } + + if (trace_config.IsCategoryGroupEnabled( + TRACE_DISABLED_BY_DEFAULT("user_action_samples"))) { + auto task_runner = base::GetRecordActionTaskRunner(); + if (task_runner) { + task_runner->PostTask( + FROM_HERE, base::BindOnce([]() { + base::AddActionCallback( + CustomEventRecorder::GetInstance()->user_action_callback_); + })); + } + } +} + +void CustomEventRecorder::OnTracingStopped( + base::OnceClosure stop_complete_callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(perfetto_sequence_checker_); + + // Write metadata events etc. + LogHistograms(); + + base::StatisticsRecorder::SetGlobalSampleCallback(nullptr); + monitored_histograms_.clear(); + + auto task_runner = base::GetRecordActionTaskRunner(); + if (task_runner) { + task_runner->PostTask( + FROM_HERE, base::BindOnce([]() { + base::RemoveActionCallback( + CustomEventRecorder::GetInstance()->user_action_callback_); + })); + } + +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + std::move(stop_complete_callback).Run(); +#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) +} + +bool CustomEventRecorder::IsPrivacyFilteringEnabled() { + base::AutoLock lock(lock_); + return privacy_filtering_enabled_; +} + +void CustomEventRecorder::OnUserActionSampleCallback( + const std::string& action, + base::TimeTicks action_time) { + constexpr uint64_t kGlobalInstantTrackId = 0; + TRACE_EVENT_INSTANT( + TRACE_DISABLED_BY_DEFAULT("user_action_samples"), "UserAction", + perfetto::Track::Global(kGlobalInstantTrackId), + [&](perfetto::EventContext ctx) { + bool privacy_filtering_enabled = + CustomEventRecorder::GetInstance()->IsPrivacyFilteringEnabled(); + perfetto::protos::pbzero::ChromeUserEvent* new_sample = + ctx.event()->set_chrome_user_event(); + if (!privacy_filtering_enabled) { + new_sample->set_action(action); + } + new_sample->set_action_hash(base::HashMetricName(action)); + }); +} + +void CustomEventRecorder::LogHistogram(base::HistogramBase* histogram) { + if (!histogram) { + return; + } + // For the purpose of calculating metrics from histograms we only want the + // delta of the events. + auto samples = histogram->SnapshotSamples(); + + // If there were HistogramSamples recorded during startup, then those should + // be subtracted from the overall set. This way we only report the samples + // that occurred during the run. + auto it = startup_histogram_samples_.find(histogram->histogram_name()); + if (it != startup_histogram_samples_.end()) { + samples->Subtract(*it->second.get()); + } + base::Pickle pickle; + samples->Serialize(&pickle); + std::string buckets; + base::Base64Encode( + std::string(static_cast<const char*>(pickle.data()), pickle.size()), + &buckets); + TRACE_EVENT_INSTANT2("benchmark,uma", "UMAHistogramSamples", + TRACE_EVENT_SCOPE_PROCESS, "name", + histogram->histogram_name(), "buckets", buckets); +} + +void CustomEventRecorder::ResetHistograms(const TraceConfig& trace_config) { + histograms_.clear(); + startup_histogram_samples_.clear(); + for (const std::string& histogram_name : trace_config.histogram_names()) { + histograms_.push_back(histogram_name); + auto* histogram = base::StatisticsRecorder::FindHistogram(histogram_name); + if (!histogram) { + continue; + } + + // For the purpose of calculating metrics from histograms we only want the + // delta of the events. However we do not want to emit the results when + // resetting. This will allow LogHistogram to emit one UMAHistogramSamples + // which encompasses only the histograms recorded during the trace. We + // cache the initial HistogramSamples so that they can be subtracted from + // the full snapshot at the end. + startup_histogram_samples_.emplace(histogram_name, + histogram->SnapshotSamples()); + } +} + +void CustomEventRecorder::LogHistograms() { + for (const std::string& histogram_name : histograms_) { + LogHistogram(base::StatisticsRecorder::FindHistogram(histogram_name)); + } +} + +// static +void CustomEventRecorder::OnMetricsSampleCallback( + const char* histogram_name, + uint64_t name_hash, + base::HistogramBase::Sample sample) { + TRACE_EVENT_INSTANT( + TRACE_DISABLED_BY_DEFAULT("histogram_samples"), "HistogramSample", + [&](perfetto::EventContext ctx) { + bool privacy_filtering_enabled = + CustomEventRecorder::GetInstance()->IsPrivacyFilteringEnabled(); + perfetto::protos::pbzero::ChromeHistogramSample* new_sample = + ctx.event()->set_chrome_histogram_sample(); + new_sample->set_name_hash(name_hash); + new_sample->set_sample(sample); + if (!privacy_filtering_enabled) { + size_t iid = InternedHistogramName::Get(&ctx, histogram_name); + new_sample->set_name_iid(iid); + } + }); +} + +} // namespace tracing
diff --git a/services/tracing/public/cpp/perfetto/custom_event_recorder.h b/services/tracing/public/cpp/perfetto/custom_event_recorder.h new file mode 100644 index 0000000..9136f5d --- /dev/null +++ b/services/tracing/public/cpp/perfetto/custom_event_recorder.h
@@ -0,0 +1,90 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_TRACING_PUBLIC_CPP_PERFETTO_CUSTOM_EVENT_RECORDER_H_ +#define SERVICES_TRACING_PUBLIC_CPP_PERFETTO_CUSTOM_EVENT_RECORDER_H_ + +#include "base/component_export.h" +#include "base/metrics/histogram_samples.h" +#include "base/metrics/statistics_recorder.h" +#include "base/metrics/user_metrics.h" +#include "base/sequence_checker.h" +#include "base/trace_event/trace_config.h" +#include "base/trace_event/typed_macros.h" +#include "third_party/perfetto/include/perfetto/tracing/internal/track_event_internal.h" + +namespace tracing { + +// A class that accompanies TraceEventDataSource to record some additional +// events like UMA histogram samples or user action samples. +class COMPONENT_EXPORT(TRACING_CPP) CustomEventRecorder + : public perfetto::TrackEventSessionObserver { + public: + static CustomEventRecorder* GetInstance(); + static void EmitRecurringUpdates(); + + CustomEventRecorder(const CustomEventRecorder&) = delete; + CustomEventRecorder& operator=(const CustomEventRecorder&) = delete; + + // perfetto::TrackEventSessionObserver implementation + void OnSetup(const perfetto::DataSourceBase::SetupArgs&) override; + void OnStop(const perfetto::DataSourceBase::StopArgs&) override; + void WillClearIncrementalState( + const perfetto::DataSourceBase::ClearIncrementalStateArgs&) override; + + void OnStartupTracingStarted( + const base::trace_event::TraceConfig& trace_config, + bool privacy_filtering_enabled); + void OnTracingStarted(const perfetto::DataSourceConfig& data_source_config); + void OnTracingStopped(base::OnceClosure stop_complete_callback); + + // Registered as a callback to receive every action recorded using + // base::RecordAction(), when tracing is enabled with a histogram category. + static void OnUserActionSampleCallback(const std::string& action, + base::TimeTicks action_time); + // Records trace event for a histogram sample. When histogram_samples category + // is enabled, it is registered with base::StatisticsRecorder to monitor the + // histograms listed in the trace config. If there are no histograms listed in + // the trace config, all the histograms will be monitored. + static void OnMetricsSampleCallback(const char* histogram_name, + uint64_t name_hash, + base::HistogramBase::Sample sample); + bool IsPrivacyFilteringEnabled(); + + private: + friend class base::NoDestructor<CustomEventRecorder>; + + CustomEventRecorder(); + ~CustomEventRecorder() override; + + SEQUENCE_CHECKER(perfetto_sequence_checker_); + // Extracts UMA histogram names that should be logged in traces and logs their + // starting values. + void ResetHistograms(const base::trace_event::TraceConfig& trace_config); + // Logs selected UMA histogram. + void LogHistograms(); + // Logs a given histogram in traces. + void LogHistogram(base::HistogramBase* histogram); + + // For each of the Histogram that we are tracking, cache the snapshot of their + // HistogramSamples from before tracing began. So that we can calculate the + // delta when we go to LogHistograms. + std::map<std::string, std::unique_ptr<base::HistogramSamples>> + startup_histogram_samples_; + std::vector<std::string> histograms_; + // Stores the registered histogram callbacks for which OnMetricsSampleCallback + // was set individually. + std::vector< + std::unique_ptr<base::StatisticsRecorder::ScopedHistogramSampleObserver>> + monitored_histograms_; + base::ActionCallback user_action_callback_ = + base::BindRepeating(&CustomEventRecorder::OnUserActionSampleCallback); + + base::Lock lock_; + bool privacy_filtering_enabled_ GUARDED_BY(lock_) = false; +}; + +} // namespace tracing + +#endif // SERVICES_TRACING_PUBLIC_CPP_PERFETTO_CUSTOM_EVENT_RECORDER_H_
diff --git a/services/tracing/public/cpp/perfetto/perfetto_traced_process.cc b/services/tracing/public/cpp/perfetto/perfetto_traced_process.cc index f7eebd67..b0f11f78 100644 --- a/services/tracing/public/cpp/perfetto/perfetto_traced_process.cc +++ b/services/tracing/public/cpp/perfetto/perfetto_traced_process.cc
@@ -14,6 +14,7 @@ #include "base/trace_event/trace_log.h" #include "base/tracing/perfetto_platform.h" #include "build/build_config.h" +#include "services/tracing/public/cpp/perfetto/custom_event_recorder.h" #include "services/tracing/public/cpp/perfetto/dummy_producer.h" #include "services/tracing/public/cpp/perfetto/perfetto_tracing_backend.h" #include "services/tracing/public/cpp/perfetto/producer_client.h" @@ -411,6 +412,7 @@ #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) perfetto::TrackEvent::Register(); SetTrackDescriptors(); + CustomEventRecorder::GetInstance(); #endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) }
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source.cc b/services/tracing/public/cpp/perfetto/trace_event_data_source.cc index 5aa48af8..02e0fb6 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source.cc +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source.cc
@@ -10,7 +10,6 @@ #include <utility> #include <vector> -#include "base/base64.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" @@ -19,12 +18,7 @@ #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" -#include "base/metrics/histogram_samples.h" -#include "base/metrics/metrics_hashes.h" -#include "base/metrics/statistics_recorder.h" -#include "base/metrics/user_metrics.h" #include "base/no_destructor.h" -#include "base/pickle.h" #include "base/rand_util.h" #include "base/sequence_checker.h" #include "base/strings/pattern.h" @@ -40,6 +34,7 @@ #include "base/tracing/tracing_tls.h" #include "build/build_config.h" #include "components/tracing/common/tracing_switches.h" +#include "services/tracing/public/cpp/perfetto/custom_event_recorder.h" #include "services/tracing/public/cpp/perfetto/macros.h" #include "services/tracing/public/cpp/perfetto/perfetto_producer.h" #include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h" @@ -55,20 +50,14 @@ #include "third_party/perfetto/include/perfetto/ext/tracing/core/trace_writer.h" #include "third_party/perfetto/include/perfetto/protozero/message.h" #include "third_party/perfetto/include/perfetto/tracing/track.h" -#include "third_party/perfetto/include/perfetto/tracing/track_event_interned_data_index.h" #include "third_party/perfetto/protos/perfetto/trace/chrome/chrome_metadata.pbzero.h" #include "third_party/perfetto/protos/perfetto/trace/chrome/chrome_trace_event.pbzero.h" #include "third_party/perfetto/protos/perfetto/trace/trace_packet.pbzero.h" -#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_histogram_sample.pbzero.h" -#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_process_descriptor.pbzero.h" -#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_user_event.pbzero.h" #include "third_party/perfetto/protos/perfetto/trace/track_event/process_descriptor.pbzero.h" #include "third_party/perfetto/protos/perfetto/trace/track_event/track_descriptor.pbzero.h" #if BUILDFLAG(IS_ANDROID) -#include "base/android/application_status_listener.h" #include "base/android/build_info.h" -#include "base/trace_event/application_state_proto_android.h" #endif using TraceLog = base::trace_event::TraceLog; @@ -86,18 +75,6 @@ TraceEventMetadataSource* g_trace_event_metadata_source_for_testing = nullptr; -void EmitRecurringUpdates() { -#if BUILDFLAG(IS_ANDROID) - static const ChromeProcessDescriptor::ProcessType process_type = - GetProcessType( - base::trace_event::TraceLog::GetInstance()->process_name()); - if (process_type == ChromeProcessDescriptor::PROCESS_BROWSER) { - auto state = base::android::ApplicationStatusListener::GetState(); - TRACE_APPLICATION_STATE(state); - } -#endif -} - static_assert( sizeof(TraceEventDataSource::SessionFlags) <= sizeof(uint64_t), "SessionFlags should remain small to ensure lock-free atomic operations"); @@ -660,20 +637,9 @@ << "SessionFlags are not atomic! We rely on efficient lock-free look-up " "of the session flags when emitting a trace event."; g_trace_event_data_source_for_testing = this; - -#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - perfetto::TrackEvent::AddSessionObserver(this); -#endif } -TraceEventDataSource::~TraceEventDataSource() -#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) -{ - perfetto::TrackEvent::RemoveSessionObserver(this); -} -#else // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - = default; -#endif // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) +TraceEventDataSource::~TraceEventDataSource() = default; void TraceEventDataSource::RegisterStartupHooks() { #if !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) @@ -687,24 +653,10 @@ void TraceEventDataSource::RegisterWithTraceLog( const base::trace_event::TraceConfig& trace_config) { -#if !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) TraceLog::GetInstance()->SetAddTraceEventOverrides( &TraceEventDataSource::OnAddLegacyTraceEvent, &TraceEventDataSource::FlushCurrentThread, &TraceEventDataSource::OnUpdateDuration); -#endif // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - - DCHECK(monitored_histograms_.empty()); - if (trace_config.IsCategoryGroupEnabled( - TRACE_DISABLED_BY_DEFAULT("histogram_samples")) && - trace_config.histogram_names().empty()) { - // The global callback can be added early at startup before main message - // loop is created. But histogram specific observers need task runner and - // are added when tracing service is setup in StartTracingInternal() - // instead. - base::StatisticsRecorder::SetGlobalSampleCallback( - &TraceEventDataSource::OnMetricsSampleCallback); - } base::AutoLock l(lock_); is_enabled_ = true; @@ -794,6 +746,10 @@ PerfettoProducer* producer, const base::trace_event::TraceConfig& trace_config, bool privacy_filtering_enabled) { +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + NOTREACHED() << "This is not expected to run in SDK build."; +#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + { AutoLockWithDeferredTaskPosting lock(lock_); // Do not enable startup tracing if trace log is being flushed. The @@ -827,6 +783,8 @@ config_for_trace_log.SetTraceBufferSizeInEvents(0); RegisterWithTraceLog(config_for_trace_log); + CustomEventRecorder::GetInstance()->OnStartupTracingStarted( + trace_config, privacy_filtering_enabled); #if !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) uint8_t modes = base::trace_event::TraceLog::RECORDING_MODE; @@ -928,26 +886,6 @@ } } -#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) -void TraceEventDataSource::OnSetup( - const perfetto::DataSourceBase::SetupArgs& args) { - GetTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&TraceEventDataSource::StartTracingImpl, - base::Unretained(this), nullptr, *args.config)); -} - -void TraceEventDataSource::OnStop( - const perfetto::DataSourceBase::StopArgs& args) { - std::function<void()> finish_async_stop = args.HandleStopAsynchronously(); - base::OnceClosure stop_callback = base::BindOnce( - [](std::function<void()> callback) { callback(); }, finish_async_stop); - GetTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&TraceEventDataSource::StopTracingImpl, - base::Unretained(this), std::move(stop_callback))); -} -#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - void TraceEventDataSource::StartTracingImpl( PerfettoProducer* producer, const perfetto::DataSourceConfig& data_source_config) { @@ -978,6 +916,10 @@ void TraceEventDataSource::StartTracingInternal( PerfettoProducer* producer, const perfetto::DataSourceConfig& data_source_config) { +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + NOTREACHED() << "This is not expected to run in SDK build."; +#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + DCHECK_CALLED_ON_VALID_SEQUENCE(perfetto_sequence_checker_); auto trace_config = TraceConfig(data_source_config.chrome_config().trace_config()); @@ -1029,55 +971,24 @@ // previously startup tracing, because the process name may have changed. EmitTrackDescriptor(); -#if !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) TraceLog::GetInstance()->SetEnabled(trace_config, TraceLog::RECORDING_MODE); -#endif - EmitRecurringUpdates(); - ResetHistograms(trace_config); - - DCHECK(monitored_histograms_.empty()); - if (trace_config.IsCategoryGroupEnabled( - TRACE_DISABLED_BY_DEFAULT("histogram_samples"))) { - // Note that global callback is setup in RegisterWithTraceLog() since it can - // be done in early startup and this observer needs message loop. - for (const std::string& histogram_name : trace_config.histogram_names()) { - monitored_histograms_.emplace_back( - std::make_unique< - base::StatisticsRecorder::ScopedHistogramSampleObserver>( - histogram_name, - base::BindRepeating( - &TraceEventDataSource::OnMetricsSampleCallback))); - } - } - - if (trace_config.IsCategoryGroupEnabled( - TRACE_DISABLED_BY_DEFAULT("user_action_samples"))) { - auto task_runner = base::GetRecordActionTaskRunner(); - if (task_runner) { - task_runner->PostTask( - FROM_HERE, base::BindOnce([]() { - base::AddActionCallback( - TraceEventDataSource::GetInstance()->user_action_callback_); - })); - } - } + CustomEventRecorder::GetInstance()->OnTracingStarted(data_source_config); } void TraceEventDataSource::StopTracingImpl( base::OnceClosure stop_complete_callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(perfetto_sequence_checker_); #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - // Write metadata events etc. - LogHistograms(); - std::move(stop_complete_callback).Run(); -#else // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + NOTREACHED() << "This is not expected to run in SDK build."; +#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + + CustomEventRecorder::GetInstance()->OnTracingStopped(base::OnceClosure()); + stop_complete_callback_ = std::move(stop_complete_callback); bool was_enabled = TraceLog::GetInstance()->IsEnabled(); if (was_enabled) { - // Write metadata events etc. - LogHistograms(); TraceLog::GetInstance()->SetDisabled(); } @@ -1143,72 +1054,6 @@ on_tracing_stopped_callback(this, trace_writer_raw, scoped_refptr<base::RefCountedString>(), false); } -#endif // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - - base::StatisticsRecorder::SetGlobalSampleCallback(nullptr); - monitored_histograms_.clear(); - - auto task_runner = base::GetRecordActionTaskRunner(); - if (task_runner) { - task_runner->PostTask( - FROM_HERE, base::BindOnce([]() { - base::RemoveActionCallback( - TraceEventDataSource::GetInstance()->user_action_callback_); - })); - } -} - -void TraceEventDataSource::LogHistogram(base::HistogramBase* histogram) { - if (!histogram) { - return; - } - // For the purpose of calculating metrics from histograms we only want the - // delta of the events. - auto samples = histogram->SnapshotSamples(); - - // If there were HistogramSamples recorded during startup, then those should - // be subtracted from the overall set. This way we only report the samples - // that occured during the run. - auto it = startup_histogram_samples_.find(histogram->histogram_name()); - if (it != startup_histogram_samples_.end()) { - samples->Subtract(*it->second.get()); - } - base::Pickle pickle; - samples->Serialize(&pickle); - std::string buckets; - base::Base64Encode( - std::string(static_cast<const char*>(pickle.data()), pickle.size()), - &buckets); - TRACE_EVENT_INSTANT2("benchmark,uma", "UMAHistogramSamples", - TRACE_EVENT_SCOPE_PROCESS, "name", - histogram->histogram_name(), "buckets", buckets); -} - -void TraceEventDataSource::ResetHistograms(const TraceConfig& trace_config) { - histograms_.clear(); - startup_histogram_samples_.clear(); - for (const std::string& histogram_name : trace_config.histogram_names()) { - histograms_.push_back(histogram_name); - auto* histogram = base::StatisticsRecorder::FindHistogram(histogram_name); - if (!histogram) { - continue; - } - - // For the purpose of calculating metrics from histograms we only want the - // delta of the events. However we do not want to emit the results when - // resetting. This will allow LogHistogram to emit one UMAHistogramSamples - // which encompasses only the histograms recorded during the trace. We - // cache the initial HistogramSamples so that they can be subtracted from - // the full snapshot at the end. - startup_histogram_samples_.emplace(histogram_name, - histogram->SnapshotSamples()); - } -} - -void TraceEventDataSource::LogHistograms() { - for (const std::string& histogram_name : histograms_) { - LogHistogram(base::StatisticsRecorder::FindHistogram(histogram_name)); - } } void TraceEventDataSource::Flush( @@ -1228,6 +1073,10 @@ } void TraceEventDataSource::ClearIncrementalState() { +#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + NOTREACHED() << "This is not expected to run in SDK build."; +#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + TrackEventThreadLocalEventSink::ClearIncrementalState(); EmitTrackDescriptor(); base::trace_event::TraceLog::GetInstance()->OnIncrementalStateCleared(); @@ -1355,64 +1204,6 @@ } } -namespace { - -struct InternedHistogramName - : public perfetto::TrackEventInternedDataIndex< - InternedHistogramName, - perfetto::protos::pbzero::InternedData::kHistogramNamesFieldNumber, - std::string> { - static void Add(perfetto::protos::pbzero::InternedData* interned_data, - size_t iid, - const std::string& histogram_name) { - auto* msg = interned_data->add_histogram_names(); - msg->set_iid(iid); - msg->set_name(histogram_name); - } -}; - -} // namespace - -// static -void TraceEventDataSource::OnMetricsSampleCallback( - const char* histogram_name, - uint64_t name_hash, - base::HistogramBase::Sample sample) { - TRACE_EVENT_INSTANT( - TRACE_DISABLED_BY_DEFAULT("histogram_samples"), "HistogramSample", - [&](perfetto::EventContext ctx) { - bool privacy_filtering_enabled = - TraceEventDataSource::GetInstance()->IsPrivacyFilteringEnabled(); - perfetto::protos::pbzero::ChromeHistogramSample* new_sample = - ctx.event()->set_chrome_histogram_sample(); - new_sample->set_name_hash(name_hash); - new_sample->set_sample(sample); - if (!privacy_filtering_enabled) { - size_t iid = InternedHistogramName::Get(&ctx, histogram_name); - new_sample->set_name_iid(iid); - } - }); -} - -void TraceEventDataSource::OnUserActionSampleCallback( - const std::string& action, - base::TimeTicks action_time) { - constexpr uint64_t kGlobalInstantTrackId = 0; - TRACE_EVENT_INSTANT( - TRACE_DISABLED_BY_DEFAULT("user_action_samples"), "UserAction", - perfetto::Track::Global(kGlobalInstantTrackId), - [&](perfetto::EventContext ctx) { - bool privacy_filtering_enabled = - TraceEventDataSource::GetInstance()->IsPrivacyFilteringEnabled(); - perfetto::protos::pbzero::ChromeUserEvent* new_sample = - ctx.event()->set_chrome_user_event(); - if (!privacy_filtering_enabled) { - new_sample->set_action(action); - } - new_sample->set_action_hash(base::HashMetricName(action)); - }); -} - void TraceEventDataSource::ReturnTraceWriter( std::unique_ptr<perfetto::TraceWriter> trace_writer) { { @@ -1562,7 +1353,7 @@ trace_packet = TracePacketHandle(); writer->NewTracePacket(); - EmitRecurringUpdates(); + CustomEventRecorder::EmitRecurringUpdates(); // Flush the current chunk right after writing the packet when in discard // buffering mode. Otherwise there's a risk that the chunk will miss the
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source.h b/services/tracing/public/cpp/perfetto/trace_event_data_source.h index 88329a6e..99b92d7 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source.h +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source.h
@@ -32,8 +32,6 @@ namespace base { -class HistogramSamples; - namespace trace_event { class TraceEvent; struct TraceEventHandle; @@ -150,11 +148,8 @@ // the PerfettoProducer. It converts incoming // trace events to ChromeTraceEvent protos and writes // them into the Perfetto shared memory. -class COMPONENT_EXPORT(TRACING_CPP) TraceEventDataSource : -#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - public perfetto::TrackEventSessionObserver, -#endif - public PerfettoTracedProcess::DataSourceBase { +class COMPONENT_EXPORT(TRACING_CPP) TraceEventDataSource + : public PerfettoTracedProcess::DataSourceBase { public: struct SessionFlags { // True if startup tracing is enabled for the current tracing session. @@ -198,25 +193,6 @@ bool IsEnabled(); bool IsPrivacyFilteringEnabled(); - // Records trace event for a histogram sample. When histogram_samples category - // is enabled, it is registered with base::StatisticsRecorder to monitor the - // histograms listed in the trace config. If there are no histograms listed in - // the trace config, all the histograms will be monitored. - static void OnMetricsSampleCallback(const char* histogram_name, - uint64_t name_hash, - base::HistogramBase::Sample sample); - - // Registered as a callback to receive every action recorded using - // base::RecordAction(), when tracing is enabled with a histogram category. - static void OnUserActionSampleCallback(const std::string& action, - base::TimeTicks action_time); - -#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - // perfetto::TrackEventSessionObserver: - void OnSetup(const perfetto::DataSourceBase::SetupArgs&) override; - void OnStop(const perfetto::DataSourceBase::StopArgs&) override; -#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) - private: friend class base::NoDestructor<TraceEventDataSource>; @@ -256,13 +232,6 @@ static base::trace_event::TracePacketHandle OnAddTracePacket(); static void OnAddEmptyPacket(); - // Extracts UMA histogram names that should be logged in traces and logs their - // starting values. - void ResetHistograms(const base::trace_event::TraceConfig& trace_config); - // Logs selected UMA histogram. - void LogHistograms(); - // Logs a given histogram in traces. - void LogHistogram(base::HistogramBase* histogram); void EmitTrackDescriptor(); uint32_t IncrementSessionIdOrClearStartupFlagWhileLocked(); @@ -291,24 +260,11 @@ bool is_enabled_ = false; bool flushing_trace_log_ = false; base::OnceClosure flush_complete_task_; - std::vector<std::string> histograms_; - // For each of the Histogram that we are tracking, cache the snapshot of their - // HistogramSamples from before tracing began. So that we can calculate the - // delta when we go to LogHistograms. - std::map<std::string, std::unique_ptr<base::HistogramSamples>> - startup_histogram_samples_; - // Stores the registered histogram callbacks for which OnMetricsSampleCallback - // was set individually. - std::vector< - std::unique_ptr<base::StatisticsRecorder::ScopedHistogramSampleObserver>> - monitored_histograms_; bool privacy_filtering_enabled_ = false; base::trace_event::TraceRecordMode record_mode_ = base::trace_event::RECORD_UNTIL_FULL; std::string process_name_; int process_id_ = base::kNullProcessId; - base::ActionCallback user_action_callback_ = - base::BindRepeating(&TraceEventDataSource::OnUserActionSampleCallback); }; } // namespace tracing
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc b/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc index 2923bcf..b5b5fc8 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc
@@ -34,6 +34,7 @@ #include "build/build_config.h" #include "components/tracing/common/tracing_switches.h" #include "services/tracing/perfetto/test_utils.h" +#include "services/tracing/public/cpp/perfetto/custom_event_recorder.h" #include "services/tracing/public/cpp/perfetto/macros.h" #include "services/tracing/public/cpp/perfetto/perfetto_config.h" #include "services/tracing/public/cpp/perfetto/producer_test_utils.h" @@ -108,7 +109,7 @@ #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) PerfettoTracedProcess::GetTaskRunner()->ResetTaskRunnerForTesting( base::ThreadTaskRunnerHandle::Get()); - TraceEventDataSource::GetInstance()->ResetForTesting(); + CustomEventRecorder::GetInstance(); //->ResetForTesting(); TraceEventMetadataSource::GetInstance()->ResetForTesting(); #else // !BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) PerfettoTracedProcess::GetTaskRunner()->GetOrCreateTaskRunner(); @@ -1905,15 +1906,15 @@ ExpectInternedEventNames(e_packet3, {{2u, "e2"}}); ExpectInternedDebugAnnotationNames(e_packet3, {{2u, "arg2"}}); - // Resetting the interning state causes ThreadDescriptor and interning - // entries to be emitted again, with the same interning IDs. - TraceEventDataSource::GetInstance()->ClearIncrementalState(); - #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) // TODO(skyostil): Perfetto doesn't let us clear the interning state // explicitly, so not testing that here for now. if (!i) break; +#else + // Resetting the interning state causes ThreadDescriptor and interning + // entries to be emitted again, with the same interning IDs. + TraceEventDataSource::GetInstance()->ClearIncrementalState(); #endif } }
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index f995ad0..3b2adcd 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -8365,7 +8365,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8450,7 +8450,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8875,7 +8875,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8960,7 +8960,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index d21bca2..716c7b7 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -46542,7 +46542,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46627,7 +46627,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47052,7 +47052,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47137,7 +47137,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47566,7 +47566,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47651,7 +47651,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48076,7 +48076,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48161,7 +48161,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48658,7 +48658,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48743,7 +48743,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49168,7 +49168,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49253,7 +49253,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49750,7 +49750,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49835,7 +49835,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -50260,7 +50260,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.115" + "revision": "version:103.0.5060.116" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -50345,7 +50345,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.33" + "revision": "version:104.0.5112.34" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index d476b59..eeec9c7 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5688,21 +5688,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -5715,7 +5715,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true, @@ -5853,21 +5853,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -5879,7 +5879,7 @@ }, "test": "lacros_chrome_browsertests", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "args": [ @@ -5999,21 +5999,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -6025,7 +6025,7 @@ }, "test": "lacros_chrome_browsertests_run_in_series", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests_run_in_series/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true,
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 245e8f8..f57b2304 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -92974,21 +92974,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -92996,7 +92996,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true, @@ -93109,28 +93109,28 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "lacros_chrome_browsertests", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "args": [ @@ -93230,28 +93230,28 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "lacros_chrome_browsertests_run_in_series", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests_run_in_series/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true, @@ -94589,20 +94589,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -94616,7 +94616,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "merge": { @@ -94754,20 +94754,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -94780,7 +94780,7 @@ }, "test": "lacros_chrome_browsertests", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "args": [ @@ -94900,20 +94900,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -94926,7 +94926,7 @@ }, "test": "lacros_chrome_browsertests_run_in_series", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests_run_in_series/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "merge": { @@ -96422,20 +96422,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -96449,7 +96449,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "merge": { @@ -96587,20 +96587,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -96613,7 +96613,7 @@ }, "test": "lacros_chrome_browsertests", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "args": [ @@ -96733,20 +96733,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -96759,7 +96759,7 @@ }, "test": "lacros_chrome_browsertests_run_in_series", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests_run_in_series/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "merge": { @@ -97494,20 +97494,20 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -97520,7 +97520,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" } ] },
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index db48f70..bf1977d03 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -20874,21 +20874,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5158.0", + "name": "interactive_ui_tests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -20901,7 +20901,7 @@ }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true, @@ -21039,21 +21039,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -21065,7 +21065,7 @@ }, "test": "lacros_chrome_browsertests", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "args": [ @@ -21185,21 +21185,21 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome" ], "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5158.0", + "name": "lacros_chrome_browsertests_run_in_series Lacros version skew testing ash 105.0.5159.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v105.0.5158.0", - "revision": "version:105.0.5158.0" + "location": "lacros_version_skew_tests_v105.0.5159.0", + "revision": "version:105.0.5159.0" } ], "dimension_sets": [ @@ -21211,7 +21211,7 @@ }, "test": "lacros_chrome_browsertests_run_in_series", "test_id_prefix": "ninja://chrome/test:lacros_chrome_browsertests_run_in_series/", - "variant_id": "Lacros version skew testing ash 105.0.5158.0" + "variant_id": "Lacros version skew testing ash 105.0.5159.0" }, { "isolate_profile_data": true,
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 211b997..254b59d3 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -22,15 +22,15 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5158.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v105.0.5159.0/test_ash_chrome', ], - 'identifier': 'Lacros version skew testing ash 105.0.5158.0', + 'identifier': 'Lacros version skew testing ash 105.0.5159.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v105.0.5158.0', - 'revision': 'version:105.0.5158.0', + 'location': 'lacros_version_skew_tests_v105.0.5159.0', + 'revision': 'version:105.0.5159.0', }, ], }, @@ -546,7 +546,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.33' + 'revision': 'version:104.0.5112.34' } ] } @@ -570,7 +570,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.115' + 'revision': 'version:103.0.5060.116' } ] } @@ -690,7 +690,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.33' + 'revision': 'version:104.0.5112.34' } ] } @@ -714,7 +714,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.115' + 'revision': 'version:103.0.5060.116' } ] } @@ -834,7 +834,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.33' + 'revision': 'version:104.0.5112.34' } ] } @@ -858,7 +858,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.115' + 'revision': 'version:103.0.5060.116' } ] }
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 1028f4da..ffa2fac 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -372,10 +372,6 @@ // By default, setting nodeValue has no effect. } -ContainerNode* Node::parentNode() const { - return IsShadowRoot() ? nullptr : ParentOrShadowHostNode(); -} - NodeList* Node::childNodes() { auto* this_node = DynamicTo<ContainerNode>(this); if (this_node)
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index ff5dda028..edca080 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -216,7 +216,10 @@ virtual void setNodeValue(const String&, ExceptionState& = ASSERT_NO_EXCEPTION); virtual NodeType getNodeType() const = 0; - ContainerNode* parentNode() const; + ContainerNode* parentNode() const { + return IsShadowRoot() ? nullptr : ParentOrShadowHostNode(); + } + Element* parentElement() const; ContainerNode* ParentElementOrShadowRoot() const; ContainerNode* ParentElementOrDocumentFragment() const;
diff --git a/third_party/blink/renderer/core/layout/layout_inline.cc b/third_party/blink/renderer/core/layout/layout_inline.cc index 905cbf4..09bf0313 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.cc +++ b/third_party/blink/renderer/core/layout/layout_inline.cc
@@ -410,6 +410,9 @@ style.MayHaveMargin()) return true; + if (!style.AnchorName().IsNull()) + return true; + return ComputeIsAbsoluteContainer(&style) || NGOutlineUtils::HasPaintedOutline(style, GetNode()) || CanBeHitTestTargetPseudoNodeStyle(style);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc index e8818ee..e60567fe 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc
@@ -105,6 +105,65 @@ AnchorTestData{"--div3", PhysicalRect(0, 70, 800, 0)})); } +TEST_F(NGAnchorQueryTest, Inline) { + LoadAhem(); + SetBodyInnerHTML(R"HTML( + <style> + html, body { + margin: 0; + width: 800px; + font-family: Ahem; + font-size: 10px; + line-height: 1; + } + img { + width: 10px; + height: 8px; + } + .after .add { + anchor-name: --add; + } + </style> + <div id="container"> + 0 + <!-- culled and non-culled inline boxes. --> + <span style="anchor-name: --culled">23</span> + <span style="anchor-name: --non-culled; background: yellow">56</span> + + <!-- Adding `anchor-name` dynamically should uncull. --> + <span class="add">89</span> + + <!-- Atomic inlines: replaced elements and inline blocks. --> + <img style="anchor-name: --img" src="data:image/gif;base64,R0lGODlhAQABAAAAACw="> + <span style="anchor-name: --inline-block; display: inline-block">X</span> + </div> + )HTML"); + Element* container = GetElementById("container"); + const NGPhysicalAnchorQuery* anchor_query = AnchorQuery(*container); + ASSERT_NE(anchor_query, nullptr); + EXPECT_THAT( + AnchorTestData::ToList(*anchor_query), + testing::ElementsAre( + AnchorTestData{"--culled", PhysicalRect(20, 0, 20, 10)}, + AnchorTestData{"--img", PhysicalRect(110, 0, 10, 8)}, + AnchorTestData{"--inline-block", PhysicalRect(130, 0, 10, 10)}, + AnchorTestData{"--non-culled", PhysicalRect(50, 0, 20, 10)})); + + // Add the "after" class and test anchors are updated accordingly. + container->classList().Add("after"); + UpdateAllLifecyclePhasesForTest(); + anchor_query = AnchorQuery(*container); + ASSERT_NE(anchor_query, nullptr); + EXPECT_THAT( + AnchorTestData::ToList(*anchor_query), + testing::ElementsAre( + AnchorTestData{"--add", PhysicalRect(80, 0, 20, 10)}, + AnchorTestData{"--culled", PhysicalRect(20, 0, 20, 10)}, + AnchorTestData{"--img", PhysicalRect(110, 0, 10, 8)}, + AnchorTestData{"--inline-block", PhysicalRect(130, 0, 10, 10)}, + AnchorTestData{"--non-culled", PhysicalRect(50, 0, 20, 10)})); +} + TEST_F(NGAnchorQueryTest, OutOfFlow) { SetBodyInnerHTML(R"HTML( <style>
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 70504b78..fdba8e1a 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -7146,3 +7146,8 @@ # Sheriff 2022-06-30 crbug.com/1340781 virtual/android/fullscreen/full-screen-table-section.html [ Skip ] crbug.com/1327867 http/tests/inspector-protocol/network/initiator-minified.js [ Failure Pass ] + +# Temporarily disable the tests during the rollout of V8 that fixes the +# behaviors that the test cases excersise. +crbug.com/1305302 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value-cross-realm.html [ Skip ] +crbug.com/1305302 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value.any.html [ Skip ]
diff --git a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations index 417c578..ecdce06e 100644 --- a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations +++ b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations
@@ -375,7 +375,6 @@ crbug.com/1050754 external/wpt/IndexedDB/transaction-abort-generator-revert.html [ Failure Pass ] crbug.com/1050754 external/wpt/WebCryptoAPI/historical.any.sharedworker.html [ Failure ] crbug.com/1050754 external/wpt/WebIDL/ecmascript-binding/global-immutable-prototype.any.sharedworker.html [ Failure ] -crbug.com/1050754 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value.any.html [ Failure ] crbug.com/1050754 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value.any.serviceworker.html [ Failure ] crbug.com/1050754 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value.any.sharedworker.html [ Failure ] crbug.com/1050754 external/wpt/WebIDL/ecmascript-binding/global-object-implicit-this-value.any.worker.html [ Failure ]
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/cross-origin-access-is-restricted.html b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/cross-origin-access-is-restricted.html new file mode 100644 index 0000000..1d1c113 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/cross-origin-access-is-restricted.html
@@ -0,0 +1,65 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title> + Verify that certain location interface properties are protected cross-origin. +</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/dispatcher/dispatcher.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/common/utils.js"></script> + +<body></body> <!-- Needed to append the iframe --> + +<script> + +const iframeToken = token(); +const responseToken = token(); +const iframeUrl = + get_host_info().REMOTE_ORIGIN + + "/common/dispatcher/executor.html?uuid=" + + iframeToken; + +const iframe = document.createElement("iframe"); +iframe.src = iframeUrl; +document.body.appendChild(iframe); + +[ + "assign", + "customproperty", + "hash", + "host", + "hostname", + "pathname", + "port", + "protocol", + "reload", + "search", + "toString", + "valueOf", +].forEach(property => { + promise_test(async t => { + // Make sure the cross-origin document is loaded in the iframe. + send(iframeToken, `send("${responseToken}", "Responsive");`); + assert_equals(await receive(responseToken), "Responsive"); + + assert_throws_dom("SecurityError", () => { + const unused = iframe.contentWindow.location[property]; + }, "Cross origin get of a location property should throw a security error"); + + assert_throws_dom("SecurityError", () => { + iframe.contentWindow.location[property] = "Random string"; + }, "Cross origin set of a location property should throw a security error"); + + // Verify that the property was indeed not modified. + send(iframeToken, `send("${responseToken}", location["${property}"])`); + assert_true(await receive(responseToken) != "Random string"); + + assert_throws_dom("SecurityError", () => { + const unused = Object.getOwnPropertyDescriptor( + iframe.contentWindow.location, property); + }, "Cross origin get of descriptors should throw a security error"); + }, `Verifying that cross-origin access of '${property}' is restricted`); +}); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js index 82d42230..83344e5 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js
@@ -1 +1,2 @@ +// META: global=window,dedicatedworker,sharedworker,serviceworker test(t => assert_equals(crossOriginEmbedderPolicy, "credentialless"));
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js index c96b8f3..ed668d8 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js
@@ -1 +1,2 @@ +// META: global=window,dedicatedworker,sharedworker,serviceworker test(t => assert_equals(crossOriginEmbedderPolicy, "require-corp"));
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js index 4694f91..0746d73 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js
@@ -1 +1,2 @@ +// META: global=window,dedicatedworker,sharedworker,serviceworker test(t => assert_equals(crossOriginEmbedderPolicy, "unsafe-none"));
diff --git a/third_party/blink/web_tests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html b/third_party/blink/web_tests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html index 555c5182..deeba613 100644 --- a/third_party/blink/web_tests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html +++ b/third_party/blink/web_tests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
@@ -1,3 +1,4 @@ +<!DOCTYPE html> <html> <head> <script src="resources/cross-frame-access.js"></script> @@ -250,19 +251,6 @@ var property = windowAttributesPropertiesAllowed[i]; shouldBeTrue("canGetDescriptor(targetWindow, '" + property + "')"); } - log("----- tests access to cross domain location object -----"); - window.targetLocation = targetWindow.location; - var locationProperties = [ - "protocol", "host", "hostname", "port", "pathname", "search", "hash", "toString", "valueOf", "customProperty", "assign", "reload" - ]; - for (var i = 0; i < locationProperties.length; i++) - shouldBeFalse("canGetDescriptor(targetLocation, '" + locationProperties[i] + "')"); - var locationPropertiesAllowed = [ - "replace" - ]; - for (var i = 0; i < locationPropertiesAllowed.length; i++) - shouldBeTrue("canGetDescriptor(targetLocation, '" + locationPropertiesAllowed[i] + "')"); - log("----- tests access to cross domain history object -----"); shouldThrowException("targetWindow.history");
diff --git a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-get-override.html b/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-get-override.html deleted file mode 100644 index 1749c0e..0000000 --- a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-get-override.html +++ /dev/null
@@ -1,38 +0,0 @@ -<html> -<head> - <script src="resources/cross-frame-access.js"></script> - <script> - window.onload = function() - { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.targetWindow = frames[0]; - - log("----- tests for getting a targetWindow's location object's functions which have custom overrides. The" + - " desired behavior is for the targetWindow to return the builtin function, not the override -----\n"); - - // We should test overriding using window.location.__proto__ once the Location object has a proper prototype. - - // Overriden using window.location.assign = function() { return "new assign" } - shouldBeFalse("canGet('targetWindow.location.assign')"); - - // Overriden using window.location.reload = "new reload" - shouldBeFalse("canGet('targetWindow.location.reload')"); - - // Overriden using window.location.replace = "new replace" - shouldBeTrue("canGet('targetWindow.location.replace')"); - shouldBe("targetWindow.location.replace.name", "''"); - - if (window.testRunner) - testRunner.notifyDone(); - } - </script> -</head> -<body> -<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-location-get-override-test.html"></iframe> -<pre id="console"></pre> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-prototype.html b/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-prototype.html deleted file mode 100644 index 1750e67..0000000 --- a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-prototype.html +++ /dev/null
@@ -1,28 +0,0 @@ -<script> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - function log(msg) - { - document.getElementById("console").appendChild(document.createTextNode(msg + "\n")); - } - - addEventListener("message", function() - { - if (window.location.fail) { - log("FAIL: Location object prototype tainted."); - } else { - log("PASS: Location object prototype not tainted."); - } - - if (window.testRunner) - testRunner.notifyDone(); - }, false); -</script> -<body> - <pre id="console"></pre> - <iframe src="http://localhost:8000/security/resources/cross-frame-location-prototype-iframe.html"></iframe> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-put.html b/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-put.html deleted file mode 100644 index bb4253c..0000000 --- a/third_party/blink/web_tests/http/tests/security/cross-frame-access-location-put.html +++ /dev/null
@@ -1,57 +0,0 @@ -<html> -<head> - <script src="resources/cross-frame-access.js"></script> - <script> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.dumpChildFrames(); - testRunner.waitUntilDone(); - } - - onload = function() - { - // Add manual run buttons if the browser does not support window.postMessage - if (!window.postMessage) { - log("YOUR BROWSER DOES NOT SUPPORT window.postMessage"); - log("To run this test manually, first click the button titled 'Step 1 - Set Test' in this frame."); - log("Then click the button in the sub frame titled 'Step 2 - Set Check' to finish the test.\n"); - - var button = document.createElement("button"); - button.appendChild(document.createTextNode("Step 1 - Set Test")); - button.onclick = setTest; - document.body.appendChild(button); - } - } - - receiver = function(e) - { - if (e.data == "storedOldValuesComplete") - setTest(); - } - addEventListener('message', receiver, false); - - setTest = function() - { - window.targetWindow = frames[0]; - - // Put testing for the many og standard attibutes of the location object is handeled in stand alone test - // cases because they may produce side effects. - try { targetWindow.location.assign = "FAIL!! CUSTOM assign"; } catch(e) { log(e); } - try { targetWindow.location.replace = "FAIL!! CUSTOM replace"; } catch(e) { log(e); } - try { targetWindow.location.reload = "FAIL!! CUSTOM reload"; } catch(e) { log(e); } - try { targetWindow.location.toString = "FAIL!! CUSTOM toString"; } catch(e) { log(e); } - - try { targetWindow.location.customAttribute = "FAIL!! CUSTOM customAttribute"; } catch(e) { log(e); } - - if (window.postMessage) - targetWindow.postMessage("settingValuesComplete", "*"); - else - log("\nSet Test complete! Click button entitled 'Step 2 - Set Check' to finish the test."); - } - </script> -</head> -<body> - <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-location-put-test.html"></iframe> - <pre id="console"></pre> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-get-override-test.html b/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-get-override-test.html deleted file mode 100644 index adc1690..0000000 --- a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-get-override-test.html +++ /dev/null
@@ -1,11 +0,0 @@ -<html> -<head> - <script> - window.location.assign = function() { return "new assign"; } - window.location.reload = "new reload"; - window.location.replace = "new replace"; - </script> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-put-test.html b/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-put-test.html deleted file mode 100644 index be276849..0000000 --- a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-iframe-for-location-put-test.html +++ /dev/null
@@ -1,58 +0,0 @@ -<html> -<head> - <script src="cross-frame-access.js"></script> - <script> - var assignOld; - var replaceOld; - var reloadOld; - var toStringOld; - var customAttributeOld; - - receiver = function(e) - { - if (e.data == "settingValuesComplete") - setCheck(); - } - addEventListener('message', receiver, false); - - window.onload = function() - { - // Add manuel run buttons if the browser does not support window.postMessage - if (!window.postMessage) { - var button = document.createElement("button"); - button.appendChild(document.createTextNode("Step 2 - Set Check")); - button.onclick = setCheck; - document.body.appendChild(button); - } - - window.location.customAttribute = "customAttribute"; - - assignOld = window.location.assign; - replaceOld = window.location.replace; - reloadOld = window.location.reload; - toStringOld = window.location.toString; - customAttributeOld = window.location.customAttribute; - - if (window.postMessage) - window.parent.postMessage("storedOldValuesComplete", "*"); - } - - setCheck = function() - { - log("\n----- tests for putting window.history and its properties -----\n"); - - shouldBe("window.location.assign", "assignOld"); - shouldBe("window.location.replace", "replaceOld"); - shouldBe("window.location.reload", "reloadOld"); - shouldBe("window.location.toString", "toStringOld"); - shouldBe("window.location.customAttribute", "customAttributeOld"); - - if (window.testRunner) - testRunner.notifyDone(); - } - </script> -</head> -<body> - <pre id="console"></pre> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-location-prototype-iframe.html b/third_party/blink/web_tests/http/tests/security/resources/cross-frame-location-prototype-iframe.html deleted file mode 100644 index 1f90ecc..0000000 --- a/third_party/blink/web_tests/http/tests/security/resources/cross-frame-location-prototype-iframe.html +++ /dev/null
@@ -1,5 +0,0 @@ -<script> -parent.location; -Object.prototype.fail = "fail"; -parent.postMessage("done", "*"); -</script>
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.serviceworker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.serviceworker-expected.txt new file mode 100644 index 0000000..cbc0240c --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.serviceworker-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL reflection-credentialless assert_equals: expected "credentialless" but got "unsafe-none" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.sharedworker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.sharedworker-expected.txt new file mode 100644 index 0000000..cbc0240c --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.sharedworker-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL reflection-credentialless assert_equals: expected "credentialless" but got "unsafe-none" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.serviceworker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.serviceworker-expected.txt new file mode 100644 index 0000000..0e8a176 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.serviceworker-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL reflection-require-corp assert_equals: expected "require-corp" but got "unsafe-none" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.sharedworker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.sharedworker-expected.txt new file mode 100644 index 0000000..0e8a176 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.sharedworker-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL reflection-require-corp assert_equals: expected "require-corp" but got "unsafe-none" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt b/third_party/blink/web_tests/platform/generic/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt index 3010a8184..9531474 100644 --- a/third_party/blink/web_tests/platform/generic/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt +++ b/third_party/blink/web_tests/platform/generic/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt
@@ -208,20 +208,6 @@ PASS: canGetDescriptor(targetWindow, 'self') should be 'true' and is. PASS: canGetDescriptor(targetWindow, 'top') should be 'true' and is. PASS: canGetDescriptor(targetWindow, 'window') should be 'true' and is. ------ tests access to cross domain location object ----- -PASS: canGetDescriptor(targetLocation, 'protocol') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'host') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'hostname') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'port') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'pathname') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'search') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'hash') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'toString') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'valueOf') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'customProperty') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'assign') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'reload') should be 'false' and is. -PASS: canGetDescriptor(targetLocation, 'replace') should be 'true' and is. ----- tests access to cross domain history object ----- PASS: targetWindow.history should have thrown an exception, and did: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame.
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 7641e55e..e5163d1 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -311,6 +311,8 @@ 'chromium.fyi': { 'Afl Upload Linux ASan': 'afl_asan_shared_release_bot', + # Keep in sync with linux-rel, but with reclient. + 'Build Perf Linux': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage_do_typecheck_reclient', 'CFI Linux CF (reclient shadow)': 'cfi_full_cfi_icall_cfi_diag_recover_release_static_reclient', 'Comparison Android (reclient)': { 'goma': 'android_webview_google_debug_static_bot_arm64', @@ -2742,6 +2744,10 @@ 'gpu_tests', 'release_trybot', 'no_symbols', 'use_dummy_lastchange', 'use_clang_coverage', 'partial_code_coverage_instrumentation', 'devtools_do_typecheck', ], + 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage_do_typecheck_reclient': [ + 'gpu_tests', 'release_trybot_reclient', 'no_symbols', 'use_dummy_lastchange', + 'use_clang_coverage', 'partial_code_coverage_instrumentation', 'devtools_do_typecheck', + ], 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_invert_fieldtrials': [ 'gpu_tests', 'release_trybot', 'no_symbols', 'use_dummy_lastchange',
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index 292f3f5..2bfe417 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -15,6 +15,21 @@ "use_goma": true } }, + "Build Perf Linux": { + "gn_args": { + "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", + "dcheck_always_on": true, + "devtools_skip_typecheck": false, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "symbol_level": 0, + "use_clang_coverage": true, + "use_dummy_lastchange": true, + "use_remoteexec": true + } + }, "CFI Linux CF (reclient shadow)": { "gn_args": { "dcheck_always_on": false,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index af6ef1d..9b2e8033 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -1688,9 +1688,14 @@ <enum name="AlternateProtocolUsage"> <int value="0" label="ALTERNATE_PROTOCOL_USAGE_NO_RACE"/> <int value="1" label="ALTERNATE_PROTOCOL_USAGE_WON_RACE"/> - <int value="2" label="ALTERNATE_PROTOCOL_USAGE_LOST_RACE"/> + <int value="2" label="ALTERNATE_PROTOCOL_USAGE_MAIN_JOB_WON_RACE"/> <int value="3" label="ALTERNATE_PROTOCOL_USAGE_MAPPING_MISSING"/> - <int value="4" label="ALTERNATE_PROTOCOL_USAGE_BROKEN"/> + <int value="4" + label="ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE"/> + <int value="5" label="ALTERNATE_PROTOCOL_USAGE_BROKEN"/> + <int value="6" + label="ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_WITOUT_RACE"/> + <int value="7" label="ALTERNATE_PROTOCOL_USAGE_DNS_ALPN_H3_JOB_WON_RACE"/> </enum> <enum name="AlternativeServiceType"> @@ -35487,7 +35492,7 @@ <int value="210" label="kEnterpriseReportingPrivate"/> <int value="211" label="kCecPrivate"/> <int value="212" label="kSafeBrowsingPrivate"/> - <int value="213" label="kFileSystemRequestDownloads"/> + <int value="213" label="kDeleted_FileSystemRequestDownloads"/> <int value="214" label="kDeleted_SystemPowerSource"/> <int value="215" label="kArcAppsPrivate"/> <int value="216" label="kEnterpriseHardwarePlatform"/> @@ -42242,6 +42247,7 @@ <int value="1" label="Audio"/> <int value="2" label="Images"/> <int value="3" label="Videos"/> + <int value="4" label="Documents"/> </enum> <enum name="FileManagerRootType"> @@ -55507,6 +55513,7 @@ <int value="-1861278695" label="BulkTabRestore:enabled"/> <int value="-1860481724" label="ChromeHomeExpandButton:enabled"/> <int value="-1860477300" label="DefaultStyleSheetsEarlyInit:disabled"/> + <int value="-1860342103" label="UseDnsHttpsSvcbAlpn:disabled"/> <int value="-1859437916" label="enable-experimental-accessibility-dictation-offline"/> <int value="-1859421131" label="BackForwardCache:disabled"/> @@ -60253,6 +60260,7 @@ <int value="1205849612" label="enable-sync-synced-notifications"/> <int value="1205929554" label="SendTabToSelfOmniboxSendingAnimation:enabled"/> <int value="1206140820" label="RelatedSearchesInBar:disabled"/> + <int value="1206486242" label="UseDnsHttpsSvcbAlpn:enabled"/> <int value="1210298193" label="FontAccessPersistent:enabled"/> <int value="1210343926" label="enable-drop-sync-credential"/> <int value="1211284676" label="V8NoTurbo:enabled"/>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index 98477cf..e6e1d2f8 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -263,6 +263,7 @@ Number of ARC Apps killed by {ArcAppKillType} in each interval of 10 minutes. </summary> + <token key="ArcAppKillType" variants="ArcAppKillType"/> </histogram> <histogram @@ -274,6 +275,8 @@ Number of ARC Apps killed by {ArcAppKillType} in each interval of 10 minutes when {ArcBackgroundVms}. </summary> + <token key="ArcAppKillType" variants="ArcAppKillType"/> + <token key="ArcBackgroundVms" variants="ArcBackgroundVms"/> </histogram> <histogram name="Arc.App.PrimaryAbi" enum="AppPrimaryAbi"
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 0ab8288..d8987eb 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -14,7 +14,7 @@ }, "mac": { "hash": "86145908aed91663341ff82850a62108e55baac2", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/d86457ab539f83842f0e6c891c459bd764267b8d/trace_processor_shell" + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/bb4e6b261ffdcda41c15bf830e594f9c9fe0ce3e/trace_processor_shell" }, "mac_arm64": { "hash": "e1ad4861384b06d911a65f035317914b8cc975c6", @@ -22,7 +22,7 @@ }, "linux": { "hash": "3963de6f2c1864244db56893a436bf609dcda8a3", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/d86457ab539f83842f0e6c891c459bd764267b8d/trace_processor_shell" + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/bb4e6b261ffdcda41c15bf830e594f9c9fe0ce3e/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/accessibility/test_ax_tree_update_json_reader.cc b/ui/accessibility/test_ax_tree_update_json_reader.cc index 8f28331..794edd3 100644 --- a/ui/accessibility/test_ax_tree_update_json_reader.cc +++ b/ui/accessibility/test_ax_tree_update_json_reader.cc
@@ -124,13 +124,15 @@ } // In a few cases, role values in JSON file are different from the ones used in -// AxEnumUtils::ToString and need preprocessing. -// TODO(https://crbug.com/1278249): Investigate why and if this can be fixed -// upstream. +// AxEnumUtils::ToString and need preprocessing. This function and the entire +// class will be removed after Screen2X starts using Chrome for training data +// proto generation. ax::mojom::Role RoleFromString(std::string role) { + // TODO(https://crbug.com/1278249): Consider using + // GetScreen2xRoleFromChromeRole in proto_convertor.cc or add test to ensure + // the conversions match. if (role == "combobox") - // TODO(https://crbug.com/1278249): Find a replacement. - return ax::mojom::Role::kUnknown; + role = "comboBoxGrouping"; else if (role == "contentinfo") role = "contentInfo"; else if (role == "DescriptionList")
diff --git a/ui/chromeos/strings/network_element_localized_strings_provider.cc b/ui/chromeos/strings/network_element_localized_strings_provider.cc index ba8d2c0..58cd14de 100644 --- a/ui/chromeos/strings/network_element_localized_strings_provider.cc +++ b/ui/chromeos/strings/network_element_localized_strings_provider.cc
@@ -8,8 +8,8 @@ #include "base/feature_list.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/network/network_connection_handler.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/login/localized_values_builder.h" #include "components/strings/grit/components_strings.h"
diff --git a/ui/chromeos/translations/ui_chromeos_strings_it.xtb b/ui/chromeos/translations/ui_chromeos_strings_it.xtb index 11184af..1d0dedf 100644 --- a/ui/chromeos/translations/ui_chromeos_strings_it.xtb +++ b/ui/chromeos/translations/ui_chromeos_strings_it.xtb
@@ -229,7 +229,7 @@ <translation id="3003633581067744647">Passa alla visualizzazione miniatura</translation> <translation id="3016566519832145558">Attenzione: questi file sono temporanei e potrebbero essere eliminati automaticamente per liberare spazio su disco.</translation> <translation id="3029114385395636667">Attiva Documenti Google offline per rendere disponibili offline documenti, fogli e presentazioni.</translation> -<translation id="303198083543495566">Area geografica</translation> +<translation id="303198083543495566">Regione</translation> <translation id="3047197340186497470">Cinese Dayi</translation> <translation id="3057861065630527966">Effettua il backup di foto e video</translation> <translation id="3067790092342515856">File di Windows</translation>
diff --git a/ui/chromeos/translations/ui_chromeos_strings_km.xtb b/ui/chromeos/translations/ui_chromeos_strings_km.xtb index ed45d2f1..a4d0d112 100644 --- a/ui/chromeos/translations/ui_chromeos_strings_km.xtb +++ b/ui/chromeos/translations/ui_chromeos_strings_km.xtb
@@ -11,6 +11,7 @@ <translation id="1120073797882051782">រ៉ូម៉ាចាហានគុល</translation> <translation id="112387589102719461">ភាសាអង់គ្លេស (សហរដ្ឋអាមេរិក) ដែលប្រើក្ដារចុច Dvorak សម្រាប់អ្នកសរសេរកម្មវិធី</translation> <translation id="1134697384939541955">ភាសាអង់គ្លេស (សហរដ្ឋអាមេរិក) ដែលប្រើក្ដារចុចបន្ថែម</translation> +<translation id="1138691154716715755">ដើមខែនេះ</translation> <translation id="1148097584170732637">បានរកឃើញ <ph name="FILE_COUNT" /> ។ <ph name="LINE_BREAK1" /> មិនមានទំហំផ្ទុកទំនេរគ្រប់គ្រាន់នៅក្នុងទំហំផ្ទុកមូលដ្ឋានទេ។ ត្រូវការទំហំបន្ថែម <ph name="FILE_SIZE" /> ។ @@ -378,6 +379,7 @@ <translation id="4380245540200674032">បណ្ដាញ <ph name="NETWORK_INDEX" /> នៃ <ph name="NETWORK_COUNT" />, <ph name="NETWORK_NAME" />, <ph name="NETWORK_PROVIDER_NAME" />, <ph name="CONNECTION_STATUS" />, កម្លាំងរលកសញ្ញា <ph name="SIGNAL_STRENGTH" />%, គ្រប់គ្រងដោយអ្នកគ្រប់គ្រងរបស់អ្នក, ព័ត៌មានលម្អិត</translation> <translation id="4387004326333427325">វិញ្ញាបនប័ត្រសម្គាល់អត្តសញ្ញាណបានបដិសេធពីចម្ងាយ</translation> <translation id="4394214039309501350">តំណខាងក្រៅ</translation> +<translation id="4394980935660306080">ដើមសប្ដាហ៍នេះ</translation> <translation id="4401287888955153199">ដកទាំងអស់</translation> <translation id="4410695710508688828">ការស្រង់ប្រតិបត្តិការមិនបានសម្រេចទេ។ <ph name="ERROR_MESSAGE" /></translation> <translation id="4418686080762064601">បង្កើតផ្លូវកាត់សម្រាប់ឯកសាររបស់អ្នក</translation> @@ -421,6 +423,7 @@ <translation id="4712283082407695269">កំពុងបើក "<ph name="PATH" />"</translation> <translation id="4720185134442950733">បណ្ដាញទិន្នន័យទូរសព្ទចល័ត</translation> <translation id="4724850507808590449">រូបថតចំនួន<ph name="FILE_COUNT" /> ត្រូវបានបម្រុងទុក</translation> +<translation id="4725096204469550614">ដើមឆ្នាំនេះ</translation> <translation id="4725511304875193254">ឆ្កែខកហ្គី</translation> <translation id="4737050008115666127">ផ្លូវចុះចត</translation> <translation id="4747271164117300400">ម៉ាសេដូនី</translation>
diff --git a/ui/chromeos/translations/ui_chromeos_strings_uz.xtb b/ui/chromeos/translations/ui_chromeos_strings_uz.xtb index 3584d5f..2b817d3 100644 --- a/ui/chromeos/translations/ui_chromeos_strings_uz.xtb +++ b/ui/chromeos/translations/ui_chromeos_strings_uz.xtb
@@ -11,6 +11,7 @@ <translation id="1120073797882051782">Koreys kiritish usuli (Romaja)</translation> <translation id="112387589102719461">Ingliz (AQSH) va Dvorak dasturchilar klaviaturasi</translation> <translation id="1134697384939541955">Ingliz (AQSH) va Kengaytirilgan klaviatura</translation> +<translation id="1138691154716715755">Shu oy boshi</translation> <translation id="1148097584170732637"><ph name="FILE_COUNT" /> ta fayl topildi. <ph name="LINE_BREAK1" /> Xotirada bo‘sh joy yetishmaydi. Yana <ph name="FILE_SIZE" /> kerak. @@ -378,6 +379,7 @@ <translation id="4380245540200674032">Tarmoq: <ph name="NETWORK_INDEX" />/<ph name="NETWORK_COUNT" />, Nomi: <ph name="NETWORK_NAME" />, Himoyasi: <ph name="NETWORK_PROVIDER_NAME" />, Ulanish: <ph name="CONNECTION_STATUS" />, Signal darajasi: <ph name="SIGNAL_STRENGTH" />%, Administrator boshqaruvida, Batafsil</translation> <translation id="4387004326333427325">Haqiqiylikni tekshirish sertifikati masofadan turib rad etildi</translation> <translation id="4394214039309501350">Tashqi havola</translation> +<translation id="4394980935660306080">Shu hafta boshi</translation> <translation id="4401287888955153199">Barchasini ajratish</translation> <translation id="4410695710508688828">Arxivdan chiqarish amali bajarilmadi. <ph name="ERROR_MESSAGE" /></translation> <translation id="4418686080762064601">Fayllaringiz uchun yorliq yarating</translation> @@ -421,6 +423,7 @@ <translation id="4712283082407695269">“<ph name="PATH" />” ochilmoqda</translation> <translation id="4720185134442950733">Mobil internet tarmog‘i</translation> <translation id="4724850507808590449"><ph name="FILE_COUNT" /> ta rasm saqlab qolindi</translation> +<translation id="4725096204469550614">Shu yil boshi</translation> <translation id="4725511304875193254">Korgi</translation> <translation id="4737050008115666127">Lending</translation> <translation id="4747271164117300400">Makedon</translation>
diff --git a/ui/compositor/test/test_layer_animation_observer.h b/ui/compositor/test/test_layer_animation_observer.h index 65c86e4..4b08bac 100644 --- a/ui/compositor/test/test_layer_animation_observer.h +++ b/ui/compositor/test/test_layer_animation_observer.h
@@ -115,25 +115,33 @@ private: int next_epoch_; - raw_ptr<const LayerAnimationSequence> last_attached_sequence_; + // TODO(crbug.com/1298696): Breaks compositor_unittests. + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_attached_sequence_; int last_attached_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_scheduled_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_scheduled_sequence_; int last_scheduled_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_started_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_started_sequence_; int last_started_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_aborted_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_aborted_sequence_; int last_aborted_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_ended_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_ended_sequence_; int last_ended_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_repetition_ended_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_repetition_ended_sequence_; int last_repetition_ended_sequence_epoch_; - raw_ptr<const LayerAnimationSequence> last_detached_sequence_; + raw_ptr<const LayerAnimationSequence, DegradeToNoOpWhenMTE> + last_detached_sequence_; int last_detached_sequence_epoch_; bool requires_notification_when_animator_destroyed_;
diff --git a/ui/file_manager/BUILD.gn b/ui/file_manager/BUILD.gn index b236dc8e..46dfcaa 100644 --- a/ui/file_manager/BUILD.gn +++ b/ui/file_manager/BUILD.gn
@@ -141,6 +141,7 @@ root_dir = preprocess_folder out_dir = "$target_gen_dir/tsc" tsconfig_base = "tsconfig_base.json" + composite = true extra_deps = [ ":copy_ts", @@ -281,6 +282,24 @@ in_files = ts_templates } +ts_library("test_build_ts") { + testonly = true + root_dir = "." + out_dir = "$target_gen_dir/tsc_test" + tsconfig_base = "tsconfig_base.json" + + in_files = [ "file_manager/widgets/xf_breadcrumbs_unittest.ts" ] + + path_mappings = [ + # for chai_assert.js. + "chrome://webui-test/*|" + + rebase_path("$root_gen_dir/chrome/test/data/webui/tsc/*", + target_gen_dir), + ] + + deps = [ ":build_ts" ] +} + # GRD for test files. generate_grd("build_tests_grdp") { testonly = true @@ -298,7 +317,11 @@ out_grd = "$target_gen_dir/tests_gen_resources.grdp" manifest_files = - filter_include(get_target_outputs(":build_ts"), [ "*.manifest" ]) + filter_include(get_target_outputs(":build_ts"), [ "*.manifest" ]) + + filter_include(get_target_outputs(":test_build_ts"), [ "*.manifest" ]) - deps = [ ":build_ts" ] + deps = [ + ":build_ts", + ":test_build_ts", + ] }
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css index f9efe6d..a093442 100644 --- a/ui/file_manager/file_manager/foreground/css/file_manager.css +++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -1787,8 +1787,8 @@ border: 1px solid var(--cros-focus-ring-color-inactive); } -#list-container.nohover grid > .accepts { - background-color: transparent; +#list-container grid > .accepts { + background-color: var(--cros-highlight-color-hover) } #directory-tree .tree-item.accepts > .tree-row,
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js index d73216f..1809b7f 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -838,10 +838,6 @@ this.setContextMenuForInput_(this.ui_.listContainer.renameInput); this.setContextMenuForInput_( this.directoryTreeNamingController_.getInputElement()); - - this.document_.addEventListener( - 'command', - this.ui_.listContainer.clearHover.bind(this.ui_.listContainer)); CommandHandler.registerUndoDeleteToast(this); }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/list_container.js b/ui/file_manager/file_manager/foreground/js/ui/list_container.js index 3d14363..2b338f7 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/list_container.js +++ b/ui/file_manager/file_manager/foreground/js/ui/list_container.js
@@ -133,7 +133,6 @@ this.grid.id = 'file-list'; this.element.addEventListener('keydown', this.onKeyDown_.bind(this)); this.element.addEventListener('keypress', this.onKeyPress_.bind(this)); - this.element.addEventListener('mousemove', this.onMouseMove_.bind(this)); this.element.addEventListener( 'contextmenu', this.onContextMenu_.bind(this), /* useCapture */ true); @@ -264,13 +263,6 @@ } /** - * Clears hover highlighting in the list container until next mouse move. - */ - clearHover() { - this.element.classList.add('nohover'); - } - - /** * Finds list item element from the ancestor node. * @param {!HTMLElement} node * @return {ListItem} @@ -341,19 +333,6 @@ event.stopImmediatePropagation(); return; } - - switch (event.key) { - case 'Home': - case 'End': - case 'ArrowUp': - case 'ArrowDown': - case 'ArrowLeft': - case 'ArrowRight': - // When navigating with keyboard we hide the distracting mouse hover - // highlighting until the user moves the mouse again. - this.clearHover(); - break; - } } /** @@ -380,16 +359,6 @@ dispatchSimpleEvent(this.element, ListContainer.EventType.TEXT_SEARCH); } } - - /** - * Mousemove event handler for the div#list-container element. - * @param {Event} event Mouse event. - * @private - */ - onMouseMove_(event) { - // The user grabbed the mouse, restore the hover highlighting. - this.element.classList.remove('nohover'); - } } /**
diff --git a/ui/file_manager/file_manager/foreground/js/ui/splitter.js b/ui/file_manager/file_manager/foreground/js/ui/splitter.js index bb6f3a5..7776535 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/splitter.js +++ b/ui/file_manager/file_manager/foreground/js/ui/splitter.js
@@ -148,7 +148,9 @@ e = /** @type {!TouchEvent} */ (e); if (e.touches.length === 1) { this.startDrag(e.touches[0].clientX, true); - e.preventDefault(); + if (e.cancelable) { + e.preventDefault(); + } } },
diff --git a/ui/file_manager/file_manager/widgets/xf_breadcrumbs_unittest.ts b/ui/file_manager/file_manager/widgets/xf_breadcrumbs_unittest.ts new file mode 100644 index 0000000..4ee631e --- /dev/null +++ b/ui/file_manager/file_manager/widgets/xf_breadcrumbs_unittest.ts
@@ -0,0 +1,10 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {assertEquals} from 'chrome://webui-test/chai_assert.js'; + +export function testBla() { + console.log('ITs time!'); + assertEquals(1, 1); +}
diff --git a/ui/webui/resources/cr_elements/shared_vars_css.html b/ui/webui/resources/cr_elements/shared_vars_css.html index 6a571847..74a6cbb2 100644 --- a/ui/webui/resources/cr_elements/shared_vars_css.html +++ b/ui/webui/resources/cr_elements/shared_vars_css.html
@@ -202,7 +202,7 @@ --cr-form-field-bottom-spacing: 16px; --cr-form-field-label-font-size: .625rem; --cr-form-field-label-height: 1em; - --cr-form-field-label-line-height: 1em; + --cr-form-field-label-line-height: 1; } </style> </custom-style>